@sfxcode/nuxt-ui-formkit 1.2.3 → 1.2.5
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/README.md +1 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/FUAutoForm.d.vue.ts +7 -8
- package/dist/runtime/components/FUAutoForm.vue +1 -1
- package/dist/runtime/components/FUAutoForm.vue.d.ts +7 -8
- package/dist/runtime/components/FUAutoFormOverlay.d.vue.ts +82 -0
- package/dist/runtime/components/FUAutoFormOverlay.vue +106 -0
- package/dist/runtime/components/FUAutoFormOverlay.vue.d.ts +82 -0
- package/dist/runtime/components/FUDataEdit.d.vue.ts +7 -7
- package/dist/runtime/components/FUDataEdit.vue +3 -2
- package/dist/runtime/components/FUDataEdit.vue.d.ts +7 -7
- package/dist/runtime/components/FUDataEditOverlay.d.vue.ts +64 -0
- package/dist/runtime/components/FUDataEditOverlay.vue +94 -0
- package/dist/runtime/components/FUDataEditOverlay.vue.d.ts +64 -0
- package/dist/runtime/components/FUDataView.d.vue.ts +7 -7
- package/dist/runtime/components/FUDataView.vue +1 -1
- package/dist/runtime/components/FUDataView.vue.d.ts +7 -7
- package/dist/runtime/components/inputs/FUCalendar.vue +5 -2
- package/dist/runtime/components/inputs/FUCheckbox.vue +3 -2
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue +5 -1
- package/dist/runtime/components/inputs/FUColorPicker.vue +2 -2
- package/dist/runtime/components/inputs/FUEditor.vue +59 -55
- package/dist/runtime/components/inputs/FUFileUpload.vue +3 -2
- package/dist/runtime/components/inputs/FUInput.vue +3 -2
- package/dist/runtime/components/inputs/FUInputDate.vue +6 -2
- package/dist/runtime/components/inputs/FUInputMenu.vue +3 -2
- package/dist/runtime/components/inputs/FUInputNumber.vue +3 -2
- package/dist/runtime/components/inputs/FUInputTags.vue +3 -2
- package/dist/runtime/components/inputs/FUInputTime.vue +6 -2
- package/dist/runtime/components/inputs/FUListbox.vue +11 -6
- package/dist/runtime/components/inputs/FUPinInput.vue +9 -2
- package/dist/runtime/components/inputs/FURadioGroup.vue +5 -2
- package/dist/runtime/components/inputs/FUSelect.vue +2 -2
- package/dist/runtime/components/inputs/FUSelectMenu.vue +2 -2
- package/dist/runtime/components/inputs/FUSlider.vue +2 -2
- package/dist/runtime/components/inputs/FUSwitch.vue +3 -2
- package/dist/runtime/components/inputs/FUTextarea.vue +3 -2
- package/dist/runtime/components/output/FUOutputBoolean.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputDate.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputDate.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputLink.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputLink.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputList.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputList.vue +2 -1
- package/dist/runtime/components/output/FUOutputList.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputNumber.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputNumber.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputText.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputText.vue.d.ts +2 -0
- package/dist/runtime/composables/useFormKitOverlay.d.ts +20 -0
- package/dist/runtime/composables/useFormKitOverlay.js +42 -0
- package/dist/runtime/composables/useFormKitRepeater.js +5 -5
- package/dist/runtime/composables/useFormKitSchema.d.ts +7 -24
- package/dist/runtime/formkit/definitions/output.js +6 -6
- package/dist/runtime/formkit/definitions/output.mjs +6 -6
- package/dist/runtime/formkit/definitions/repeater.js +4 -0
- package/dist/runtime/formkit/definitions/repeater.mjs +4 -0
- package/dist/runtime/formkit/index.d.ts +6 -1
- package/dist/runtime/utils/useFormKitContainerBlur.d.ts +37 -0
- package/dist/runtime/utils/useFormKitContainerBlur.js +9 -0
- package/dist/runtime/utils/useFormKitInput.d.ts +1 -0
- package/dist/runtime/utils/useFormKitInput.js +10 -2
- package/dist/runtime/utils/useFormKitOutput.d.ts +25 -0
- package/dist/runtime/utils/useFormKitOutput.js +21 -5
- package/dist/runtime/utils/useOverlayCloseResolution.d.ts +20 -0
- package/dist/runtime/utils/useOverlayCloseResolution.js +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { FormKitSchemaDefinition } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
id: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: ObjectConstructor;
|
|
10
|
+
default: null;
|
|
11
|
+
};
|
|
12
|
+
schema: {
|
|
13
|
+
type: PropType<FormKitSchemaDefinition>;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
title: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
as: {
|
|
21
|
+
type: PropType<"modal" | "slideover">;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
open: {
|
|
25
|
+
type: PropType<boolean>;
|
|
26
|
+
};
|
|
27
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
close: (value: unknown) => any;
|
|
29
|
+
"update:open": (value: boolean) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
id: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
data: {
|
|
36
|
+
type: ObjectConstructor;
|
|
37
|
+
default: null;
|
|
38
|
+
};
|
|
39
|
+
schema: {
|
|
40
|
+
type: PropType<FormKitSchemaDefinition>;
|
|
41
|
+
default: null;
|
|
42
|
+
};
|
|
43
|
+
title: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: undefined;
|
|
46
|
+
};
|
|
47
|
+
as: {
|
|
48
|
+
type: PropType<"modal" | "slideover">;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
open: {
|
|
52
|
+
type: PropType<boolean>;
|
|
53
|
+
};
|
|
54
|
+
}>> & Readonly<{
|
|
55
|
+
onClose?: ((value: unknown) => any) | undefined;
|
|
56
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
schema: FormKitSchemaDefinition;
|
|
59
|
+
data: Record<string, any>;
|
|
60
|
+
title: string;
|
|
61
|
+
as: "modal" | "slideover";
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
declare const _default: typeof __VLS_export;
|
|
64
|
+
export default _default;
|
|
@@ -6,7 +6,7 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
8
|
data: {
|
|
9
|
-
type:
|
|
9
|
+
type: PropType<Record<string, unknown>>;
|
|
10
10
|
default: null;
|
|
11
11
|
};
|
|
12
12
|
schema: {
|
|
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
28
|
modelValue: {
|
|
29
|
-
type: PropType<
|
|
29
|
+
type: PropType<Record<string, unknown>>;
|
|
30
30
|
};
|
|
31
31
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
"update:modelValue": (value:
|
|
32
|
+
"update:modelValue": (value: Record<string, unknown> | undefined) => any;
|
|
33
33
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
34
|
data: {
|
|
35
|
-
type:
|
|
35
|
+
type: PropType<Record<string, unknown>>;
|
|
36
36
|
default: null;
|
|
37
37
|
};
|
|
38
38
|
schema: {
|
|
@@ -52,13 +52,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
52
52
|
default: boolean;
|
|
53
53
|
};
|
|
54
54
|
modelValue: {
|
|
55
|
-
type: PropType<
|
|
55
|
+
type: PropType<Record<string, unknown>>;
|
|
56
56
|
};
|
|
57
57
|
}>> & Readonly<{
|
|
58
|
-
"onUpdate:modelValue"?: ((value:
|
|
58
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown> | undefined) => any) | undefined;
|
|
59
59
|
}>, {
|
|
60
60
|
schema: FormKitSchemaDefinition;
|
|
61
|
-
data: Record<string,
|
|
61
|
+
data: Record<string, unknown>;
|
|
62
62
|
formClass: string;
|
|
63
63
|
debugData: boolean;
|
|
64
64
|
debugSchema: boolean;
|
|
@@ -25,7 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
const formSchema = ref(props.schema);
|
|
28
|
-
const formData = defineModel({ type:
|
|
28
|
+
const formData = defineModel({ type: Object });
|
|
29
29
|
watch(() => props.schema, (newSchema) => {
|
|
30
30
|
formSchema.value = newSchema;
|
|
31
31
|
}, { deep: true });
|
|
@@ -6,7 +6,7 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
};
|
|
7
7
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
8
|
data: {
|
|
9
|
-
type:
|
|
9
|
+
type: PropType<Record<string, unknown>>;
|
|
10
10
|
default: null;
|
|
11
11
|
};
|
|
12
12
|
schema: {
|
|
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
28
|
modelValue: {
|
|
29
|
-
type: PropType<
|
|
29
|
+
type: PropType<Record<string, unknown>>;
|
|
30
30
|
};
|
|
31
31
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
"update:modelValue": (value:
|
|
32
|
+
"update:modelValue": (value: Record<string, unknown> | undefined) => any;
|
|
33
33
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
34
|
data: {
|
|
35
|
-
type:
|
|
35
|
+
type: PropType<Record<string, unknown>>;
|
|
36
36
|
default: null;
|
|
37
37
|
};
|
|
38
38
|
schema: {
|
|
@@ -52,13 +52,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
52
52
|
default: boolean;
|
|
53
53
|
};
|
|
54
54
|
modelValue: {
|
|
55
|
-
type: PropType<
|
|
55
|
+
type: PropType<Record<string, unknown>>;
|
|
56
56
|
};
|
|
57
57
|
}>> & Readonly<{
|
|
58
|
-
"onUpdate:modelValue"?: ((value:
|
|
58
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown> | undefined) => any) | undefined;
|
|
59
59
|
}>, {
|
|
60
60
|
schema: FormKitSchemaDefinition;
|
|
61
|
-
data: Record<string,
|
|
61
|
+
data: Record<string, unknown>;
|
|
62
62
|
formClass: string;
|
|
63
63
|
debugData: boolean;
|
|
64
64
|
debugSchema: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
4
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
4
5
|
import { toDateValue, toDateValueOrRangeOrArray, fromDateValueOrRangeOrArray } from "../../utils/dateValueConversion";
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
context: {
|
|
@@ -8,7 +9,8 @@ const props = defineProps({
|
|
|
8
9
|
required: true
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
|
-
const { handleInput, styleClass, color, validSlotNames } = useFormKitInput(props.context);
|
|
12
|
+
const { handleInput, styleClass, color, validSlotNames, ui } = useFormKitInput(props.context);
|
|
13
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
12
14
|
const conversionOptions = computed(() => ({ timeZone: props.context.timeZone }));
|
|
13
15
|
const modelValue = computed({
|
|
14
16
|
get: () => toDateValueOrRangeOrArray(props.context._value, conversionOptions.value),
|
|
@@ -44,8 +46,9 @@ const maxValue = computed(() => toDateValue(props.context.maxValue, conversionOp
|
|
|
44
46
|
:max-value="maxValue"
|
|
45
47
|
:is-date-disabled="context.isDateDisabled"
|
|
46
48
|
:is-date-unavailable="context.isDateUnavailable"
|
|
47
|
-
:ui="
|
|
49
|
+
:ui="ui"
|
|
48
50
|
@update:model-value="handleInput"
|
|
51
|
+
@focusout="handleContainerBlur"
|
|
49
52
|
>
|
|
50
53
|
<template
|
|
51
54
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, styleClass, modelValue, color, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, styleClass, modelValue, color, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -28,9 +28,10 @@ const { handleInput, handleChange, styleClass, modelValue, color, validSlotNames
|
|
|
28
28
|
:true-value="context.trueValue"
|
|
29
29
|
:false-value="context.falseValue"
|
|
30
30
|
:autofocus="context.autofocus"
|
|
31
|
-
:ui="
|
|
31
|
+
:ui="ui"
|
|
32
32
|
@change="handleChange"
|
|
33
33
|
@update:model-value="handleInput"
|
|
34
|
+
@blur="handleBlur"
|
|
34
35
|
>
|
|
35
36
|
<template
|
|
36
37
|
v-for="slotName in validSlotNames"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
3
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
context: {
|
|
5
6
|
type: Object,
|
|
6
7
|
required: true
|
|
7
8
|
}
|
|
8
9
|
});
|
|
9
|
-
const { handleInput, handleChange, styleClass, color, modelValue, items, validSlotNames } = useFormKitInput(props.context);
|
|
10
|
+
const { handleInput, handleChange, styleClass, color, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
|
|
11
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<template>
|
|
@@ -29,8 +31,10 @@ const { handleInput, handleChange, styleClass, color, modelValue, items, validSl
|
|
|
29
31
|
:description-key="context.descriptionKey"
|
|
30
32
|
:loop="context.loop ?? false"
|
|
31
33
|
:name="context.name"
|
|
34
|
+
:ui="ui"
|
|
32
35
|
@change="handleChange"
|
|
33
36
|
@update:model-value="handleInput"
|
|
37
|
+
@focusout="handleContainerBlur"
|
|
34
38
|
>
|
|
35
39
|
<template
|
|
36
40
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, styleClass, modelValue } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, styleClass, modelValue, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -20,7 +20,7 @@ const { handleInput, handleChange, styleClass, modelValue } = useFormKitInput(pr
|
|
|
20
20
|
:size="context.size ?? 'md'"
|
|
21
21
|
:format="context.format || 'hex'"
|
|
22
22
|
:throttle="context.throttle"
|
|
23
|
-
:ui="
|
|
23
|
+
:ui="ui"
|
|
24
24
|
@change="handleChange"
|
|
25
25
|
@update:model-value="handleInput"
|
|
26
26
|
/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
3
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
3
4
|
const DEFAULT_EDITOR_TOOLBAR_ITEMS = [
|
|
4
5
|
[
|
|
5
6
|
{ kind: "undo", icon: "i-lucide-undo", tooltip: { text: "Undo" } },
|
|
@@ -60,62 +61,65 @@ const props = defineProps({
|
|
|
60
61
|
required: true
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
|
-
const { handleInput, styleClass, modelValue } = useFormKitInput(props.context);
|
|
64
|
+
const { handleInput, styleClass, modelValue, ui } = useFormKitInput(props.context);
|
|
65
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
64
66
|
</script>
|
|
65
67
|
|
|
66
68
|
<template>
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
69
|
+
<div @focusout="handleContainerBlur">
|
|
70
|
+
<UEditor
|
|
71
|
+
:id="context.id"
|
|
72
|
+
v-model="modelValue"
|
|
73
|
+
v-bind="{ ...context?.attrs }"
|
|
74
|
+
:class="styleClass"
|
|
75
|
+
:editable="!context?.disabled"
|
|
76
|
+
:style="context?.attrs.style"
|
|
77
|
+
:content-type="context.contentType"
|
|
78
|
+
:starter-kit="context.starterKit"
|
|
79
|
+
:placeholder="context.placeholder"
|
|
80
|
+
:markdown="context.markdown"
|
|
81
|
+
:image="context.image"
|
|
82
|
+
:mention="context.mention"
|
|
83
|
+
:handlers="context.editorHandlers"
|
|
84
|
+
:extensions="context.extensions"
|
|
85
|
+
:autofocus="context.autofocus"
|
|
86
|
+
:ui="ui"
|
|
87
|
+
@update:model-value="handleInput"
|
|
88
|
+
>
|
|
89
|
+
<template #default="{ editor, handlers }">
|
|
90
|
+
<UEditorToolbar
|
|
91
|
+
v-if="context.toolbar !== false"
|
|
92
|
+
:editor="editor"
|
|
93
|
+
:items="context.toolbarItems ?? DEFAULT_EDITOR_TOOLBAR_ITEMS"
|
|
94
|
+
class="border-b border-default px-2 py-1 mb-2 flex-wrap"
|
|
95
|
+
/>
|
|
96
|
+
<UEditorToolbar
|
|
97
|
+
v-if="context.bubbleToolbar !== false"
|
|
98
|
+
:editor="editor"
|
|
99
|
+
:items="context.bubbleToolbarItems ?? DEFAULT_BUBBLE_TOOLBAR_ITEMS"
|
|
100
|
+
layout="bubble"
|
|
101
|
+
:should-show="bubbleToolbarShouldShow"
|
|
102
|
+
/>
|
|
103
|
+
<UEditorDragHandle
|
|
104
|
+
v-if="context.dragHandle"
|
|
105
|
+
:editor="editor"
|
|
106
|
+
/>
|
|
107
|
+
<UEditorSuggestionMenu
|
|
108
|
+
v-if="context.suggestionMenu"
|
|
109
|
+
:editor="editor"
|
|
110
|
+
:items="context.suggestionMenuItems ?? DEFAULT_SUGGESTION_MENU_ITEMS"
|
|
111
|
+
/>
|
|
112
|
+
<UEditorMentionMenu
|
|
113
|
+
v-if="context.mentionItems?.length"
|
|
114
|
+
:editor="editor"
|
|
115
|
+
:items="context.mentionItems"
|
|
116
|
+
/>
|
|
117
|
+
<component
|
|
118
|
+
:is="context.slots.default"
|
|
119
|
+
v-if="context?.slots?.default"
|
|
120
|
+
v-bind="{ ...context, editor, handlers }"
|
|
121
|
+
/>
|
|
122
|
+
</template>
|
|
123
|
+
</UEditor>
|
|
124
|
+
</div>
|
|
121
125
|
</template>
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -38,9 +38,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, val
|
|
|
38
38
|
:file-delete-icon="context.fileDeleteIcon"
|
|
39
39
|
:preview="context.preview"
|
|
40
40
|
:name="context.name"
|
|
41
|
-
:ui="
|
|
41
|
+
:ui="ui"
|
|
42
42
|
@change="handleChange"
|
|
43
43
|
@update:model-value="handleInput"
|
|
44
|
+
@blur="handleBlur"
|
|
44
45
|
>
|
|
45
46
|
<template
|
|
46
47
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -43,9 +43,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, val
|
|
|
43
43
|
:min-length="context.minLength"
|
|
44
44
|
:pattern="context.pattern"
|
|
45
45
|
:step="context.step"
|
|
46
|
-
:ui="
|
|
46
|
+
:ui="ui"
|
|
47
47
|
@change="handleChange"
|
|
48
48
|
@update:model-value="handleInput"
|
|
49
|
+
@blur="handleBlur"
|
|
49
50
|
>
|
|
50
51
|
<template
|
|
51
52
|
v-for="slotName in validSlotNames"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
4
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
4
5
|
import { fromDateValueOrRange, toDateValue, toDateValueOrRange } from "../../utils/dateValueConversion";
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
context: {
|
|
@@ -8,7 +9,8 @@ const props = defineProps({
|
|
|
8
9
|
required: true
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, validSlotNames } = useFormKitInput(props.context);
|
|
12
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, validSlotNames, ui } = useFormKitInput(props.context);
|
|
13
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
12
14
|
const conversionOptions = computed(() => ({
|
|
13
15
|
granularity: props.context.granularity,
|
|
14
16
|
hideTimeZone: props.context.hideTimeZone,
|
|
@@ -63,9 +65,11 @@ const minValue = computed(() => toDateValue(props.context.minValue, conversionOp
|
|
|
63
65
|
:max-value="maxValue"
|
|
64
66
|
:min-value="minValue"
|
|
65
67
|
:is-date-unavailable="context.isDateUnavailable"
|
|
66
|
-
:ui="
|
|
68
|
+
:ui="ui"
|
|
67
69
|
@change="handleChange"
|
|
68
70
|
@update:model-value="handleInput"
|
|
71
|
+
@blur="handleBlur"
|
|
72
|
+
@focusout="handleContainerBlur"
|
|
69
73
|
>
|
|
70
74
|
<template
|
|
71
75
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, items, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -62,9 +62,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, ite
|
|
|
62
62
|
:list="context.list"
|
|
63
63
|
:autocomplete="context.autocomplete"
|
|
64
64
|
:search-term="context.searchTerm"
|
|
65
|
-
:ui="
|
|
65
|
+
:ui="ui"
|
|
66
66
|
@change="handleChange"
|
|
67
67
|
@update:model-value="handleInput"
|
|
68
|
+
@blur="handleBlur"
|
|
68
69
|
>
|
|
69
70
|
<template
|
|
70
71
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -44,9 +44,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, val
|
|
|
44
44
|
:placeholder="context.placeholder"
|
|
45
45
|
:list="context.list"
|
|
46
46
|
:autocomplete="context.autocomplete"
|
|
47
|
-
:ui="
|
|
47
|
+
:ui="ui"
|
|
48
48
|
@change="handleChange"
|
|
49
49
|
@update:model-value="handleInput"
|
|
50
|
+
@blur="handleBlur"
|
|
50
51
|
>
|
|
51
52
|
<template
|
|
52
53
|
v-for="slotName in validSlotNames"
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -46,9 +46,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, val
|
|
|
46
46
|
:loading-icon="context.loadingIcon"
|
|
47
47
|
:list="context.list"
|
|
48
48
|
:autocomplete="context.autocomplete || 'off'"
|
|
49
|
-
:ui="
|
|
49
|
+
:ui="ui"
|
|
50
50
|
@change="handleChange"
|
|
51
51
|
@update:model-value="handleInput"
|
|
52
|
+
@blur="handleBlur"
|
|
52
53
|
>
|
|
53
54
|
<template
|
|
54
55
|
v-for="slotName in validSlotNames"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
3
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
context: {
|
|
5
6
|
type: Object,
|
|
6
7
|
required: true
|
|
7
8
|
}
|
|
8
9
|
});
|
|
9
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
10
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
11
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<template>
|
|
@@ -43,9 +45,11 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, val
|
|
|
43
45
|
:hide-time-zone="context.hideTimeZone"
|
|
44
46
|
:max-value="context.maxValue"
|
|
45
47
|
:min-value="context.minValue"
|
|
46
|
-
:ui="
|
|
48
|
+
:ui="ui"
|
|
47
49
|
@change="handleChange"
|
|
48
50
|
@update:model-value="handleInput"
|
|
51
|
+
@blur="handleBlur"
|
|
52
|
+
@focusout="handleContainerBlur"
|
|
49
53
|
>
|
|
50
54
|
<template
|
|
51
55
|
v-for="slotName in validSlotNames"
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, nextTick, ref, watch } from "vue";
|
|
3
3
|
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
4
|
+
import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
context: {
|
|
6
7
|
type: Object,
|
|
7
8
|
required: true
|
|
8
9
|
}
|
|
9
10
|
});
|
|
10
|
-
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, items, validSlotNames } = useFormKitInput(props.context);
|
|
11
|
+
const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
|
|
12
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
11
13
|
const targetItems = ref(modelValue.value || []);
|
|
12
14
|
const sourceSelection = ref([]);
|
|
13
15
|
const targetSelection = ref([]);
|
|
@@ -22,6 +24,7 @@ const sourceItems = computed(() => {
|
|
|
22
24
|
return items.value.filter((item) => !targetItems.value.some((t) => t[valueKey] === item[valueKey]));
|
|
23
25
|
});
|
|
24
26
|
const transferSlotNames = computed(() => validSlotNames.value.filter((name) => name !== "item-trailing"));
|
|
27
|
+
const transferDefaultValue = computed(() => props.context.defaultValue);
|
|
25
28
|
const sourceContainerRef = ref();
|
|
26
29
|
const targetContainerRef = ref();
|
|
27
30
|
const sourceDragActive = ref(false);
|
|
@@ -237,9 +240,10 @@ watch(targetItems, (newVal) => {
|
|
|
237
240
|
:autofocus="context.autofocus"
|
|
238
241
|
:autofocus-delay="context.autofocusDelay"
|
|
239
242
|
:search-term="context.searchTerm"
|
|
240
|
-
:ui="
|
|
243
|
+
:ui="ui"
|
|
241
244
|
@change="handleChange"
|
|
242
245
|
@update:model-value="handleInput"
|
|
246
|
+
@focusout="handleContainerBlur"
|
|
243
247
|
>
|
|
244
248
|
<template
|
|
245
249
|
v-for="slotName in validSlotNames"
|
|
@@ -255,6 +259,7 @@ watch(targetItems, (newVal) => {
|
|
|
255
259
|
<div
|
|
256
260
|
v-if="context.displayMode === 'transfer'"
|
|
257
261
|
class="flex items-stretch gap-4 w-full"
|
|
262
|
+
@focusout="handleContainerBlur"
|
|
258
263
|
>
|
|
259
264
|
<div
|
|
260
265
|
ref="sourceContainerRef"
|
|
@@ -283,7 +288,7 @@ watch(targetItems, (newVal) => {
|
|
|
283
288
|
:orientation="context.orientation"
|
|
284
289
|
:selection-behavior="context.selectionBehavior"
|
|
285
290
|
:disabled="!!context?.disabled"
|
|
286
|
-
:default-value="
|
|
291
|
+
:default-value="transferDefaultValue"
|
|
287
292
|
:multiple="true"
|
|
288
293
|
:value-key="context.valueKey"
|
|
289
294
|
:label-key="context.labelKey"
|
|
@@ -300,7 +305,7 @@ watch(targetItems, (newVal) => {
|
|
|
300
305
|
:autofocus="context.autofocus"
|
|
301
306
|
:autofocus-delay="context.autofocusDelay"
|
|
302
307
|
:search-term="context.searchTerm"
|
|
303
|
-
:ui="
|
|
308
|
+
:ui="ui"
|
|
304
309
|
@change="handleChange"
|
|
305
310
|
@update:model-value="handleInput"
|
|
306
311
|
>
|
|
@@ -385,7 +390,7 @@ watch(targetItems, (newVal) => {
|
|
|
385
390
|
:orientation="context.orientation"
|
|
386
391
|
:selection-behavior="context.selectionBehavior"
|
|
387
392
|
:disabled="!!context?.disabled"
|
|
388
|
-
:default-value="
|
|
393
|
+
:default-value="transferDefaultValue"
|
|
389
394
|
:multiple="true"
|
|
390
395
|
:value-key="context.valueKey"
|
|
391
396
|
:label-key="context.labelKey"
|
|
@@ -402,7 +407,7 @@ watch(targetItems, (newVal) => {
|
|
|
402
407
|
:autofocus="context.autofocus"
|
|
403
408
|
:autofocus-delay="context.autofocusDelay"
|
|
404
409
|
:search-term="context.searchTerm"
|
|
405
|
-
:ui="
|
|
410
|
+
:ui="ui"
|
|
406
411
|
@change="handleChange"
|
|
407
412
|
@update:model-value="handleInput"
|
|
408
413
|
>
|