@groupteknology/vuno 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +160 -37
  3. package/dist/module.d.cts +2 -0
  4. package/dist/module.d.mts +2 -10
  5. package/dist/module.json +1 -1
  6. package/dist/module.mjs +14 -24
  7. package/dist/types.d.mts +11 -3
  8. package/package.json +49 -44
  9. package/dist/runtime/app/assets/css/main.css +0 -1
  10. package/dist/runtime/app/components/Cell/CellBadge.d.vue.ts +0 -5
  11. package/dist/runtime/app/components/Cell/CellBadge.vue +0 -24
  12. package/dist/runtime/app/components/Cell/CellBadge.vue.d.ts +0 -5
  13. package/dist/runtime/app/components/Cell/CellBoolean.d.vue.ts +0 -5
  14. package/dist/runtime/app/components/Cell/CellBoolean.vue +0 -21
  15. package/dist/runtime/app/components/Cell/CellBoolean.vue.d.ts +0 -5
  16. package/dist/runtime/app/components/Cell/CellCurrency.d.vue.ts +0 -5
  17. package/dist/runtime/app/components/Cell/CellCurrency.vue +0 -14
  18. package/dist/runtime/app/components/Cell/CellCurrency.vue.d.ts +0 -5
  19. package/dist/runtime/app/components/Cell/CellDate.d.vue.ts +0 -5
  20. package/dist/runtime/app/components/Cell/CellDate.vue +0 -19
  21. package/dist/runtime/app/components/Cell/CellDate.vue.d.ts +0 -5
  22. package/dist/runtime/app/components/Cell/CellImage.d.vue.ts +0 -5
  23. package/dist/runtime/app/components/Cell/CellImage.vue +0 -22
  24. package/dist/runtime/app/components/Cell/CellImage.vue.d.ts +0 -5
  25. package/dist/runtime/app/components/Cell/CellNumber.d.vue.ts +0 -5
  26. package/dist/runtime/app/components/Cell/CellNumber.vue +0 -15
  27. package/dist/runtime/app/components/Cell/CellNumber.vue.d.ts +0 -5
  28. package/dist/runtime/app/components/Cell/CellText.d.vue.ts +0 -5
  29. package/dist/runtime/app/components/Cell/CellText.vue +0 -13
  30. package/dist/runtime/app/components/Cell/CellText.vue.d.ts +0 -5
  31. package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +0 -35
  32. package/dist/runtime/app/components/Confirm/Confirm.vue +0 -68
  33. package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +0 -35
  34. package/dist/runtime/app/components/Field/FieldArray.d.vue.ts +0 -5
  35. package/dist/runtime/app/components/Field/FieldArray.vue +0 -128
  36. package/dist/runtime/app/components/Field/FieldArray.vue.d.ts +0 -5
  37. package/dist/runtime/app/components/Field/FieldCheckbox.d.vue.ts +0 -5
  38. package/dist/runtime/app/components/Field/FieldCheckbox.vue +0 -30
  39. package/dist/runtime/app/components/Field/FieldCheckbox.vue.d.ts +0 -5
  40. package/dist/runtime/app/components/Field/FieldColor.d.vue.ts +0 -5
  41. package/dist/runtime/app/components/Field/FieldColor.vue +0 -57
  42. package/dist/runtime/app/components/Field/FieldColor.vue.d.ts +0 -5
  43. package/dist/runtime/app/components/Field/FieldEmail.d.vue.ts +0 -5
  44. package/dist/runtime/app/components/Field/FieldEmail.vue +0 -37
  45. package/dist/runtime/app/components/Field/FieldEmail.vue.d.ts +0 -5
  46. package/dist/runtime/app/components/Field/FieldFile.d.vue.ts +0 -5
  47. package/dist/runtime/app/components/Field/FieldFile.vue +0 -93
  48. package/dist/runtime/app/components/Field/FieldFile.vue.d.ts +0 -5
  49. package/dist/runtime/app/components/Field/FieldNumber.d.vue.ts +0 -5
  50. package/dist/runtime/app/components/Field/FieldNumber.vue +0 -38
  51. package/dist/runtime/app/components/Field/FieldNumber.vue.d.ts +0 -5
  52. package/dist/runtime/app/components/Field/FieldPassword.d.vue.ts +0 -5
  53. package/dist/runtime/app/components/Field/FieldPassword.vue +0 -35
  54. package/dist/runtime/app/components/Field/FieldPassword.vue.d.ts +0 -5
  55. package/dist/runtime/app/components/Field/FieldRadio.d.vue.ts +0 -5
  56. package/dist/runtime/app/components/Field/FieldRadio.vue +0 -33
  57. package/dist/runtime/app/components/Field/FieldRadio.vue.d.ts +0 -5
  58. package/dist/runtime/app/components/Field/FieldSelect.d.vue.ts +0 -5
  59. package/dist/runtime/app/components/Field/FieldSelect.vue +0 -38
  60. package/dist/runtime/app/components/Field/FieldSelect.vue.d.ts +0 -5
  61. package/dist/runtime/app/components/Field/FieldSlug.d.vue.ts +0 -5
  62. package/dist/runtime/app/components/Field/FieldSlug.vue +0 -92
  63. package/dist/runtime/app/components/Field/FieldSlug.vue.d.ts +0 -5
  64. package/dist/runtime/app/components/Field/FieldSwitch.d.vue.ts +0 -5
  65. package/dist/runtime/app/components/Field/FieldSwitch.vue +0 -27
  66. package/dist/runtime/app/components/Field/FieldSwitch.vue.d.ts +0 -5
  67. package/dist/runtime/app/components/Field/FieldText.d.vue.ts +0 -5
  68. package/dist/runtime/app/components/Field/FieldText.vue +0 -38
  69. package/dist/runtime/app/components/Field/FieldText.vue.d.ts +0 -5
  70. package/dist/runtime/app/components/Field/FieldTextarea.d.vue.ts +0 -5
  71. package/dist/runtime/app/components/Field/FieldTextarea.vue +0 -36
  72. package/dist/runtime/app/components/Field/FieldTextarea.vue.d.ts +0 -5
  73. package/dist/runtime/app/components/Form/Form.d.vue.ts +0 -48
  74. package/dist/runtime/app/components/Form/Form.vue +0 -138
  75. package/dist/runtime/app/components/Form/Form.vue.d.ts +0 -48
  76. package/dist/runtime/app/components/Form/FormField.d.vue.ts +0 -7
  77. package/dist/runtime/app/components/Form/FormField.vue +0 -63
  78. package/dist/runtime/app/components/Form/FormField.vue.d.ts +0 -7
  79. package/dist/runtime/app/components/Form/FormModal.d.vue.ts +0 -60
  80. package/dist/runtime/app/components/Form/FormModal.vue +0 -83
  81. package/dist/runtime/app/components/Form/FormModal.vue.d.ts +0 -60
  82. package/dist/runtime/app/components/Form/FormSection.d.vue.ts +0 -12
  83. package/dist/runtime/app/components/Form/FormSection.vue +0 -43
  84. package/dist/runtime/app/components/Form/FormSection.vue.d.ts +0 -12
  85. package/dist/runtime/app/components/Page/Page.d.vue.ts +0 -24
  86. package/dist/runtime/app/components/Page/Page.vue +0 -63
  87. package/dist/runtime/app/components/Page/Page.vue.d.ts +0 -24
  88. package/dist/runtime/app/components/State/EmptyState.d.vue.ts +0 -20
  89. package/dist/runtime/app/components/State/EmptyState.vue +0 -36
  90. package/dist/runtime/app/components/State/EmptyState.vue.d.ts +0 -20
  91. package/dist/runtime/app/components/State/FailureState.d.vue.ts +0 -10
  92. package/dist/runtime/app/components/State/FailureState.vue +0 -34
  93. package/dist/runtime/app/components/State/FailureState.vue.d.ts +0 -10
  94. package/dist/runtime/app/components/Table/Table.d.vue.ts +0 -70
  95. package/dist/runtime/app/components/Table/Table.vue +0 -441
  96. package/dist/runtime/app/components/Table/Table.vue.d.ts +0 -70
  97. package/dist/runtime/app/components/Table/TableCell.d.vue.ts +0 -8
  98. package/dist/runtime/app/components/Table/TableCell.vue +0 -35
  99. package/dist/runtime/app/components/Table/TableCell.vue.d.ts +0 -8
  100. package/dist/runtime/app/composables/useVunoCrud.d.ts +0 -23
  101. package/dist/runtime/app/composables/useVunoCrud.js +0 -139
  102. package/dist/runtime/app/composables/useVunoField.d.ts +0 -10
  103. package/dist/runtime/app/composables/useVunoField.js +0 -34
  104. package/dist/runtime/app/composables/useVunoForm.d.ts +0 -2
  105. package/dist/runtime/app/composables/useVunoForm.js +0 -9
  106. package/dist/runtime/app/composables/useVunoTableQuery.d.ts +0 -51
  107. package/dist/runtime/app/composables/useVunoTableQuery.js +0 -110
  108. package/dist/runtime/app/composables/useVunoTheme.d.ts +0 -12
  109. package/dist/runtime/app/composables/useVunoTheme.js +0 -35
  110. package/dist/runtime/app/theme/index.d.ts +0 -14
  111. package/dist/runtime/app/theme/index.js +0 -228
  112. package/dist/runtime/app/types/app-config.d.ts +0 -8
  113. package/dist/runtime/app/types/app-config.js +0 -1
  114. package/dist/runtime/app/types/confirm.d.ts +0 -11
  115. package/dist/runtime/app/types/confirm.js +0 -0
  116. package/dist/runtime/app/types/crud.d.ts +0 -108
  117. package/dist/runtime/app/types/crud.js +0 -0
  118. package/dist/runtime/app/types/field.d.ts +0 -128
  119. package/dist/runtime/app/types/field.js +0 -0
  120. package/dist/runtime/app/types/form.d.ts +0 -39
  121. package/dist/runtime/app/types/form.js +0 -1
  122. package/dist/runtime/app/types/index.d.ts +0 -9
  123. package/dist/runtime/app/types/index.js +0 -1
  124. package/dist/runtime/app/types/page.d.ts +0 -6
  125. package/dist/runtime/app/types/page.js +0 -0
  126. package/dist/runtime/app/types/responsive.d.ts +0 -8
  127. package/dist/runtime/app/types/responsive.js +0 -0
  128. package/dist/runtime/app/types/table.d.ts +0 -197
  129. package/dist/runtime/app/types/table.js +0 -0
  130. package/dist/runtime/app/types/theme.d.ts +0 -83
  131. package/dist/runtime/app/types/theme.js +0 -0
  132. package/dist/runtime/app/utils/column.d.ts +0 -9
  133. package/dist/runtime/app/utils/column.js +0 -5
  134. package/dist/runtime/app/utils/format.d.ts +0 -9
  135. package/dist/runtime/app/utils/format.js +0 -30
  136. package/dist/runtime/app/utils/grid.d.ts +0 -9
  137. package/dist/runtime/app/utils/grid.js +0 -91
  138. package/dist/runtime/app/utils/path.d.ts +0 -16
  139. package/dist/runtime/app/utils/path.js +0 -74
  140. package/dist/runtime/app/utils/query-key.d.ts +0 -20
  141. package/dist/runtime/app/utils/query-key.js +0 -7
