@groupteknology/vuno 0.1.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.
- package/LICENSE +21 -0
- package/README.md +215 -0
- package/dist/module.d.mts +10 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +28 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +21 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue +65 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +21 -0
- package/dist/runtime/app/components/Field/FieldArray.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldArray.vue +128 -0
- package/dist/runtime/app/components/Field/FieldArray.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldCheckbox.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldCheckbox.vue +30 -0
- package/dist/runtime/app/components/Field/FieldCheckbox.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldColor.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldColor.vue +57 -0
- package/dist/runtime/app/components/Field/FieldColor.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldEmail.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldEmail.vue +37 -0
- package/dist/runtime/app/components/Field/FieldEmail.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldFile.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldFile.vue +93 -0
- package/dist/runtime/app/components/Field/FieldFile.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldNumber.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldNumber.vue +38 -0
- package/dist/runtime/app/components/Field/FieldNumber.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldPassword.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldPassword.vue +35 -0
- package/dist/runtime/app/components/Field/FieldPassword.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldRadio.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldRadio.vue +33 -0
- package/dist/runtime/app/components/Field/FieldRadio.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldSelect.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldSelect.vue +38 -0
- package/dist/runtime/app/components/Field/FieldSelect.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldSlug.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldSlug.vue +92 -0
- package/dist/runtime/app/components/Field/FieldSlug.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldText.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldText.vue +38 -0
- package/dist/runtime/app/components/Field/FieldText.vue.d.ts +5 -0
- package/dist/runtime/app/components/Field/FieldTextarea.d.vue.ts +5 -0
- package/dist/runtime/app/components/Field/FieldTextarea.vue +36 -0
- package/dist/runtime/app/components/Field/FieldTextarea.vue.d.ts +5 -0
- package/dist/runtime/app/components/Form/Form.d.vue.ts +48 -0
- package/dist/runtime/app/components/Form/Form.vue +137 -0
- package/dist/runtime/app/components/Form/Form.vue.d.ts +48 -0
- package/dist/runtime/app/components/Form/FormField.d.vue.ts +7 -0
- package/dist/runtime/app/components/Form/FormField.vue +61 -0
- package/dist/runtime/app/components/Form/FormField.vue.d.ts +7 -0
- package/dist/runtime/app/components/Form/FormModal.d.vue.ts +54 -0
- package/dist/runtime/app/components/Form/FormModal.vue +82 -0
- package/dist/runtime/app/components/Form/FormModal.vue.d.ts +54 -0
- package/dist/runtime/app/components/Form/FormSection.d.vue.ts +12 -0
- package/dist/runtime/app/components/Form/FormSection.vue +43 -0
- package/dist/runtime/app/components/Form/FormSection.vue.d.ts +12 -0
- package/dist/runtime/app/components/Page/Page.d.vue.ts +24 -0
- package/dist/runtime/app/components/Page/Page.vue +63 -0
- package/dist/runtime/app/components/Page/Page.vue.d.ts +24 -0
- package/dist/runtime/app/components/State/EmptyState.d.vue.ts +20 -0
- package/dist/runtime/app/components/State/EmptyState.vue +36 -0
- package/dist/runtime/app/components/State/EmptyState.vue.d.ts +20 -0
- package/dist/runtime/app/components/State/FailureState.d.vue.ts +10 -0
- package/dist/runtime/app/components/State/FailureState.vue +34 -0
- package/dist/runtime/app/components/State/FailureState.vue.d.ts +10 -0
- package/dist/runtime/app/components/Table/Table.d.vue.ts +70 -0
- package/dist/runtime/app/components/Table/Table.vue +432 -0
- package/dist/runtime/app/components/Table/Table.vue.d.ts +70 -0
- package/dist/runtime/app/components/Table/TableCell.d.vue.ts +8 -0
- package/dist/runtime/app/components/Table/TableCell.vue +84 -0
- package/dist/runtime/app/components/Table/TableCell.vue.d.ts +8 -0
- package/dist/runtime/app/composables/useVunoCrud.d.ts +23 -0
- package/dist/runtime/app/composables/useVunoCrud.js +117 -0
- package/dist/runtime/app/composables/useVunoField.d.ts +10 -0
- package/dist/runtime/app/composables/useVunoField.js +34 -0
- package/dist/runtime/app/composables/useVunoForm.d.ts +2 -0
- package/dist/runtime/app/composables/useVunoForm.js +9 -0
- package/dist/runtime/app/composables/useVunoTableQuery.d.ts +51 -0
- package/dist/runtime/app/composables/useVunoTableQuery.js +110 -0
- package/dist/runtime/app/composables/useVunoTheme.d.ts +12 -0
- package/dist/runtime/app/composables/useVunoTheme.js +35 -0
- package/dist/runtime/app/theme/index.d.ts +14 -0
- package/dist/runtime/app/theme/index.js +210 -0
- package/dist/runtime/app/types/app-config.d.ts +8 -0
- package/dist/runtime/app/types/app-config.js +1 -0
- package/dist/runtime/app/types/confirm.d.ts +11 -0
- package/dist/runtime/app/types/confirm.js +0 -0
- package/dist/runtime/app/types/crud.d.ts +64 -0
- package/dist/runtime/app/types/crud.js +0 -0
- package/dist/runtime/app/types/field.d.ts +121 -0
- package/dist/runtime/app/types/field.js +0 -0
- package/dist/runtime/app/types/form.d.ts +39 -0
- package/dist/runtime/app/types/form.js +1 -0
- package/dist/runtime/app/types/index.d.ts +9 -0
- package/dist/runtime/app/types/index.js +1 -0
- package/dist/runtime/app/types/page.d.ts +6 -0
- package/dist/runtime/app/types/page.js +0 -0
- package/dist/runtime/app/types/responsive.d.ts +8 -0
- package/dist/runtime/app/types/responsive.js +0 -0
- package/dist/runtime/app/types/table.d.ts +130 -0
- package/dist/runtime/app/types/table.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +77 -0
- package/dist/runtime/app/types/theme.js +0 -0
- package/dist/runtime/app/utils/format.d.ts +9 -0
- package/dist/runtime/app/utils/format.js +30 -0
- package/dist/runtime/app/utils/grid.d.ts +9 -0
- package/dist/runtime/app/utils/grid.js +91 -0
- package/dist/runtime/app/utils/path.d.ts +16 -0
- package/dist/runtime/app/utils/path.js +74 -0
- package/dist/types.d.mts +5 -0
- package/package.json +83 -0
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
autocomplete: { type: String, required: false },
|
|
15
|
+
autofocus: { type: Boolean, required: false },
|
|
16
|
+
icon: { type: String, required: false },
|
|
17
|
+
placeholder: { type: String, required: false }
|
|
18
|
+
});
|
|
19
|
+
const { value } = useVunoField(() => props.name);
|
|
20
|
+
const ui = useVunoTheme("fieldEmail", () => props.ui);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<UInput
|
|
25
|
+
v-model="value"
|
|
26
|
+
:autocomplete="props.autocomplete ?? 'email'"
|
|
27
|
+
:autofocus="props.autofocus"
|
|
28
|
+
:disabled="props.disabled"
|
|
29
|
+
:icon="props.icon"
|
|
30
|
+
:name="props.name"
|
|
31
|
+
:placeholder="props.placeholder"
|
|
32
|
+
:required="props.required"
|
|
33
|
+
:size="props.size"
|
|
34
|
+
type="email"
|
|
35
|
+
:ui="ui"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldFile } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldFile, '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;
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
const props = defineProps({
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
description: { type: String, required: false },
|
|
8
|
+
disabled: { type: Boolean, required: false },
|
|
9
|
+
help: { type: String, required: false },
|
|
10
|
+
hint: { type: String, required: false },
|
|
11
|
+
label: { type: String, required: false },
|
|
12
|
+
required: { type: Boolean, required: false },
|
|
13
|
+
size: { type: String, required: false },
|
|
14
|
+
ui: { type: Object, required: false },
|
|
15
|
+
accept: { type: String, required: false },
|
|
16
|
+
dropzone: { type: Boolean, required: false },
|
|
17
|
+
layout: { type: String, required: false },
|
|
18
|
+
multiple: { type: Boolean, required: false },
|
|
19
|
+
reorderable: { type: Boolean, required: false }
|
|
20
|
+
});
|
|
21
|
+
const { value } = useVunoField(() => props.name);
|
|
22
|
+
const icons = useVunoIcons();
|
|
23
|
+
const messages = useVunoMessages();
|
|
24
|
+
const ui = useVunoTheme("fieldFile", () => props.ui);
|
|
25
|
+
const isReorderable = computed(() => (props.reorderable ?? true) && (props.multiple ?? true));
|
|
26
|
+
const files = computed(() => value.value ?? []);
|
|
27
|
+
function move(index, offset) {
|
|
28
|
+
const next = [...files.value];
|
|
29
|
+
const target = index + offset;
|
|
30
|
+
if (target < 0 || target >= next.length) return;
|
|
31
|
+
const [moved] = next.splice(index, 1);
|
|
32
|
+
if (!moved) return;
|
|
33
|
+
next.splice(target, 0, moved);
|
|
34
|
+
value.value = next;
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<UFileUpload
|
|
40
|
+
v-model="value"
|
|
41
|
+
:accept="props.accept"
|
|
42
|
+
:disabled="props.disabled"
|
|
43
|
+
:dropzone="props.dropzone"
|
|
44
|
+
:icon="icons.fileUpload"
|
|
45
|
+
:layout="props.layout ?? 'list'"
|
|
46
|
+
:multiple="props.multiple ?? true"
|
|
47
|
+
:name="props.name"
|
|
48
|
+
:required="props.required"
|
|
49
|
+
:size="props.size"
|
|
50
|
+
:ui="ui"
|
|
51
|
+
>
|
|
52
|
+
<template #file-trailing="{ removeFile, index }">
|
|
53
|
+
<div class="ms-auto flex gap-2.5">
|
|
54
|
+
<UTooltip
|
|
55
|
+
v-if="isReorderable && index > 0"
|
|
56
|
+
:text="messages.fileMoveUp"
|
|
57
|
+
>
|
|
58
|
+
<UButton
|
|
59
|
+
:aria-label="messages.fileMoveUp"
|
|
60
|
+
class="rounded-full"
|
|
61
|
+
color="neutral"
|
|
62
|
+
:icon="icons.fileMoveUp"
|
|
63
|
+
variant="soft"
|
|
64
|
+
@click="move(index, -1)"
|
|
65
|
+
/>
|
|
66
|
+
</UTooltip>
|
|
67
|
+
<UTooltip
|
|
68
|
+
v-if="isReorderable && index < files.length - 1"
|
|
69
|
+
:text="messages.fileMoveDown"
|
|
70
|
+
>
|
|
71
|
+
<UButton
|
|
72
|
+
:aria-label="messages.fileMoveDown"
|
|
73
|
+
class="rounded-full"
|
|
74
|
+
color="neutral"
|
|
75
|
+
:icon="icons.fileMoveDown"
|
|
76
|
+
variant="soft"
|
|
77
|
+
@click="move(index, 1)"
|
|
78
|
+
/>
|
|
79
|
+
</UTooltip>
|
|
80
|
+
<UTooltip :text="messages.fileRemove">
|
|
81
|
+
<UButton
|
|
82
|
+
:aria-label="messages.fileRemove"
|
|
83
|
+
class="rounded-full"
|
|
84
|
+
color="neutral"
|
|
85
|
+
:icon="icons.fileRemove"
|
|
86
|
+
variant="soft"
|
|
87
|
+
@click="removeFile(index)"
|
|
88
|
+
/>
|
|
89
|
+
</UTooltip>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
</UFileUpload>
|
|
93
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldFile } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldFile, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldNumber } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldNumber, '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;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
max: { type: Number, required: false },
|
|
15
|
+
min: { type: Number, required: false },
|
|
16
|
+
orientation: { type: String, required: false },
|
|
17
|
+
placeholder: { type: String, required: false },
|
|
18
|
+
step: { type: Number, required: false }
|
|
19
|
+
});
|
|
20
|
+
const { value } = useVunoField(() => props.name);
|
|
21
|
+
const ui = useVunoTheme("fieldNumber", () => props.ui);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<UInputNumber
|
|
26
|
+
v-model="value"
|
|
27
|
+
:disabled="props.disabled"
|
|
28
|
+
:max="props.max"
|
|
29
|
+
:min="props.min"
|
|
30
|
+
:name="props.name"
|
|
31
|
+
:orientation="props.orientation ?? 'vertical'"
|
|
32
|
+
:placeholder="props.placeholder"
|
|
33
|
+
:required="props.required"
|
|
34
|
+
:size="props.size"
|
|
35
|
+
:step="props.step"
|
|
36
|
+
:ui="ui"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldNumber } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldNumber, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldPassword } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldPassword, '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;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
autocomplete: { type: String, required: false },
|
|
15
|
+
autofocus: { type: Boolean, required: false },
|
|
16
|
+
placeholder: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const { value } = useVunoField(() => props.name);
|
|
19
|
+
const ui = useVunoTheme("fieldPassword", () => props.ui);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<UInput
|
|
24
|
+
v-model="value"
|
|
25
|
+
:autocomplete="props.autocomplete ?? 'current-password'"
|
|
26
|
+
:autofocus="props.autofocus"
|
|
27
|
+
:disabled="props.disabled"
|
|
28
|
+
:name="props.name"
|
|
29
|
+
:placeholder="props.placeholder"
|
|
30
|
+
:required="props.required"
|
|
31
|
+
:size="props.size"
|
|
32
|
+
type="password"
|
|
33
|
+
:ui="ui"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldPassword } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldPassword, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldRadio } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldRadio, '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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
items: { type: Array, required: true },
|
|
15
|
+
orientation: { type: String, required: false }
|
|
16
|
+
});
|
|
17
|
+
const { value } = useVunoField(() => props.name);
|
|
18
|
+
const ui = useVunoTheme("fieldRadio", () => props.ui);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<URadioGroup
|
|
23
|
+
v-model="value"
|
|
24
|
+
:disabled="props.disabled"
|
|
25
|
+
:items="props.items"
|
|
26
|
+
:name="props.name"
|
|
27
|
+
:orientation="props.orientation ?? 'vertical'"
|
|
28
|
+
:required="props.required"
|
|
29
|
+
:size="props.size"
|
|
30
|
+
:ui="ui"
|
|
31
|
+
valueKey="value"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldRadio } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldRadio, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldSelect } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldSelect, '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;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVunoField } from "#vuno/composables/useVunoField";
|
|
3
|
+
import { useVunoMessages, 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
|
+
items: { type: Array, required: true },
|
|
15
|
+
multiple: { type: Boolean, required: false },
|
|
16
|
+
placeholder: { type: String, required: false },
|
|
17
|
+
searchable: { type: Boolean, required: false }
|
|
18
|
+
});
|
|
19
|
+
const { value } = useVunoField(() => props.name);
|
|
20
|
+
const messages = useVunoMessages();
|
|
21
|
+
const ui = useVunoTheme("fieldSelect", () => props.ui);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<USelectMenu
|
|
26
|
+
v-model="value"
|
|
27
|
+
:disabled="props.disabled"
|
|
28
|
+
:items="props.items"
|
|
29
|
+
:multiple="props.multiple"
|
|
30
|
+
:name="props.name"
|
|
31
|
+
:placeholder="props.placeholder ?? messages.selectPlaceholder"
|
|
32
|
+
:required="props.required"
|
|
33
|
+
:searchInput="props.searchable ?? false"
|
|
34
|
+
:size="props.size"
|
|
35
|
+
:ui="ui"
|
|
36
|
+
valueKey="value"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldSelect } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldSelect, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldSlug } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldSlug, '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;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { nextTick, ref, useTemplateRef, watch } from "vue";
|
|
3
|
+
import { useVunoField } from "#vuno/composables/useVunoField";
|
|
4
|
+
import { useVunoIcons, useVunoMessages, useVunoTheme } from "#vuno/composables/useVunoTheme";
|
|
5
|
+
import { formatSlug } from "#vuno/utils/format";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
description: { type: String, required: false },
|
|
9
|
+
disabled: { type: Boolean, required: false },
|
|
10
|
+
help: { type: String, required: false },
|
|
11
|
+
hint: { type: String, required: false },
|
|
12
|
+
label: { type: String, required: false },
|
|
13
|
+
required: { type: Boolean, required: false },
|
|
14
|
+
size: { type: String, required: false },
|
|
15
|
+
ui: { type: Object, required: false },
|
|
16
|
+
placeholder: { type: String, required: false },
|
|
17
|
+
source: { type: String, required: true }
|
|
18
|
+
});
|
|
19
|
+
const { value } = useVunoField(() => props.name);
|
|
20
|
+
const { value: sourceValue } = useVunoField(() => props.source);
|
|
21
|
+
const icons = useVunoIcons();
|
|
22
|
+
const messages = useVunoMessages();
|
|
23
|
+
const ui = useVunoTheme("fieldSlug", () => props.ui);
|
|
24
|
+
const input = useTemplateRef("input");
|
|
25
|
+
const isEditing = ref(false);
|
|
26
|
+
const isManual = ref(false);
|
|
27
|
+
let initialised = false;
|
|
28
|
+
watch(
|
|
29
|
+
sourceValue,
|
|
30
|
+
(source) => {
|
|
31
|
+
if (!initialised) {
|
|
32
|
+
initialised = true;
|
|
33
|
+
if (value.value) {
|
|
34
|
+
isManual.value = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (isManual.value) return;
|
|
39
|
+
value.value = formatSlug(source);
|
|
40
|
+
},
|
|
41
|
+
{ immediate: true }
|
|
42
|
+
);
|
|
43
|
+
const onUpdate = (next) => {
|
|
44
|
+
const formatted = formatSlug(next);
|
|
45
|
+
isManual.value = true;
|
|
46
|
+
value.value = formatted !== "" && next.trimEnd().endsWith("-") ? `${formatted}-` : formatted;
|
|
47
|
+
};
|
|
48
|
+
const startEditing = async () => {
|
|
49
|
+
isEditing.value = true;
|
|
50
|
+
await nextTick();
|
|
51
|
+
input.value?.inputRef?.focus();
|
|
52
|
+
};
|
|
53
|
+
const stopEditing = () => {
|
|
54
|
+
isEditing.value = false;
|
|
55
|
+
value.value = formatSlug(value.value);
|
|
56
|
+
};
|
|
57
|
+
const resetToSource = () => {
|
|
58
|
+
isEditing.value = false;
|
|
59
|
+
isManual.value = false;
|
|
60
|
+
value.value = formatSlug(sourceValue.value);
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<UInput
|
|
66
|
+
ref="input"
|
|
67
|
+
:disabled="props.disabled"
|
|
68
|
+
:modelValue="value"
|
|
69
|
+
:name="props.name"
|
|
70
|
+
:placeholder="props.placeholder"
|
|
71
|
+
:readonly="!isEditing"
|
|
72
|
+
:required="props.required"
|
|
73
|
+
:size="props.size"
|
|
74
|
+
:ui="ui"
|
|
75
|
+
@blur="stopEditing"
|
|
76
|
+
@update:model-value="onUpdate"
|
|
77
|
+
>
|
|
78
|
+
<template #trailing>
|
|
79
|
+
<UButton
|
|
80
|
+
:aria-label="isEditing ? messages.slugReset : messages.slugEdit"
|
|
81
|
+
color="neutral"
|
|
82
|
+
:disabled="props.disabled"
|
|
83
|
+
:icon="isEditing ? icons.slugReset : icons.slugEdit"
|
|
84
|
+
size="sm"
|
|
85
|
+
tabindex="-1"
|
|
86
|
+
variant="link"
|
|
87
|
+
@click="isEditing ? resetToSource() : startEditing()"
|
|
88
|
+
@mousedown.prevent
|
|
89
|
+
/>
|
|
90
|
+
</template>
|
|
91
|
+
</UInput>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldSlug } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldSlug, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldText } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldText, '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;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
autocomplete: { type: String, required: false },
|
|
15
|
+
autofocus: { type: Boolean, required: false },
|
|
16
|
+
icon: { type: String, required: false },
|
|
17
|
+
maxlength: { type: Number, required: false },
|
|
18
|
+
placeholder: { type: String, required: false }
|
|
19
|
+
});
|
|
20
|
+
const { value } = useVunoField(() => props.name);
|
|
21
|
+
const ui = useVunoTheme("fieldText", () => props.ui);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<UInput
|
|
26
|
+
v-model="value"
|
|
27
|
+
:autocomplete="props.autocomplete"
|
|
28
|
+
:autofocus="props.autofocus"
|
|
29
|
+
:disabled="props.disabled"
|
|
30
|
+
:icon="props.icon"
|
|
31
|
+
:maxlength="props.maxlength"
|
|
32
|
+
:name="props.name"
|
|
33
|
+
:placeholder="props.placeholder"
|
|
34
|
+
:required="props.required"
|
|
35
|
+
:size="props.size"
|
|
36
|
+
:ui="ui"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldText } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldText, '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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldTextarea } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldTextarea, '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;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
autoresize: { type: Boolean, required: false },
|
|
15
|
+
maxrows: { type: Number, required: false },
|
|
16
|
+
placeholder: { type: String, required: false },
|
|
17
|
+
rows: { type: Number, required: false }
|
|
18
|
+
});
|
|
19
|
+
const { value } = useVunoField(() => props.name);
|
|
20
|
+
const ui = useVunoTheme("fieldTextarea", () => props.ui);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<UTextarea
|
|
25
|
+
v-model="value"
|
|
26
|
+
:autoresize="props.autoresize ?? true"
|
|
27
|
+
:disabled="props.disabled"
|
|
28
|
+
:maxrows="props.maxrows"
|
|
29
|
+
:name="props.name"
|
|
30
|
+
:placeholder="props.placeholder"
|
|
31
|
+
:required="props.required"
|
|
32
|
+
:rows="props.rows"
|
|
33
|
+
:size="props.size"
|
|
34
|
+
:ui="ui"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VunoFieldTextarea } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldTextarea, '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;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FormSchema, FormSubmitEvent } from '@nuxt/ui';
|
|
2
|
+
import type { VunoFieldSlots } from '#vuno/types/field';
|
|
3
|
+
import { type VunoFormDefinition, type VunoFormState } from '#vuno/types/form';
|
|
4
|
+
declare const __VLS_export: <TState extends VunoFormState>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<({
|
|
6
|
+
/**
|
|
7
|
+
* Id del `<form>`. Permite enviarlo desde un botón que vive fuera de
|
|
8
|
+
* él —el pie de un modal, por ejemplo— con `<button form="...">`.
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
definition: VunoFormDefinition;
|
|
12
|
+
/** Opcional: un panel de filtros, por ejemplo, no necesita validación. */
|
|
13
|
+
schema?: FormSchema;
|
|
14
|
+
ui?: VunoFieldSlots;
|
|
15
|
+
} & {
|
|
16
|
+
state: TState;
|
|
17
|
+
}) & {
|
|
18
|
+
onSubmit?: ((event: FormSubmitEvent<TState>) => any) | undefined;
|
|
19
|
+
"onUpdate:state"?: ((value: TState) => any) | undefined;
|
|
20
|
+
}> & (typeof globalThis extends {
|
|
21
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
22
|
+
} ? P : {});
|
|
23
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
24
|
+
dirty: import("vue").ComputedRef<boolean>;
|
|
25
|
+
errors: import("vue").ComputedRef<Set<string | undefined>>;
|
|
26
|
+
isDirty: (name?: string) => boolean;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
resetField: (name: string) => void;
|
|
29
|
+
submit: () => Promise<void> | undefined;
|
|
30
|
+
}>) => void;
|
|
31
|
+
attrs: any;
|
|
32
|
+
slots: {
|
|
33
|
+
footer?: (props: {
|
|
34
|
+
dirty: boolean;
|
|
35
|
+
reset: () => void;
|
|
36
|
+
}) => unknown;
|
|
37
|
+
};
|
|
38
|
+
emit: ((evt: "submit", event: FormSubmitEvent<TState>) => void) & ((event: "update:state", value: TState) => void);
|
|
39
|
+
}>) => import("vue").VNode & {
|
|
40
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
41
|
+
};
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
45
|
+
[K in keyof T]: T[K];
|
|
46
|
+
} : {
|
|
47
|
+
[K in keyof T as K]: T[K];
|
|
48
|
+
}) & {};
|