-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
115 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | ||
<div class="md:col-span-2"> | ||
<PTitle :name="'Administración de ' + props.grandPrix.name + ' de ' + grandPrix.season.name" /> | ||
</div> | ||
<div class="md:col-span-1"> | ||
<GrandPrixPagination | ||
is-admin-pag | ||
:competition="props.competition" | ||
:grand-prix="props.grandPrix" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import PTitle from "@/components/lib/PTitle.vue"; | ||
import GrandPrixPagination from "@/components/gps/GrandPrixPagination.vue"; | ||
import {GrandPrix} from "@/types/GrandPrix"; | ||
import {Competition} from "@/types/Competition"; | ||
const props = defineProps({ | ||
grandPrix: { type: GrandPrix, required: true }, | ||
competition: { type: Competition, required: true }, | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,69 @@ | ||
<template> | ||
<div class="flex items-center mb-4 me-4"> | ||
<input id="checkbox" type="checkbox" | ||
:checked="modelValue" | ||
@change="handleChange" | ||
:class="checkboxClasses" | ||
> | ||
<label for="checkbox" class="ms-2 text-sm font-medium text-gray-700 dark:text-gray-300"> | ||
<slot></slot> | ||
</label> | ||
</div> | ||
<div class="flex items-center mb-4 me-4"> | ||
<input | ||
:id="`checkbox-${id}`" | ||
type="checkbox" | ||
:checked="(modelValue) ? modelValue : checked" | ||
:class="checkboxClasses" | ||
@change="handleChange" | ||
> | ||
<label | ||
:for="`checkbox-${id}`" | ||
class="ms-2 text-sm font-medium text-gray-700 dark:text-gray-300" | ||
> | ||
<slot /> | ||
</label> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import {computed, defineModel} from 'vue'; | ||
const modelValue = defineModel<boolean>({ required: true }); | ||
const modelValue = defineModel<boolean>({required: false}); | ||
const props = withDefaults(defineProps<{ | ||
color?: 'primary' | 'secondary' | 'gray' | 'warning' | 'danger'; | ||
id?: number; | ||
checked?: boolean | ||
}>(), { | ||
color: 'primary', | ||
id: 0, | ||
checked: false | ||
}); | ||
const handleChange = (event: Event) => { | ||
modelValue.value = (event.target as HTMLInputElement).checked; | ||
modelValue.value = (event.target as HTMLInputElement).checked; | ||
}; | ||
interface Props { | ||
color?: 'primary' | 'secondary' | 'gray' | 'warning' | 'danger'; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
color: 'primary' | ||
}); | ||
const checkboxClasses = computed(() => ({ | ||
'checkbox': true, // Estilos base | ||
[props.color]: true // Colores tienen el mismo nombre que las clases de css | ||
'checkbox': true, // Estilos base | ||
[props.color]: true // Colores tienen el mismo nombre que las clases de css | ||
})); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.checkbox { | ||
@apply cursor-pointer w-5 h-5 rounded focus:ring-2 border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800; | ||
&.primary { | ||
@apply text-purple-600 accent-purple-500 focus:ring-purple-500 dark:focus:ring-purple-600; | ||
} | ||
&.secondary { | ||
@apply text-blue-600 accent-blue-500 focus:ring-blue-500 dark:focus:ring-blue-600; | ||
} | ||
&.gray { | ||
@apply text-gray-600 accent-gray-500 focus:ring-gray-500 dark:focus:ring-gray-600; | ||
} | ||
&.warning { | ||
@apply text-yellow-600 accent-yellow-500 focus:ring-yellow-500 dark:focus:ring-yellow-600; | ||
} | ||
&.danger { | ||
@apply text-red-600 accent-red-500 focus:ring-red-500 dark:focus:ring-red-600; | ||
} | ||
@apply cursor-pointer w-5 h-5 rounded focus:ring-2 border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:ring-offset-gray-800; | ||
&.primary { | ||
@apply text-purple-600 accent-purple-500 focus:ring-purple-500 dark:focus:ring-purple-600; | ||
} | ||
&.secondary { | ||
@apply text-blue-600 accent-blue-500 focus:ring-blue-500 dark:focus:ring-blue-600; | ||
} | ||
&.gray { | ||
@apply text-gray-600 accent-gray-500 focus:ring-gray-500 dark:focus:ring-gray-600; | ||
} | ||
&.warning { | ||
@apply text-yellow-600 accent-yellow-500 focus:ring-yellow-500 dark:focus:ring-yellow-600; | ||
} | ||
&.danger { | ||
@apply text-red-600 accent-red-500 focus:ring-red-500 dark:focus:ring-red-600; | ||
} | ||
} | ||
</style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<label | ||
class="block tracking-wide text-gray-700 dark:text-gray-300 font-bold mb-2" | ||
:for="props.name" | ||
> | ||
{{ props.label }} | ||
</label> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const props = withDefaults(defineProps<{ | ||
label?: string; | ||
name?: string; | ||
}>(), { | ||
label: '', | ||
name: '' | ||
}) | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
</style> |