@sfxcode/formkit-primevue 2.3.5 → 2.3.7
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/dist/components/FormKitDataEdit.vue +6 -0
- package/dist/components/FormKitDataView.vue +5 -0
- package/dist/components/PrimeAutoComplete.vue +2 -3
- package/dist/components/PrimeCascadeSelect.vue +3 -3
- package/dist/components/PrimeCheckbox.vue +3 -3
- package/dist/components/PrimeColorPicker.vue +3 -3
- package/dist/components/PrimeDatePicker.vue +3 -3
- package/dist/components/PrimeEditor.vue +3 -3
- package/dist/components/PrimeInputMask.vue +5 -9
- package/dist/components/PrimeInputNumber.vue +3 -3
- package/dist/components/PrimeInputOtp.vue +3 -3
- package/dist/components/PrimeInputText.vue +7 -7
- package/dist/components/PrimeKnob.vue +3 -3
- package/dist/components/PrimeListbox.vue +3 -3
- package/dist/components/PrimeMultiSelect.vue +3 -3
- package/dist/components/PrimeOutputBoolean.vue +11 -6
- package/dist/components/PrimeOutputDate.vue +11 -6
- package/dist/components/PrimeOutputDuration.vue +11 -6
- package/dist/components/PrimeOutputLink.vue +11 -6
- package/dist/components/PrimeOutputList.vue +11 -6
- package/dist/components/PrimeOutputNumber.vue +20 -8
- package/dist/components/PrimeOutputText.vue +11 -6
- package/dist/components/PrimePassword.vue +3 -3
- package/dist/components/PrimeRadioButton.vue +3 -3
- package/dist/components/PrimeRating.vue +3 -3
- package/dist/components/PrimeSelect.vue +3 -3
- package/dist/components/PrimeSelectButton.vue +3 -3
- package/dist/components/PrimeSlider.vue +3 -3
- package/dist/components/PrimeTextarea.vue +3 -3
- package/dist/components/PrimeToggleButton.vue +3 -3
- package/dist/components/PrimeToggleSwitch.vue +3 -3
- package/dist/components/PrimeTreeSelect.vue +3 -3
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +5 -5
- package/dist/composables/index.mjs +2 -2
- package/dist/composables/useFormKitIcon.js +2 -3
- package/dist/composables/useFormKitIcon.mjs +2 -4
- package/dist/composables/useFormKitInput.d.ts +0 -1
- package/dist/composables/useFormKitInput.js +0 -4
- package/dist/composables/useFormKitInput.mjs +1 -4
- package/dist/composables/useFormKitSection.d.ts +6 -0
- package/dist/composables/useFormKitSection.js +27 -0
- package/dist/composables/useFormKitSection.mjs +16 -0
- package/dist/composables/useInputEditor.d.ts +1 -0
- package/dist/composables/useInputEditor.js +2 -0
- package/dist/composables/useInputEditor.mjs +2 -1
- package/dist/composables/useInputEditorSchema.js +34 -21
- package/dist/composables/useInputEditorSchema.mjs +44 -24
- package/dist/sass/formkit-primevue.scss +24 -21
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/composables/useFormKitOutput.d.ts +0 -3
- package/dist/composables/useFormKitOutput.js +0 -15
- package/dist/composables/useFormKitOutput.mjs +0 -7
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { useFormKitSection } from '../composables'
|
|
3
3
|
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object,
|
|
6
6
|
})
|
|
7
|
-
const {
|
|
8
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
7
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<template>
|
|
12
|
-
<div
|
|
13
|
-
<i v-if="
|
|
11
|
+
<div class="p-formkit p-output-text">
|
|
12
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
13
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
14
|
+
{{ context?.attrs?.prefix }}
|
|
15
|
+
</span>
|
|
14
16
|
<span
|
|
15
17
|
:id="context?.id"
|
|
16
18
|
:style="context?.attrs?.style"
|
|
@@ -18,6 +20,9 @@ const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
|
18
20
|
>
|
|
19
21
|
{{ context?._value }}
|
|
20
22
|
</span>
|
|
21
|
-
<
|
|
23
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
24
|
+
{{ context?.attrs?.suffix }}
|
|
25
|
+
</span>
|
|
26
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
22
27
|
</div>
|
|
23
28
|
</template>
|
|
@@ -20,7 +20,7 @@ export interface FormKitPrimePasswordProps {
|
|
|
20
20
|
placeholder?: PasswordProps['placeholder']
|
|
21
21
|
feedback?: PasswordProps['feedback']
|
|
22
22
|
toggleMask?: PasswordProps['toggleMask']
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const props = defineProps({
|
|
@@ -30,11 +30,11 @@ const props = defineProps({
|
|
|
30
30
|
},
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const { styleClass,
|
|
33
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
<div
|
|
37
|
+
<div class="p-formkit">
|
|
38
38
|
<Password
|
|
39
39
|
v-model="context._value"
|
|
40
40
|
v-bind="context?.attrs"
|
|
@@ -12,7 +12,7 @@ export interface FormKitPrimeRadioButtonProps {
|
|
|
12
12
|
options?: { label: string, value: any }[]
|
|
13
13
|
optionClass?: string
|
|
14
14
|
labelClass?: string
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
@@ -22,11 +22,11 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const { styleClass,
|
|
25
|
+
const { styleClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<div
|
|
29
|
+
<div class="p-formkit">
|
|
30
30
|
<div v-for="option in context.options" :key="option.value" :class="context.optionClass">
|
|
31
31
|
<RadioButton
|
|
32
32
|
:id="context.id"
|
|
@@ -12,7 +12,7 @@ export interface FormKitPrimeRatingProps {
|
|
|
12
12
|
offIcon?: RatingProps['offIcon']
|
|
13
13
|
ptOptions?: RatingProps['ptOptions']
|
|
14
14
|
pt?: RatingProps['pt']
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
@@ -22,11 +22,11 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const { styleClass,
|
|
25
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<div
|
|
29
|
+
<div class="p-formkit">
|
|
30
30
|
<Rating
|
|
31
31
|
:id="context.id"
|
|
32
32
|
v-model="context._value"
|
|
@@ -37,7 +37,7 @@ export interface FormKitPrimeSelectProps {
|
|
|
37
37
|
pt?: SelectProps['pt']
|
|
38
38
|
ptOptions?: SelectProps['ptOptions']
|
|
39
39
|
unstyled?: SelectProps['unstyled']
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const props = defineProps({
|
|
@@ -47,11 +47,11 @@ const props = defineProps({
|
|
|
47
47
|
},
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
const { styleClass,
|
|
50
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<template>
|
|
54
|
-
<div
|
|
54
|
+
<div class="p-formkit">
|
|
55
55
|
<Select
|
|
56
56
|
v-model="context._value"
|
|
57
57
|
v-bind="context?.attrs"
|
|
@@ -15,7 +15,7 @@ export interface FormKitPrimeSelectButtonProps {
|
|
|
15
15
|
multiple?: SelectButtonProps['multiple']
|
|
16
16
|
dataKey?: SelectButtonProps['dataKey']
|
|
17
17
|
options?: SelectButtonProps['options']
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const props = defineProps({
|
|
@@ -25,11 +25,11 @@ const props = defineProps({
|
|
|
25
25
|
},
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
const { styleClass,
|
|
28
|
+
const { styleClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<template>
|
|
32
|
-
<div
|
|
32
|
+
<div class="p-formkit">
|
|
33
33
|
<SelectButton
|
|
34
34
|
:id="context.id"
|
|
35
35
|
v-model="context._value"
|
|
@@ -14,7 +14,7 @@ export interface FormKitPrimeSliderProps {
|
|
|
14
14
|
step?: SliderProps['step']
|
|
15
15
|
range?: SliderProps['range']
|
|
16
16
|
orientation?: SliderProps['orientation']
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const props = defineProps({
|
|
@@ -24,7 +24,7 @@ const props = defineProps({
|
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
const { styleClass,
|
|
27
|
+
const { styleClass, handleBlur } = useFormKitInput(props.context)
|
|
28
28
|
|
|
29
29
|
function handleInput(e: any) {
|
|
30
30
|
props.context?.node.input(e)
|
|
@@ -33,7 +33,7 @@ function handleInput(e: any) {
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<div
|
|
36
|
+
<div class="p-formkit">
|
|
37
37
|
<Slider
|
|
38
38
|
:id="context.id"
|
|
39
39
|
v-model="context._value"
|
|
@@ -12,7 +12,7 @@ export interface FormKitPrimeTextareaProps {
|
|
|
12
12
|
autoResize?: TextareaProps['autoResize']
|
|
13
13
|
rows?: TextareaProps['rows']
|
|
14
14
|
placeholder?: TextareaProps['placeholder']
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
@@ -22,11 +22,11 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const { styleClass,
|
|
25
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<div
|
|
29
|
+
<div class="p-formkit">
|
|
30
30
|
<Textarea
|
|
31
31
|
:id="context.id"
|
|
32
32
|
v-model="context._value"
|
|
@@ -14,7 +14,7 @@ export interface FormKitPrimeToggleButtonProps {
|
|
|
14
14
|
onIcon?: ToggleButtonProps['onIcon']
|
|
15
15
|
offIcon?: ToggleButtonProps['offIcon']
|
|
16
16
|
iconPos?: ToggleButtonProps['iconPos']
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const props = defineProps({
|
|
@@ -24,11 +24,11 @@ const props = defineProps({
|
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
const { styleClass,
|
|
27
|
+
const { styleClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<div
|
|
31
|
+
<div class="p-formkit">
|
|
32
32
|
<ToggleButton
|
|
33
33
|
v-model="context._value"
|
|
34
34
|
v-bind="context?.attrs"
|
|
@@ -13,7 +13,7 @@ export interface FormKitPrimeToggleSwitchProps {
|
|
|
13
13
|
unstyled?: ToggleSwitchProps['unstyled']
|
|
14
14
|
labelLeft?: string
|
|
15
15
|
labelRight?: string
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const props = defineProps({
|
|
@@ -23,11 +23,11 @@ const props = defineProps({
|
|
|
23
23
|
},
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const { styleClass,
|
|
26
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<div
|
|
30
|
+
<div class="p-formkit">
|
|
31
31
|
<span v-if="context.labelLeft" class="formkit-prime-left">{{ context.labelLeft }}</span>
|
|
32
32
|
<ToggleSwitch
|
|
33
33
|
v-model="context._value"
|
|
@@ -19,7 +19,7 @@ export interface FormKitPrimeTreeSelectProps {
|
|
|
19
19
|
scrollHeight?: TreeSelectProps['scrollHeight']
|
|
20
20
|
panelClass?: TreeSelectProps['panelClass']
|
|
21
21
|
variant?: TreeSelectProps['variant']
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const props = defineProps({
|
|
@@ -29,11 +29,11 @@ const props = defineProps({
|
|
|
29
29
|
},
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
const { styleClass,
|
|
32
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<div
|
|
36
|
+
<div class="p-formkit">
|
|
37
37
|
<TreeSelect
|
|
38
38
|
v-model="context._value"
|
|
39
39
|
v-bind="context?.attrs"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useFormKitIcon } from './useFormKitIcon';
|
|
2
2
|
import { useFormKitInput } from './useFormKitInput';
|
|
3
|
-
import { useFormKitOutput } from './useFormKitOutput';
|
|
4
3
|
import { useFormKitSchema } from './useFormKitSchema';
|
|
4
|
+
import { useFormKitSection } from './useFormKitSection';
|
|
5
5
|
import { useInputEditor } from './useInputEditor';
|
|
6
6
|
import { useInputEditorSchema } from './useInputEditorSchema';
|
|
7
7
|
import { useOutputDuration } from './useOutputDuration';
|
|
8
|
-
export { useFormKitIcon, useFormKitInput,
|
|
8
|
+
export { useFormKitIcon, useFormKitInput, useFormKitSchema, useFormKitSection, useInputEditor, useInputEditorSchema, useOutputDuration, };
|
|
@@ -15,16 +15,16 @@ Object.defineProperty(exports, "useFormKitInput", {
|
|
|
15
15
|
return _useFormKitInput.useFormKitInput;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "useFormKitSchema", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _useFormKitSchema.useFormKitSchema;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "useFormKitSection", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _useFormKitSection.useFormKitSection;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useInputEditor", {
|
|
@@ -47,8 +47,8 @@ Object.defineProperty(exports, "useOutputDuration", {
|
|
|
47
47
|
});
|
|
48
48
|
var _useFormKitIcon = require("./useFormKitIcon");
|
|
49
49
|
var _useFormKitInput = require("./useFormKitInput");
|
|
50
|
-
var _useFormKitOutput = require("./useFormKitOutput");
|
|
51
50
|
var _useFormKitSchema = require("./useFormKitSchema");
|
|
51
|
+
var _useFormKitSection = require("./useFormKitSection");
|
|
52
52
|
var _useInputEditor = require("./useInputEditor");
|
|
53
53
|
var _useInputEditorSchema = require("./useInputEditorSchema");
|
|
54
54
|
var _useOutputDuration = require("./useOutputDuration");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useFormKitIcon } from "./useFormKitIcon.mjs";
|
|
2
2
|
import { useFormKitInput } from "./useFormKitInput.mjs";
|
|
3
|
-
import { useFormKitOutput } from "./useFormKitOutput.mjs";
|
|
4
3
|
import { useFormKitSchema } from "./useFormKitSchema.mjs";
|
|
4
|
+
import { useFormKitSection } from "./useFormKitSection.mjs";
|
|
5
5
|
import { useInputEditor } from "./useInputEditor.mjs";
|
|
6
6
|
import { useInputEditorSchema } from "./useInputEditorSchema.mjs";
|
|
7
7
|
import { useOutputDuration } from "./useOutputDuration.mjs";
|
|
8
8
|
export {
|
|
9
9
|
useFormKitIcon,
|
|
10
10
|
useFormKitInput,
|
|
11
|
-
useFormKitOutput,
|
|
12
11
|
useFormKitSchema,
|
|
12
|
+
useFormKitSection,
|
|
13
13
|
useInputEditor,
|
|
14
14
|
useInputEditorSchema,
|
|
15
15
|
useOutputDuration
|
|
@@ -7,14 +7,13 @@ exports.useFormKitIcon = useFormKitIcon;
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
function useFormKitIcon(context) {
|
|
9
9
|
const hasIcon = (0, _vue.computed)(() => {
|
|
10
|
-
if (context?.icon && context?.icon.length > 0) return true;
|
|
11
10
|
return context?.attrs?.icon && context?.attrs?.icon.length > 0;
|
|
12
11
|
});
|
|
13
12
|
const icon = (0, _vue.computed)(() => {
|
|
14
|
-
return context?.
|
|
13
|
+
return context?.attrs?.icon;
|
|
15
14
|
});
|
|
16
15
|
const iconPosition = (0, _vue.computed)(() => {
|
|
17
|
-
return context?.
|
|
16
|
+
return context?.attrs?.iconPosition;
|
|
18
17
|
});
|
|
19
18
|
return {
|
|
20
19
|
hasIcon,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
export function useFormKitIcon(context) {
|
|
3
3
|
const hasIcon = computed(() => {
|
|
4
|
-
if (context?.icon && context?.icon.length > 0)
|
|
5
|
-
return true;
|
|
6
4
|
return context?.attrs?.icon && context?.attrs?.icon.length > 0;
|
|
7
5
|
});
|
|
8
6
|
const icon = computed(() => {
|
|
9
|
-
return context?.
|
|
7
|
+
return context?.attrs?.icon;
|
|
10
8
|
});
|
|
11
9
|
const iconPosition = computed(() => {
|
|
12
|
-
return context?.
|
|
10
|
+
return context?.attrs?.iconPosition;
|
|
13
11
|
});
|
|
14
12
|
return { hasIcon, icon, iconPosition };
|
|
15
13
|
}
|
|
@@ -9,9 +9,6 @@ function useFormKitInput(context) {
|
|
|
9
9
|
const styleClass = (0, _vue.computed)(() => {
|
|
10
10
|
return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
|
|
11
11
|
});
|
|
12
|
-
const wrapperClass = (0, _vue.computed)(() => {
|
|
13
|
-
return context?.wrapperClass ? `p-formkit ${context?.wrapperClass}` : "p-formkit ";
|
|
14
|
-
});
|
|
15
12
|
function handleBlur(event) {
|
|
16
13
|
context?.handlers.blur(event);
|
|
17
14
|
}
|
|
@@ -26,7 +23,6 @@ function useFormKitInput(context) {
|
|
|
26
23
|
}
|
|
27
24
|
return {
|
|
28
25
|
styleClass,
|
|
29
|
-
wrapperClass,
|
|
30
26
|
handleBlur,
|
|
31
27
|
handleChange,
|
|
32
28
|
handleInput,
|
|
@@ -3,9 +3,6 @@ export function useFormKitInput(context) {
|
|
|
3
3
|
const styleClass = computed(() => {
|
|
4
4
|
return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
|
|
5
5
|
});
|
|
6
|
-
const wrapperClass = computed(() => {
|
|
7
|
-
return context?.wrapperClass ? `p-formkit ${context?.wrapperClass}` : "p-formkit ";
|
|
8
|
-
});
|
|
9
6
|
function handleBlur(event) {
|
|
10
7
|
context?.handlers.blur(event);
|
|
11
8
|
}
|
|
@@ -18,5 +15,5 @@ export function useFormKitInput(context) {
|
|
|
18
15
|
function handleSelect(e) {
|
|
19
16
|
context?.node.input(e);
|
|
20
17
|
}
|
|
21
|
-
return { styleClass,
|
|
18
|
+
return { styleClass, handleBlur, handleChange, handleInput, handleSelect };
|
|
22
19
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFormKitSection = useFormKitSection;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
function useFormKitSection(context) {
|
|
9
|
+
const hasPrefix = (0, _vue.computed)(() => {
|
|
10
|
+
return context?.attrs?.prefix && context?.attrs?.prefix.length > 0;
|
|
11
|
+
});
|
|
12
|
+
const hasPrefixIcon = (0, _vue.computed)(() => {
|
|
13
|
+
return context?.prefixIcon && context?.prefixIcon.length > 0;
|
|
14
|
+
});
|
|
15
|
+
const hasSuffixIcon = (0, _vue.computed)(() => {
|
|
16
|
+
return context?.suffixIcon && context?.suffixIcon.length > 0;
|
|
17
|
+
});
|
|
18
|
+
const hasSuffix = (0, _vue.computed)(() => {
|
|
19
|
+
return context?.attrs?.suffix && context?.attrs?.suffix.length > 0;
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
hasPrefix,
|
|
23
|
+
hasPrefixIcon,
|
|
24
|
+
hasSuffix,
|
|
25
|
+
hasSuffixIcon
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export function useFormKitSection(context) {
|
|
3
|
+
const hasPrefix = computed(() => {
|
|
4
|
+
return context?.attrs?.prefix && context?.attrs?.prefix.length > 0;
|
|
5
|
+
});
|
|
6
|
+
const hasPrefixIcon = computed(() => {
|
|
7
|
+
return context?.prefixIcon && context?.prefixIcon.length > 0;
|
|
8
|
+
});
|
|
9
|
+
const hasSuffixIcon = computed(() => {
|
|
10
|
+
return context?.suffixIcon && context?.suffixIcon.length > 0;
|
|
11
|
+
});
|
|
12
|
+
const hasSuffix = computed(() => {
|
|
13
|
+
return context?.attrs?.suffix && context?.attrs?.suffix.length > 0;
|
|
14
|
+
});
|
|
15
|
+
return { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon };
|
|
16
|
+
}
|
|
@@ -7,6 +7,7 @@ exports.useInputEditor = useInputEditor;
|
|
|
7
7
|
function useInputEditor() {
|
|
8
8
|
const primeInputWithOptionNames = ["CascadeSelect", "Listbox", "MultiSelect", "RadioButton", "Select", "SelectButton", "TreeSelect"];
|
|
9
9
|
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Checkbox", "ColorPicker", "DatePicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "ToggleSwitch"].sort();
|
|
10
|
+
const primeOutputNames = ["OutputBoolean", "OutputDate", "OutputDuration", "OutputLink", "OutputList", "OutputNumber", "OutputText"];
|
|
10
11
|
function generateSchemaItemId() {
|
|
11
12
|
return `id-${Math.random().toString(36).substring(2, 15)}`;
|
|
12
13
|
}
|
|
@@ -100,6 +101,7 @@ function useInputEditor() {
|
|
|
100
101
|
}
|
|
101
102
|
return {
|
|
102
103
|
primeInputNames,
|
|
104
|
+
primeOutputNames,
|
|
103
105
|
generateSchemaItemId,
|
|
104
106
|
editorDataToSchema,
|
|
105
107
|
editorDataToJson,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export function useInputEditor() {
|
|
2
2
|
const primeInputWithOptionNames = ["CascadeSelect", "Listbox", "MultiSelect", "RadioButton", "Select", "SelectButton", "TreeSelect"];
|
|
3
3
|
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Checkbox", "ColorPicker", "DatePicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "ToggleSwitch"].sort();
|
|
4
|
+
const primeOutputNames = ["OutputBoolean", "OutputDate", "OutputDuration", "OutputLink", "OutputList", "OutputNumber", "OutputText"];
|
|
4
5
|
function generateSchemaItemId() {
|
|
5
6
|
return `id-${Math.random().toString(36).substring(2, 15)}`;
|
|
6
7
|
}
|
|
@@ -64,5 +65,5 @@ export function useInputEditor() {
|
|
|
64
65
|
const formkitInput = schema?.$formkit;
|
|
65
66
|
return { ...schema, _dollar_formkit: formkitInput };
|
|
66
67
|
}
|
|
67
|
-
return { primeInputNames, generateSchemaItemId, editorDataToSchema, editorDataToJson, editorDataToCode: editorDataToObject, schemaToEditorData };
|
|
68
|
+
return { primeInputNames, primeOutputNames, generateSchemaItemId, editorDataToSchema, editorDataToJson, editorDataToCode: editorDataToObject, schemaToEditorData };
|
|
68
69
|
}
|
|
@@ -14,7 +14,8 @@ function useInputEditorSchema() {
|
|
|
14
14
|
addComponent
|
|
15
15
|
} = (0, _useFormKitSchema.useFormKitSchema)();
|
|
16
16
|
const {
|
|
17
|
-
primeInputNames
|
|
17
|
+
primeInputNames,
|
|
18
|
+
primeOutputNames
|
|
18
19
|
} = (0, _useInputEditor.useInputEditor)();
|
|
19
20
|
function addFlexElement(children) {
|
|
20
21
|
return addElement("div", children, {
|
|
@@ -82,14 +83,7 @@ function useInputEditorSchema() {
|
|
|
82
83
|
label: "Submit",
|
|
83
84
|
value: "submit"
|
|
84
85
|
}];
|
|
85
|
-
|
|
86
|
-
label: "Left",
|
|
87
|
-
value: "left"
|
|
88
|
-
}, {
|
|
89
|
-
label: "Right",
|
|
90
|
-
value: "right"
|
|
91
|
-
}];
|
|
92
|
-
function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
|
|
86
|
+
function editorSchema(inputOptions = primeInputOptions([...primeInputNames, ...primeOutputNames])) {
|
|
93
87
|
return [addGridElement([{
|
|
94
88
|
$formkit: "primeSelect",
|
|
95
89
|
id: "inputSelection",
|
|
@@ -99,6 +93,7 @@ function useInputEditorSchema() {
|
|
|
99
93
|
optionLabel: "label",
|
|
100
94
|
optionValue: "value",
|
|
101
95
|
options: inputOptions,
|
|
96
|
+
filter: true,
|
|
102
97
|
key: "schema_inputSelection",
|
|
103
98
|
preserve: true
|
|
104
99
|
}, {
|
|
@@ -134,14 +129,21 @@ function useInputEditorSchema() {
|
|
|
134
129
|
label: "Input Help",
|
|
135
130
|
key: "schema_help",
|
|
136
131
|
preserve: true
|
|
137
|
-
}, {
|
|
132
|
+
}, addGridElement([{
|
|
138
133
|
$formkit: "primeInputText",
|
|
139
134
|
if: "$get(selectButton).value === 'showBasic'",
|
|
140
135
|
name: "value",
|
|
141
136
|
label: "Input Value",
|
|
142
137
|
key: "schema_value",
|
|
143
138
|
preserve: true
|
|
144
|
-
},
|
|
139
|
+
}, {
|
|
140
|
+
$formkit: "primeInputText",
|
|
141
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
142
|
+
name: "format",
|
|
143
|
+
label: "Value Format",
|
|
144
|
+
key: "schema_format",
|
|
145
|
+
preserve: true
|
|
146
|
+
}]), addGridElement([{
|
|
145
147
|
$formkit: "primeInputText",
|
|
146
148
|
if: "$get(selectButton).value === 'showBasic'",
|
|
147
149
|
name: "id",
|
|
@@ -219,19 +221,30 @@ function useInputEditorSchema() {
|
|
|
219
221
|
}, addGridElement([{
|
|
220
222
|
$formkit: "primeInputText",
|
|
221
223
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
222
|
-
name: "
|
|
223
|
-
label: "Icon",
|
|
224
|
-
key: "
|
|
224
|
+
name: "prefixIcon",
|
|
225
|
+
label: "Prefix Icon",
|
|
226
|
+
key: "schema_prefix_icon",
|
|
225
227
|
preserve: true
|
|
226
228
|
}, {
|
|
227
|
-
$formkit: "
|
|
229
|
+
$formkit: "primeInputText",
|
|
228
230
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
229
|
-
name: "
|
|
230
|
-
label: "
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
name: "prefix",
|
|
232
|
+
label: "Prefix",
|
|
233
|
+
key: "schema_prefix",
|
|
234
|
+
preserve: true
|
|
235
|
+
}, {
|
|
236
|
+
$formkit: "primeInputText",
|
|
237
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
238
|
+
name: "suffix",
|
|
239
|
+
label: "Suffix",
|
|
240
|
+
key: "schema_suffix",
|
|
241
|
+
preserve: true
|
|
242
|
+
}, {
|
|
243
|
+
$formkit: "primeInputText",
|
|
244
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
245
|
+
name: "suffixIcon",
|
|
246
|
+
label: "Suffix Icon",
|
|
247
|
+
key: "schema_suffix_icon",
|
|
235
248
|
preserve: true
|
|
236
249
|
}, {
|
|
237
250
|
$formkit: "primeCheckbox",
|