@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
|
@@ -1,12 +1,17 @@
|
|
|
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 } = useFormKitInput(props.context);
|
|
10
|
+
const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, modelValue, ui } = useFormKitInput(props.context);
|
|
11
|
+
const handleContainerBlur = createContainerBlurHandler(props.context);
|
|
12
|
+
function handlePinBlur(event) {
|
|
13
|
+
handleBlur(event);
|
|
14
|
+
}
|
|
10
15
|
</script>
|
|
11
16
|
|
|
12
17
|
<template>
|
|
@@ -32,8 +37,10 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue } =
|
|
|
32
37
|
:separator="context.separator"
|
|
33
38
|
:type="context.type ?? 'text'"
|
|
34
39
|
:placeholder="context.placeholder"
|
|
35
|
-
:ui="
|
|
40
|
+
:ui="ui"
|
|
36
41
|
@change="handleChange"
|
|
37
42
|
@update:model-value="handleInput"
|
|
43
|
+
@blur="handlePinBlur"
|
|
44
|
+
@focusout="handleContainerBlur"
|
|
38
45
|
/>
|
|
39
46
|
</template>
|
|
@@ -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>
|
|
@@ -28,9 +30,10 @@ const { handleInput, handleChange, styleClass, color, modelValue, items, validSl
|
|
|
28
30
|
:description-key="context.descriptionKey"
|
|
29
31
|
:loop="context.loop ?? false"
|
|
30
32
|
:name="context.name"
|
|
31
|
-
:ui="
|
|
33
|
+
:ui="ui"
|
|
32
34
|
@change="handleChange"
|
|
33
35
|
@update:model-value="handleInput"
|
|
36
|
+
@focusout="handleContainerBlur"
|
|
34
37
|
>
|
|
35
38
|
<template
|
|
36
39
|
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, color, styleClass, modelValue, items, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, isInvalid, color, styleClass, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -45,7 +45,7 @@ const { handleInput, handleChange, isInvalid, color, styleClass, modelValue, ite
|
|
|
45
45
|
:open="context.open"
|
|
46
46
|
:default-open="context.defaultOpen"
|
|
47
47
|
:autocomplete="context.autocomplete"
|
|
48
|
-
:ui="
|
|
48
|
+
:ui="ui"
|
|
49
49
|
@change="handleChange"
|
|
50
50
|
@update:model-value="handleInput"
|
|
51
51
|
>
|
|
@@ -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, isInvalid, styleClass, color, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -57,7 +57,7 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, ite
|
|
|
57
57
|
:reset-model-value-on-clear="context.resetModelValueOnClear"
|
|
58
58
|
:highlight-on-hover="context.highlightOnHover"
|
|
59
59
|
:search-term="context.searchTerm"
|
|
60
|
-
:ui="
|
|
60
|
+
:ui="ui"
|
|
61
61
|
@change="handleChange"
|
|
62
62
|
@update:model-value="handleInput"
|
|
63
63
|
>
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, styleClass, color, modelValue } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, styleClass, color, modelValue, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -29,7 +29,7 @@ const { handleInput, handleChange, styleClass, color, modelValue } = useFormKitI
|
|
|
29
29
|
:max="context.max"
|
|
30
30
|
:step="context.step"
|
|
31
31
|
:min-steps-between-thumbs="context.minStepsBetweenThumbs"
|
|
32
|
-
:ui="
|
|
32
|
+
:ui="ui"
|
|
33
33
|
@change="handleChange"
|
|
34
34
|
@update:model-value="handleInput"
|
|
35
35
|
/>
|
|
@@ -6,7 +6,7 @@ const props = defineProps({
|
|
|
6
6
|
required: true
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
const { handleInput, handleChange, styleClass, color, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -29,9 +29,10 @@ const { handleInput, handleChange, styleClass, color, modelValue, validSlotNames
|
|
|
29
29
|
:true-value="context.trueValue"
|
|
30
30
|
:false-value="context.falseValue"
|
|
31
31
|
:autofocus="context.autofocus"
|
|
32
|
-
:ui="
|
|
32
|
+
:ui="ui"
|
|
33
33
|
@change="handleChange"
|
|
34
34
|
@update:model-value="handleInput"
|
|
35
|
+
@blur="handleBlur"
|
|
35
36
|
>
|
|
36
37
|
<template
|
|
37
38
|
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, color, isInvalid, modelValue, validSlotNames } = useFormKitInput(props.context);
|
|
9
|
+
const { handleInput, handleChange, handleBlur, styleClass, color, isInvalid, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
@@ -43,9 +43,10 @@ const { handleInput, handleChange, styleClass, color, isInvalid, modelValue, val
|
|
|
43
43
|
:maxlength="context.maxlength"
|
|
44
44
|
:minlength="context.minlength"
|
|
45
45
|
:wrap="context.wrap"
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
2
3
|
import type { PropType } from 'vue';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputBooleanProps {
|
|
@@ -14,6 +15,7 @@ export interface FormKitOutputBooleanProps {
|
|
|
14
15
|
trueIcon?: string;
|
|
15
16
|
trueValue?: string;
|
|
16
17
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
18
|
+
ui?: FormKitOutputUi;
|
|
17
19
|
}
|
|
18
20
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
21
|
context: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
2
3
|
import type { PropType } from 'vue';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputBooleanProps {
|
|
@@ -14,6 +15,7 @@ export interface FormKitOutputBooleanProps {
|
|
|
14
15
|
trueIcon?: string;
|
|
15
16
|
trueValue?: string;
|
|
16
17
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
18
|
+
ui?: FormKitOutputUi;
|
|
17
19
|
}
|
|
18
20
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
21
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputDateProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -14,6 +15,7 @@ export interface FormKitOutputDateProps {
|
|
|
14
15
|
trailing?: boolean;
|
|
15
16
|
trailingIcon?: string;
|
|
16
17
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
18
|
+
ui?: FormKitOutputUi;
|
|
17
19
|
}
|
|
18
20
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
21
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputDateProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -14,6 +15,7 @@ export interface FormKitOutputDateProps {
|
|
|
14
15
|
trailing?: boolean;
|
|
15
16
|
trailingIcon?: string;
|
|
16
17
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
18
|
+
ui?: FormKitOutputUi;
|
|
17
19
|
}
|
|
18
20
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
21
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputLinkProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -12,6 +13,7 @@ export interface FormKitOutputLinkProps {
|
|
|
12
13
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
13
14
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
14
15
|
rel?: string;
|
|
16
|
+
ui?: FormKitOutputUi;
|
|
15
17
|
}
|
|
16
18
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
19
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputLinkProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -12,6 +13,7 @@ export interface FormKitOutputLinkProps {
|
|
|
12
13
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
13
14
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
14
15
|
rel?: string;
|
|
16
|
+
ui?: FormKitOutputUi;
|
|
15
17
|
}
|
|
16
18
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
19
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputListProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -13,6 +14,7 @@ export interface FormKitOutputListProps {
|
|
|
13
14
|
trailing?: boolean;
|
|
14
15
|
trailingIcon?: string;
|
|
15
16
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
17
|
+
ui?: FormKitOutputUi;
|
|
16
18
|
}
|
|
17
19
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
20
|
context: {
|
|
@@ -44,7 +44,7 @@ const badgeVariant = computed(() => {
|
|
|
44
44
|
if (variant === "ghost" || variant === "none") return "soft";
|
|
45
45
|
return variant;
|
|
46
46
|
});
|
|
47
|
-
const { containerClass, iconClass, leadingIconName, trailingIconName } = useFormKitOutput(props.context);
|
|
47
|
+
const { containerClass, iconClass, leadingIconName, trailingIconName, ui } = useFormKitOutput(props.context);
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<template>
|
|
@@ -128,6 +128,7 @@ const { containerClass, iconClass, leadingIconName, trailingIconName } = useForm
|
|
|
128
128
|
:variant="badgeVariant"
|
|
129
129
|
:size="context.size"
|
|
130
130
|
:class="itemClass"
|
|
131
|
+
:ui="ui?.badge"
|
|
131
132
|
>
|
|
132
133
|
{{ item }}
|
|
133
134
|
</UBadge>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputListProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -13,6 +14,7 @@ export interface FormKitOutputListProps {
|
|
|
13
14
|
trailing?: boolean;
|
|
14
15
|
trailingIcon?: string;
|
|
15
16
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
17
|
+
ui?: FormKitOutputUi;
|
|
16
18
|
}
|
|
17
19
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
20
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputNumberProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -12,6 +13,7 @@ export interface FormKitOutputNumberProps {
|
|
|
12
13
|
trailing?: boolean;
|
|
13
14
|
trailingIcon?: string;
|
|
14
15
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
16
|
+
ui?: FormKitOutputUi;
|
|
15
17
|
}
|
|
16
18
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
19
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputNumberProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -12,6 +13,7 @@ export interface FormKitOutputNumberProps {
|
|
|
12
13
|
trailing?: boolean;
|
|
13
14
|
trailingIcon?: string;
|
|
14
15
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
16
|
+
ui?: FormKitOutputUi;
|
|
15
17
|
}
|
|
16
18
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
19
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputTextProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -11,6 +12,7 @@ export interface FormKitOutputTextProps {
|
|
|
11
12
|
trailingIcon?: string;
|
|
12
13
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
13
14
|
outputType?: 'text' | 'email' | 'url' | 'tel' | 'color' | 'duration' | 'i18n';
|
|
15
|
+
ui?: FormKitOutputUi;
|
|
14
16
|
}
|
|
15
17
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
18
|
context: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
+
import type { FormKitOutputUi } from '../../utils/useFormKitOutput.js';
|
|
3
4
|
import type { FormKitIconProps } from './FUIcon.vue.js';
|
|
4
5
|
export interface FormKitOutputTextProps {
|
|
5
6
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
@@ -11,6 +12,7 @@ export interface FormKitOutputTextProps {
|
|
|
11
12
|
trailingIcon?: string;
|
|
12
13
|
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
13
14
|
outputType?: 'text' | 'email' | 'url' | 'tel' | 'color' | 'duration' | 'i18n';
|
|
15
|
+
ui?: FormKitOutputUi;
|
|
14
16
|
}
|
|
15
17
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
18
|
context: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FormKitSchemaDefinition } from '@formkit/core';
|
|
2
|
+
import type { AutoFormOverrides, ValibotLikeSchema, ZodLikeSchema } from './useFormKitAutoForm.js';
|
|
3
|
+
export interface FormKitOverlayEditOptions {
|
|
4
|
+
data: unknown;
|
|
5
|
+
schema: FormKitSchemaDefinition;
|
|
6
|
+
title?: string;
|
|
7
|
+
as?: 'modal' | 'slideover';
|
|
8
|
+
}
|
|
9
|
+
export interface FormKitOverlayAutoOptions {
|
|
10
|
+
data?: unknown;
|
|
11
|
+
valibotSchema?: ValibotLikeSchema;
|
|
12
|
+
zodSchema?: ZodLikeSchema;
|
|
13
|
+
overrides?: AutoFormOverrides;
|
|
14
|
+
title?: string;
|
|
15
|
+
as?: 'modal' | 'slideover';
|
|
16
|
+
}
|
|
17
|
+
export declare function useFormKitOverlay(): {
|
|
18
|
+
edit: (options: FormKitOverlayEditOptions) => Promise<unknown>;
|
|
19
|
+
auto: (options: FormKitOverlayAutoOptions) => Promise<unknown>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useOverlay } from "@nuxt/ui/composables";
|
|
2
|
+
import FUAutoFormOverlay from "../components/FUAutoFormOverlay.vue";
|
|
3
|
+
import FUDataEditOverlay from "../components/FUDataEditOverlay.vue";
|
|
4
|
+
const registeredOverlays = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
const registeredAutoOverlays = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
let formIdCounter = 0;
|
|
7
|
+
export function useFormKitOverlay() {
|
|
8
|
+
const overlay = useOverlay();
|
|
9
|
+
let registeredOverlay = registeredOverlays.get(overlay);
|
|
10
|
+
if (!registeredOverlay) {
|
|
11
|
+
registeredOverlay = overlay.create(FUDataEditOverlay);
|
|
12
|
+
registeredOverlays.set(overlay, registeredOverlay);
|
|
13
|
+
}
|
|
14
|
+
let registeredAutoOverlay = registeredAutoOverlays.get(overlay);
|
|
15
|
+
if (!registeredAutoOverlay) {
|
|
16
|
+
registeredAutoOverlay = overlay.create(FUAutoFormOverlay);
|
|
17
|
+
registeredAutoOverlays.set(overlay, registeredAutoOverlay);
|
|
18
|
+
}
|
|
19
|
+
function edit(options) {
|
|
20
|
+
const id = `formkit-overlay-${++formIdCounter}`;
|
|
21
|
+
return registeredOverlay.open({
|
|
22
|
+
id,
|
|
23
|
+
data: options.data,
|
|
24
|
+
schema: options.schema,
|
|
25
|
+
title: options.title,
|
|
26
|
+
as: options.as ?? "modal"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function auto(options) {
|
|
30
|
+
const id = `formkit-autoform-overlay-${++formIdCounter}`;
|
|
31
|
+
return registeredAutoOverlay.open({
|
|
32
|
+
id,
|
|
33
|
+
data: options.data,
|
|
34
|
+
valibotSchema: options.valibotSchema,
|
|
35
|
+
zodSchema: options.zodSchema,
|
|
36
|
+
overrides: options.overrides,
|
|
37
|
+
title: options.title,
|
|
38
|
+
as: options.as ?? "modal"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return { edit, auto };
|
|
42
|
+
}
|
|
@@ -40,7 +40,7 @@ export function useFormKitRepeater() {
|
|
|
40
40
|
return `formkit-item-${index}-${uuid}`;
|
|
41
41
|
};
|
|
42
42
|
node.context.insertNode = (parentNode) => () => {
|
|
43
|
-
if (parentNode && Array.isArray(parentNode.
|
|
43
|
+
if (parentNode && Array.isArray(parentNode.value)) {
|
|
44
44
|
const newArray = [{ ...newItem }, ...parentNode.value];
|
|
45
45
|
parentNode.input(newArray, false);
|
|
46
46
|
syncOuterValue(newArray);
|
|
@@ -54,7 +54,7 @@ export function useFormKitRepeater() {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
node.context.addNode = (parentNode, index) => () => {
|
|
57
|
-
if (parentNode && Array.isArray(parentNode.
|
|
57
|
+
if (parentNode && Array.isArray(parentNode.value)) {
|
|
58
58
|
const array = parentNode.value;
|
|
59
59
|
array.splice(index + 1, 0, { ...newItem });
|
|
60
60
|
parentNode.input(array, false);
|
|
@@ -62,7 +62,7 @@ export function useFormKitRepeater() {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
node.context.cloneNode = (parentNode, index) => () => {
|
|
65
|
-
if (parentNode && Array.isArray(parentNode.
|
|
65
|
+
if (parentNode && Array.isArray(parentNode.value)) {
|
|
66
66
|
const item = parentNode.value[index];
|
|
67
67
|
const array = parentNode.value;
|
|
68
68
|
array.splice(index + 1, 0, { ...item });
|
|
@@ -80,7 +80,7 @@ export function useFormKitRepeater() {
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
node.context.moveNodeDown = (parentNode, index) => () => {
|
|
83
|
-
if (parentNode && Array.isArray(parentNode.
|
|
83
|
+
if (parentNode && Array.isArray(parentNode.value)) {
|
|
84
84
|
if (index < parentNode.value.length - 1) {
|
|
85
85
|
const newArray = swapElements(parentNode.value, index, index + 1);
|
|
86
86
|
parentNode.input(newArray, false);
|
|
@@ -107,7 +107,7 @@ export function useFormKitRepeater() {
|
|
|
107
107
|
};
|
|
108
108
|
node.context.dropNode = (parentNode, targetIndex) => (event) => {
|
|
109
109
|
event?.preventDefault();
|
|
110
|
-
if (!parentNode || !Array.isArray(parentNode.
|
|
110
|
+
if (!parentNode || !Array.isArray(parentNode.value)) {
|
|
111
111
|
dragOverIndex = null;
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
+
import type { FormKitSchemaAttributes, FormKitSchemaComponent, FormKitSchemaFormKit, FormKitSchemaNode } from '@formkit/core';
|
|
1
2
|
export declare function useFormKitSchema(): {
|
|
2
|
-
addComponent: (component?: string, props?:
|
|
3
|
-
addElement: (element?: string, children?:
|
|
4
|
-
addGroup: (name: string, children?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
children: object[];
|
|
9
|
-
};
|
|
10
|
-
addList: (name: string, children?: object[], dynamic?: boolean, render?: string | boolean, formKitAttrs?: object) => {
|
|
11
|
-
$formkit: string;
|
|
12
|
-
if: string;
|
|
13
|
-
name: string;
|
|
14
|
-
dynamic: boolean;
|
|
15
|
-
children: object[];
|
|
16
|
-
};
|
|
17
|
-
addListGroup: (children?: object[], render?: string | boolean, formKitAttrs?: object) => {
|
|
18
|
-
$formkit: string;
|
|
19
|
-
if: string;
|
|
20
|
-
for: string[];
|
|
21
|
-
key: string;
|
|
22
|
-
index: string;
|
|
23
|
-
children: object[];
|
|
24
|
-
};
|
|
25
|
-
addElementsInOuterDiv: (children?: object[], innerClass?: string, outerClass?: string, label?: string, help?: string, render?: string | boolean) => object;
|
|
3
|
+
addComponent: (component?: string, props?: Record<string, unknown>, render?: string | boolean, formKitAttrs?: Record<string, unknown>) => FormKitSchemaComponent;
|
|
4
|
+
addElement: (element?: string, children?: FormKitSchemaNode[] | string, attrs?: FormKitSchemaAttributes, render?: string | boolean, formKitAttrs?: Record<string, unknown>) => FormKitSchemaNode;
|
|
5
|
+
addGroup: (name: string, children?: FormKitSchemaNode[], render?: string | boolean, formKitAttrs?: Record<string, unknown>) => FormKitSchemaFormKit;
|
|
6
|
+
addList: (name: string, children?: FormKitSchemaNode[], dynamic?: boolean, render?: string | boolean, formKitAttrs?: Record<string, unknown>) => FormKitSchemaFormKit;
|
|
7
|
+
addListGroup: (children?: FormKitSchemaNode[], render?: string | boolean, formKitAttrs?: Record<string, unknown>) => FormKitSchemaFormKit;
|
|
8
|
+
addElementsInOuterDiv: (children?: FormKitSchemaNode[], innerClass?: string, outerClass?: string, label?: string, help?: string, render?: string | boolean) => FormKitSchemaNode;
|
|
26
9
|
};
|
|
@@ -6,26 +6,26 @@ import FUOutputLink from "../../../runtime/components/output/FUOutputLink.vue";
|
|
|
6
6
|
import FUOutputNumber from "../../../runtime/components/output/FUOutputNumber.vue";
|
|
7
7
|
import FUOutputList from "../../../runtime/components/output/FUOutputList.vue";
|
|
8
8
|
export const nuxtUIOutputTextDefinition = createInput(FUOutputText, {
|
|
9
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "outputType"],
|
|
9
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "outputType", "ui"],
|
|
10
10
|
family: "NuxtUIOutput"
|
|
11
11
|
});
|
|
12
12
|
export const nuxtUIOutputBooleanDefinition = createInput(FUOutputBoolean, {
|
|
13
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "trueValue", "falseValue", "trueIcon", "falseIcon", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
13
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "trueValue", "falseValue", "trueIcon", "falseIcon", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
14
14
|
family: "NuxtUIOutput"
|
|
15
15
|
});
|
|
16
16
|
export const nuxtUIOutputDateDefinition = createInput(FUOutputDate, {
|
|
17
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "dateStyle", "timeStyle", "locale", "relative", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
17
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "dateStyle", "timeStyle", "locale", "relative", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
18
18
|
family: "NuxtUIOutput"
|
|
19
19
|
});
|
|
20
20
|
export const nuxtUIOutputLinkDefinition = createInput(FUOutputLink, {
|
|
21
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "target", "rel", "underline", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
21
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "target", "rel", "underline", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
22
22
|
family: "NuxtUIOutput"
|
|
23
23
|
});
|
|
24
24
|
export const nuxtUIOutputNumberDefinition = createInput(FUOutputNumber, {
|
|
25
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "locale", "formatOptions", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
25
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "locale", "formatOptions", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
26
26
|
family: "NuxtUIOutput"
|
|
27
27
|
});
|
|
28
28
|
export const nuxtUIOutputListDefinition = createInput(FUOutputList, {
|
|
29
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "listType", "separator", "itemClass", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
29
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "listType", "separator", "itemClass", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
30
30
|
family: "NuxtUIOutput"
|
|
31
31
|
});
|
|
@@ -6,26 +6,26 @@ import FUOutputLink from "../../../runtime/components/output/FUOutputLink.vue";
|
|
|
6
6
|
import FUOutputNumber from "../../../runtime/components/output/FUOutputNumber.vue";
|
|
7
7
|
import FUOutputList from "../../../runtime/components/output/FUOutputList.vue";
|
|
8
8
|
export const nuxtUIOutputTextDefinition = createInput(FUOutputText, {
|
|
9
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "outputType"],
|
|
9
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "outputType", "ui"],
|
|
10
10
|
family: "NuxtUIOutput"
|
|
11
11
|
});
|
|
12
12
|
export const nuxtUIOutputBooleanDefinition = createInput(FUOutputBoolean, {
|
|
13
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "trueValue", "falseValue", "trueIcon", "falseIcon", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
13
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "trueValue", "falseValue", "trueIcon", "falseIcon", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
14
14
|
family: "NuxtUIOutput"
|
|
15
15
|
});
|
|
16
16
|
export const nuxtUIOutputDateDefinition = createInput(FUOutputDate, {
|
|
17
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "dateStyle", "timeStyle", "locale", "relative", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
17
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "dateStyle", "timeStyle", "locale", "relative", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
18
18
|
family: "NuxtUIOutput"
|
|
19
19
|
});
|
|
20
20
|
export const nuxtUIOutputLinkDefinition = createInput(FUOutputLink, {
|
|
21
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "target", "rel", "underline", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
21
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "target", "rel", "underline", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
22
22
|
family: "NuxtUIOutput"
|
|
23
23
|
});
|
|
24
24
|
export const nuxtUIOutputNumberDefinition = createInput(FUOutputNumber, {
|
|
25
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "locale", "formatOptions", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
25
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "locale", "formatOptions", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
26
26
|
family: "NuxtUIOutput"
|
|
27
27
|
});
|
|
28
28
|
export const nuxtUIOutputListDefinition = createInput(FUOutputList, {
|
|
29
|
-
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "listType", "separator", "itemClass", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked"],
|
|
29
|
+
props: ["size", "color", "variant", "icon", "leadingIcon", "trailingIcon", "leading", "trailing", "listType", "separator", "itemClass", "onIconClicked", "onLeadingIconClicked", "onTrailingIconClicked", "ui"],
|
|
30
30
|
family: "NuxtUIOutput"
|
|
31
31
|
});
|
|
@@ -42,6 +42,10 @@ export const nuxtUIRepeaterDefinition = createInput(
|
|
|
42
42
|
addListGroup([
|
|
43
43
|
addElement("div", [
|
|
44
44
|
addDragHandle("$internalDragHandleClass", "$dragHandleIconName", "$renderDragHandle"),
|
|
45
|
+
// A bare `{ children }` node (no `$el`/`$cmp`/`$formkit` discriminant)
|
|
46
|
+
// is not representable by `FormKitSchemaNode`'s own type, but
|
|
47
|
+
// FormKit's schema compiler accepts it at runtime as a slot
|
|
48
|
+
// passthrough - cast rather than widen the shared `FormKitSchemaNode` type.
|
|
45
49
|
{ children: "$slots.default" },
|
|
46
50
|
addButtonGroup("$buttonGroupClass", "$buttonGroupItemClass", "$buttonSize", "$renderButtons")
|
|
47
51
|
], {
|
|
@@ -42,6 +42,10 @@ export const nuxtUIRepeaterDefinition = createInput(
|
|
|
42
42
|
addListGroup([
|
|
43
43
|
addElement("div", [
|
|
44
44
|
addDragHandle("$internalDragHandleClass", "$dragHandleIconName", "$renderDragHandle"),
|
|
45
|
+
// A bare `{ children }` node (no `$el`/`$cmp`/`$formkit` discriminant)
|
|
46
|
+
// is not representable by `FormKitSchemaNode`'s own type, but
|
|
47
|
+
// FormKit's schema compiler accepts it at runtime as a slot
|
|
48
|
+
// passthrough - cast rather than widen the shared `FormKitSchemaNode` type.
|
|
45
49
|
{ children: "$slots.default" },
|
|
46
50
|
addButtonGroup("$buttonGroupClass", "$buttonGroupItemClass", "$buttonSize", "$renderButtons")
|
|
47
51
|
], {
|