@sfxcode/formkit-primevue 2.3.5 → 2.3.6
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/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 +11 -6
- 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 +25 -19
- package/dist/composables/useInputEditorSchema.mjs +26 -16
- 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
|
@@ -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
|
}, {
|
|
@@ -219,19 +214,30 @@ function useInputEditorSchema() {
|
|
|
219
214
|
}, addGridElement([{
|
|
220
215
|
$formkit: "primeInputText",
|
|
221
216
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
222
|
-
name: "
|
|
223
|
-
label: "Icon",
|
|
224
|
-
key: "
|
|
217
|
+
name: "prefixIcon",
|
|
218
|
+
label: "Prefix Icon",
|
|
219
|
+
key: "schema_prefix_icon",
|
|
225
220
|
preserve: true
|
|
226
221
|
}, {
|
|
227
|
-
$formkit: "
|
|
222
|
+
$formkit: "primeInputText",
|
|
228
223
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
229
|
-
name: "
|
|
230
|
-
label: "
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
224
|
+
name: "prefix",
|
|
225
|
+
label: "Prefix",
|
|
226
|
+
key: "schema_prefix",
|
|
227
|
+
preserve: true
|
|
228
|
+
}, {
|
|
229
|
+
$formkit: "primeInputText",
|
|
230
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
231
|
+
name: "suffix",
|
|
232
|
+
label: "Suffix",
|
|
233
|
+
key: "schema_suffix",
|
|
234
|
+
preserve: true
|
|
235
|
+
}, {
|
|
236
|
+
$formkit: "primeInputText",
|
|
237
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
238
|
+
name: "suffixIcon",
|
|
239
|
+
label: "Suffix Icon",
|
|
240
|
+
key: "schema_suffix_icon",
|
|
235
241
|
preserve: true
|
|
236
242
|
}, {
|
|
237
243
|
$formkit: "primeCheckbox",
|
|
@@ -2,7 +2,7 @@ import { useFormKitSchema } from "./useFormKitSchema.mjs";
|
|
|
2
2
|
import { useInputEditor } from "./useInputEditor.mjs";
|
|
3
3
|
export function useInputEditorSchema() {
|
|
4
4
|
const { addElement, addList, addListGroup, addComponent } = useFormKitSchema();
|
|
5
|
-
const { primeInputNames } = useInputEditor();
|
|
5
|
+
const { primeInputNames, primeOutputNames } = useInputEditor();
|
|
6
6
|
function addFlexElement(children) {
|
|
7
7
|
return addElement("div", children, { style: "max-width: 40rem;display: flex;gap: 1rem;" });
|
|
8
8
|
}
|
|
@@ -40,11 +40,7 @@ export function useInputEditorSchema() {
|
|
|
40
40
|
{ label: "Dirty", value: "dirty" },
|
|
41
41
|
{ label: "Submit", value: "submit" }
|
|
42
42
|
];
|
|
43
|
-
|
|
44
|
-
{ label: "Left", value: "left" },
|
|
45
|
-
{ label: "Right", value: "right" }
|
|
46
|
-
];
|
|
47
|
-
function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
|
|
43
|
+
function editorSchema(inputOptions = primeInputOptions([...primeInputNames, ...primeOutputNames])) {
|
|
48
44
|
return [
|
|
49
45
|
addGridElement([
|
|
50
46
|
{
|
|
@@ -56,6 +52,7 @@ export function useInputEditorSchema() {
|
|
|
56
52
|
optionLabel: "label",
|
|
57
53
|
optionValue: "value",
|
|
58
54
|
options: inputOptions,
|
|
55
|
+
filter: true,
|
|
59
56
|
key: "schema_inputSelection",
|
|
60
57
|
preserve: true
|
|
61
58
|
},
|
|
@@ -198,20 +195,33 @@ export function useInputEditorSchema() {
|
|
|
198
195
|
{
|
|
199
196
|
$formkit: "primeInputText",
|
|
200
197
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
201
|
-
name: "
|
|
202
|
-
label: "Icon",
|
|
203
|
-
key: "
|
|
198
|
+
name: "prefixIcon",
|
|
199
|
+
label: "Prefix Icon",
|
|
200
|
+
key: "schema_prefix_icon",
|
|
204
201
|
preserve: true
|
|
205
202
|
},
|
|
206
203
|
{
|
|
207
|
-
$formkit: "
|
|
204
|
+
$formkit: "primeInputText",
|
|
208
205
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
209
|
-
name: "
|
|
210
|
-
label: "
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
name: "prefix",
|
|
207
|
+
label: "Prefix",
|
|
208
|
+
key: "schema_prefix",
|
|
209
|
+
preserve: true
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
$formkit: "primeInputText",
|
|
213
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
214
|
+
name: "suffix",
|
|
215
|
+
label: "Suffix",
|
|
216
|
+
key: "schema_suffix",
|
|
217
|
+
preserve: true
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
$formkit: "primeInputText",
|
|
221
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
222
|
+
name: "suffixIcon",
|
|
223
|
+
label: "Suffix Icon",
|
|
224
|
+
key: "schema_suffix_icon",
|
|
215
225
|
preserve: true
|
|
216
226
|
},
|
|
217
227
|
{
|