@@ -1,24 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- const props = defineProps({
4
- column: { type: Object, required: true },
5
- row: { type: Object, required: true },
6
- value: { type: null, required: true }
7
- });
8
- const text = computed(() => props.value === null || props.value === void 0 ? "" : String(props.value));
9
- const badge = computed(() => {
10
- const entry = props.column.map?.[text.value];
11
- return {
12
- color: entry?.color ?? props.column.color ?? "neutral",
13
- label: entry?.label ?? text.value
14
- };
15
- });
16
- </script>
17
-
18
- <template>
19
- <UBadge
20
- :color="badge.color"
21
- :label="badge.label"
22
- variant="subtle"
23
- />
24
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'badge'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'boolean'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,21 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- import { useVunoIcons } from "#vuno/composables/useVunoTheme";
4
- const props = defineProps({
5
- column: { type: Object, required: true },
6
- row: { type: Object, required: true },
7
- value: { type: null, required: true }
8
- });
9
- const icons = useVunoIcons();
10
- const labelled = computed(() => Boolean(props.column.trueLabel || props.column.falseLabel));
11
- </script>
12
-
13
- <template>
14
- <span v-if="labelled">{{ props.value ? props.column.trueLabel ?? "" : props.column.falseLabel ?? "" }}</span>
15
-
16
- <UIcon
17
- v-else
18
- :class="props.value ? 'text-success' : 'text-muted'"
19
- :name="props.value ? icons.booleanTrue : icons.booleanFalse"
20
- />
21
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'boolean'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'currency'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,14 +0,0 @@
1
- <script setup>
2
- import { useLocale } from "@nuxt/ui/composables";
3
- import { formatCurrency } from "#vuno/utils/format";
4
- const props = defineProps({
5
- column: { type: Object, required: true },
6
- row: { type: Object, required: true },
7
- value: { type: null, required: true }
8
- });
9
- const locale = useLocale();
10
- </script>
11
-
12
- <template>
13
- <span class="tabular-nums">{{ formatCurrency(props.value, locale.code.value, props.column.currency, props.column.decimals) }}</span>
14
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'currency'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'date'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,19 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- import { useLocale } from "@nuxt/ui/composables";
4
- import { formatDate } from "#vuno/utils/format";
5
- const props = defineProps({
6
- column: { type: Object, required: true },
7
- row: { type: Object, required: true },
8
- value: { type: null, required: true }
9
- });
10
- const locale = useLocale();
11
- const options = computed(() => ({
12
- dateStyle: props.column.dateStyle ?? "medium",
13
- ...props.column.timeStyle ? { timeStyle: props.column.timeStyle } : {}
14
- }));
15
- </script>
16
-
17
- <template>
18
- <span class="tabular-nums">{{ formatDate(props.value, locale.code.value, options) }}</span>
19
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'date'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'image'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,22 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- import { getPath } from "#vuno/utils/path";
4
- const props = defineProps({
5
- column: { type: Object, required: true },
6
- row: { type: Object, required: true },
7
- value: { type: null, required: true }
8
- });
9
- const src = computed(() => props.value === null || props.value === void 0 ? "" : String(props.value));
10
- const alt = computed(() => {
11
- if (props.column.altKey) return String(getPath(props.row, props.column.altKey) ?? "");
12
- return props.column.alt ?? "";
13
- });
14
- </script>
15
-
16
- <template>
17
- <UAvatar
18
- :alt="alt"
19
- :size="props.column.size ?? 'md'"
20
- :src="src"
21
- />
22
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'image'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'number'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,15 +0,0 @@
1
- <script setup>
2
- import { useLocale } from "@nuxt/ui/composables";
3
- import { formatNumber } from "#vuno/utils/format";
4
- const props = defineProps({
5
- column: { type: Object, required: true },
6
- row: { type: Object, required: true },
7
- value: { type: null, required: true }
8
- });
9
- const locale = useLocale();
10
- </script>
11
-
12
- <template>
13
- <!-- `tabular-nums` alinea las cifras en columna; sin ello los dígitos bailan. -->
14
- <span class="tabular-nums">{{ formatNumber(props.value, locale.code.value, props.column.decimals) }}</span>
15
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'number'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'text'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,13 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- const props = defineProps({
4
- column: { type: Object, required: true },
5
- row: { type: Object, required: true },
6
- value: { type: null, required: true }
7
- });
8
- const text = computed(() => props.value === null || props.value === void 0 ? "" : String(props.value));
9
- </script>
10
-
11
- <template>
12
- <span :class="props.column.truncate ? 'block max-w-[32ch] truncate' : void 0">{{ text }}</span>
13
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoTableCellProps } from '#vuno/types/table';
2
- type __VLS_Props = VunoTableCellProps<'text'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,35 +0,0 @@
1
- import type { VunoConfirmOptions } from '#vuno/types/confirm';
2
- import type { VunoFieldSlots } from '#vuno/types/field';
3
- type __VLS_Props = VunoConfirmOptions & {
4
- loading?: boolean;
5
- ui?: VunoFieldSlots;
6
- };
7
- type __VLS_Slots = {
8
- /**
9
- * Sustituye a `description`. Para cuando el aviso es información que
10
- * cambia la decisión —cuántos hijos quedan huérfanos, qué se pierde—
11
- * y aplanarlo a una frase la escondería.
12
- */
13
- default?: () => unknown;
14
- };
15
- type __VLS_ModelProps = {
16
- 'open'?: boolean;
17
- };
18
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- "update:open": (value: boolean) => any;
21
- confirm: () => any;
22
- cancel: () => any;
23
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
24
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
25
- onConfirm?: (() => any) | undefined;
26
- onCancel?: (() => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
- declare const _default: typeof __VLS_export;
30
- export default _default;
31
- type __VLS_WithSlots<T, S> = T & {
32
- new (): {
33
- $slots: S;
34
- };
35
- };
@@ -1,68 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- import { useVunoIcons, useVunoMessages, useVunoTheme } from "#vuno/composables/useVunoTheme";
4
- const props = defineProps({
5
- cancelLabel: { type: String, required: false },
6
- color: { type: String, required: false },
7
- confirmLabel: { type: String, required: false },
8
- description: { type: String, required: false },
9
- icon: { type: String, required: false },
10
- title: { type: String, required: false },
11
- loading: { type: Boolean, required: false },
12
- ui: { type: Object, required: false }
13
- });
14
- const emit = defineEmits(["cancel", "confirm"]);
15
- defineSlots();
16
- const open = defineModel("open", { type: Boolean, ...{ default: false } });
17
- const icons = useVunoIcons();
18
- const messages = useVunoMessages();
19
- const ui = useVunoTheme("confirm", () => props.ui);
20
- const color = computed(() => props.color ?? "error");
21
- const modalUi = computed(() => ({ content: ui.value.content, footer: ui.value.footer }));
22
- function onCancel() {
23
- open.value = false;
24
- emit("cancel");
25
- }
26
- function onConfirm() {
27
- emit("confirm");
28
- if (!props.loading) open.value = false;
29
- }
30
- </script>
31
-
32
- <template>
33
- <UModal
34
- v-model:open="open"
35
- :dismissible="!props.loading"
36
- scrollable
37
- :title="props.title ?? messages.confirmTitle"
38
- :ui="modalUi"
39
- >
40
- <template #body>
41
- <div :class="ui.body">
42
- <UIcon
43
- :class="[ui.icon, `text-${color}`]"
44
- :name="props.icon ?? icons.confirm"
45
- />
46
- <div :class="ui.description">
47
- <slot>{{ props.description ?? messages.confirmDescription }}</slot>
48
- </div>
49
- </div>
50
- </template>
51
-
52
- <template #footer>
53
- <UButton
54
- color="neutral"
55
- :disabled="props.loading"
56
- :label="props.cancelLabel ?? messages.cancel"
57
- variant="ghost"
58
- @click="onCancel"
59
- />
60
- <UButton
61
- :color="color"
62
- :label="props.confirmLabel ?? messages.confirm"
63
- :loading="props.loading"
64
- @click="onConfirm"
65
- />
66
- </template>
67
- </UModal>
68
- </template>
@@ -1,35 +0,0 @@
1
- import type { VunoConfirmOptions } from '#vuno/types/confirm';
2
- import type { VunoFieldSlots } from '#vuno/types/field';
3
- type __VLS_Props = VunoConfirmOptions & {
4
- loading?: boolean;
5
- ui?: VunoFieldSlots;
6
- };
7
- type __VLS_Slots = {
8
- /**
9
- * Sustituye a `description`. Para cuando el aviso es información que
10
- * cambia la decisión —cuántos hijos quedan huérfanos, qué se pierde—
11
- * y aplanarlo a una frase la escondería.
12
- */
13
- default?: () => unknown;
14
- };
15
- type __VLS_ModelProps = {
16
- 'open'?: boolean;
17
- };
18
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- "update:open": (value: boolean) => any;
21
- confirm: () => any;
22
- cancel: () => any;
23
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
24
- "onUpdate:open"?: ((value: boolean) => any) | undefined;
25
- onConfirm?: (() => any) | undefined;
26
- onCancel?: (() => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
- declare const _default: typeof __VLS_export;
30
- export default _default;
31
- type __VLS_WithSlots<T, S> = T & {
32
- new (): {
33
- $slots: S;
34
- };
35
- };
@@ -1,5 +0,0 @@
1
- import type { VunoFieldArray } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldArray, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,128 +0,0 @@
1
- <script setup>
2
- import { computed } from "vue";
3
- import { useVunoField } from "#vuno/composables/useVunoField";
4
- import { useVunoIcons, useVunoMessages, useVunoTheme } from "#vuno/composables/useVunoTheme";
5
- import { getColumnSpanClass } from "#vuno/utils/grid";
6
- import FormField from "../Form/FormField.vue";
7
- const props = defineProps({
8
- name: { type: String, required: true },
9
- description: { type: String, required: false },
10
- disabled: { type: Boolean, required: false },
11
- help: { type: String, required: false },
12
- hint: { type: String, required: false },
13
- label: { type: String, required: false },
14
- required: { type: Boolean, required: false },
15
- size: { type: String, required: false },
16
- ui: { type: Object, required: false },
17
- addLabel: { type: String, required: false },
18
- fields: { type: Array, required: true },
19
- max: { type: Number, required: false },
20
- min: { type: Number, required: false },
21
- sortable: { type: Boolean, required: false }
22
- });
23
- const { value } = useVunoField(() => props.name);
24
- const icons = useVunoIcons();
25
- const messages = useVunoMessages();
26
- const ui = useVunoTheme("fieldArray", () => props.ui);
27
- const items = computed(() => value.value ?? []);
28
- const canAdd = computed(() => props.max === void 0 || items.value.length < props.max);
29
- const canRemove = computed(() => items.value.length > (props.min ?? 0));
30
- function emptyItem() {
31
- const item = {};
32
- for (const field of props.fields) {
33
- item[field.name] = field.type === "checkbox" ? false : field.type === "number" ? void 0 : field.type === "array" || field.type === "file" ? [] : "";
34
- }
35
- return item;
36
- }
37
- function fieldAt(field, index) {
38
- return { ...field, name: `${props.name}.${index}.${field.name}` };
39
- }
40
- function add() {
41
- if (!canAdd.value) return;
42
- value.value = [...items.value, emptyItem()];
43
- }
44
- function remove(index) {
45
- if (!canRemove.value) return;
46
- value.value = items.value.filter((_, position) => position !== index);
47
- }
48
- function move(index, offset) {
49
- const next = [...items.value];
50
- const target = index + offset;
51
- if (target < 0 || target >= next.length) return;
52
- const [moved] = next.splice(index, 1);
53
- if (!moved) return;
54
- next.splice(target, 0, moved);
55
- value.value = next;
56
- }
57
- </script>
58
-
59
- <template>
60
- <div :class="ui.root">
61
- <div
62
- v-for="(item, index) in items"
63
- :key="index"
64
- :class="ui.item"
65
- >
66
- <div :class="ui.itemHeader">
67
- <span :class="ui.itemLabel">{{ index + 1 }}</span>
68
-
69
- <div :class="ui.itemActions">
70
- <UButton
71
- v-if="props.sortable && index > 0"
72
- :aria-label="messages.fileMoveUp"
73
- color="neutral"
74
- :icon="icons.fileMoveUp"
75
- size="xs"
76
- variant="ghost"
77
- @click="move(index, -1)"
78
- />
79
- <UButton
80
- v-if="props.sortable && index < items.length - 1"
81
- :aria-label="messages.fileMoveDown"
82
- color="neutral"
83
- :icon="icons.fileMoveDown"
84
- size="xs"
85
- variant="ghost"
86
- @click="move(index, 1)"
87
- />
88
- <UButton
89
- :aria-label="messages.removeItem"
90
- color="error"
91
- :disabled="!canRemove"
92
- :icon="icons.removeItem"
93
- size="xs"
94
- variant="ghost"
95
- @click="remove(index)"
96
- />
97
- </div>
98
- </div>
99
-
100
- <div :class="ui.itemFields">
101
- <div
102
- v-for="field in props.fields"
103
- :key="`${index}-${field.name}`"
104
- :class="getColumnSpanClass(field.columns)"
105
- >
106
- <FormField :field="fieldAt(field, index)" />
107
- </div>
108
- </div>
109
- </div>
110
-
111
- <div
112
- v-if="items.length === 0"
113
- :class="ui.empty"
114
- >
115
- {{ messages.emptyArray }}
116
- </div>
117
-
118
- <UButton
119
- class="self-start"
120
- color="neutral"
121
- :disabled="!canAdd"
122
- :icon="icons.addItem"
123
- :label="props.addLabel ?? messages.addItem"
124
- variant="outline"
125
- @click="add"
126
- />
127
- </div>
128
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoFieldArray } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldArray, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoFieldCheckbox } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldCheckbox, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,30 +0,0 @@
1
- <script setup>
2
- import { useVunoField } from "#vuno/composables/useVunoField";
3
- import { useVunoTheme } from "#vuno/composables/useVunoTheme";
4
- const props = defineProps({
5
- name: { type: String, required: true },
6
- description: { type: String, required: false },
7
- disabled: { type: Boolean, required: false },
8
- help: { type: String, required: false },
9
- hint: { type: String, required: false },
10
- label: { type: String, required: false },
11
- required: { type: Boolean, required: false },
12
- size: { type: String, required: false },
13
- ui: { type: Object, required: false },
14
- indeterminate: { type: Boolean, required: false }
15
- });
16
- const { value } = useVunoField(() => props.name);
17
- const ui = useVunoTheme("fieldCheckbox", () => props.ui);
18
- </script>
19
-
20
- <template>
21
- <UCheckbox
22
- v-model="value"
23
- :disabled="props.disabled"
24
- :indeterminate="props.indeterminate"
25
- :name="props.name"
26
- :required="props.required"
27
- :size="props.size"
28
- :ui="ui"
29
- />
30
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoFieldCheckbox } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldCheckbox, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoFieldColor } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldColor, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,57 +0,0 @@
1
- <script setup>
2
- import { useVunoField } from "#vuno/composables/useVunoField";
3
- import { useVunoTheme } from "#vuno/composables/useVunoTheme";
4
- const props = defineProps({
5
- name: { type: String, required: true },
6
- description: { type: String, required: false },
7
- disabled: { type: Boolean, required: false },
8
- help: { type: String, required: false },
9
- hint: { type: String, required: false },
10
- label: { type: String, required: false },
11
- required: { type: Boolean, required: false },
12
- size: { type: String, required: false },
13
- ui: { type: Object, required: false },
14
- placeholder: { type: String, required: false }
15
- });
16
- const { value } = useVunoField(() => props.name);
17
- const ui = useVunoTheme("fieldColor", () => props.ui);
18
- </script>
19
-
20
- <template>
21
- <div :class="ui.root">
22
- <!-- El selector nativo y el texto comparten valor: se puede pegar un
23
- código de la guía de marca sin pelearse con la rueda de color. -->
24
- <UPopover>
25
- <UButton
26
- :aria-label="props.label"
27
- color="neutral"
28
- :disabled="props.disabled"
29
- :size="props.size"
30
- :ui="{ leadingIcon: 'rounded-full' }"
31
- variant="outline"
32
- >
33
- <span
34
- :class="ui.swatch"
35
- :style="{ backgroundColor: value || 'transparent' }"
36
- />
37
- </UButton>
38
-
39
- <template #content>
40
- <UColorPicker
41
- v-model="value"
42
- class="p-2"
43
- />
44
- </template>
45
- </UPopover>
46
-
47
- <UInput
48
- v-model="value"
49
- class="font-mono"
50
- :disabled="props.disabled"
51
- :name="props.name"
52
- :placeholder="props.placeholder ?? '#000000'"
53
- :size="props.size"
54
- :ui="{ root: 'w-full' }"
55
- />
56
- </div>
57
- </template>
@@ -1,5 +0,0 @@
1
- import type { VunoFieldColor } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldColor, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { VunoFieldEmail } from '#vuno/types/field';
2
- type __VLS_Props = Omit<VunoFieldEmail, 'class' | 'columns'>;
3
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: typeof __VLS_export;
5
- export default _default;