@sfxcode/formkit-primevue 3.3.5 → 3.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/LICENSE +21 -0
- package/README.md +138 -13
- package/components.d.ts +1 -0
- package/dist/components/FormKitDataDebug.d.vue.ts +24 -0
- package/dist/components/FormKitDataDebug.vue +9 -5
- package/dist/components/FormKitDataDebug.vue.d.ts +24 -0
- package/dist/components/FormKitDataEdit.d.vue.ts +180 -0
- package/dist/components/FormKitDataEdit.vue +46 -53
- package/dist/components/FormKitDataEdit.vue.d.ts +180 -0
- package/dist/components/FormKitDataView.d.vue.ts +73 -0
- package/dist/components/FormKitDataView.vue +27 -20
- package/dist/components/FormKitDataView.vue.d.ts +73 -0
- package/dist/components/FormKitIcon.d.vue.ts +39 -0
- package/dist/components/FormKitIcon.vue +13 -6
- package/dist/components/FormKitIcon.vue.d.ts +39 -0
- package/dist/components/FormKitPrefix.d.vue.ts +7 -0
- package/dist/components/FormKitPrefix.vue +3 -3
- package/dist/components/FormKitPrefix.vue.d.ts +7 -0
- package/dist/components/FormKitSuffix.d.vue.ts +7 -0
- package/dist/components/FormKitSuffix.vue +3 -3
- package/dist/components/FormKitSuffix.vue.d.ts +7 -0
- package/dist/components/PrimeAutoComplete.d.vue.ts +31 -0
- package/dist/components/PrimeAutoComplete.vue +86 -41
- package/dist/components/PrimeAutoComplete.vue.d.ts +31 -0
- package/dist/components/PrimeCascadeSelect.d.vue.ts +28 -0
- package/dist/components/PrimeCascadeSelect.vue +26 -7
- package/dist/components/PrimeCascadeSelect.vue.d.ts +28 -0
- package/dist/components/PrimeCheckbox.d.vue.ts +27 -0
- package/dist/components/PrimeCheckbox.vue +29 -9
- package/dist/components/PrimeCheckbox.vue.d.ts +27 -0
- package/dist/components/PrimeColorPicker.d.vue.ts +24 -0
- package/dist/components/PrimeColorPicker.vue +22 -7
- package/dist/components/PrimeColorPicker.vue.d.ts +24 -0
- package/dist/components/PrimeDatePicker.d.vue.ts +63 -0
- package/dist/components/PrimeDatePicker.vue +73 -17
- package/dist/components/PrimeDatePicker.vue.d.ts +63 -0
- package/dist/components/PrimeInputMask.d.vue.ts +28 -0
- package/dist/components/PrimeInputMask.vue +29 -10
- package/dist/components/PrimeInputMask.vue.d.ts +28 -0
- package/dist/components/PrimeInputNumber.d.vue.ts +36 -0
- package/dist/components/PrimeInputNumber.vue +56 -21
- package/dist/components/PrimeInputNumber.vue.d.ts +36 -0
- package/dist/components/PrimeInputOtp.d.vue.ts +26 -0
- package/dist/components/PrimeInputOtp.vue +24 -7
- package/dist/components/PrimeInputOtp.vue.d.ts +26 -0
- package/dist/components/PrimeInputText.d.vue.ts +24 -0
- package/dist/components/PrimeInputText.vue +25 -10
- package/dist/components/PrimeInputText.vue.d.ts +24 -0
- package/dist/components/PrimeKnob.d.vue.ts +31 -0
- package/dist/components/PrimeKnob.vue +37 -12
- package/dist/components/PrimeKnob.vue.d.ts +31 -0
- package/dist/components/PrimeListbox.d.vue.ts +42 -0
- package/dist/components/PrimeListbox.vue +39 -7
- package/dist/components/PrimeListbox.vue.d.ts +42 -0
- package/dist/components/PrimeMultiSelect.d.vue.ts +53 -0
- package/dist/components/PrimeMultiSelect.vue +52 -7
- package/dist/components/PrimeMultiSelect.vue.d.ts +53 -0
- package/dist/components/PrimeOutputBoolean.d.vue.ts +16 -0
- package/dist/components/PrimeOutputBoolean.vue +27 -28
- package/dist/components/PrimeOutputBoolean.vue.d.ts +16 -0
- package/dist/components/PrimeOutputDate.d.vue.ts +16 -0
- package/dist/components/PrimeOutputDate.vue +33 -33
- package/dist/components/PrimeOutputDate.vue.d.ts +16 -0
- package/dist/components/PrimeOutputDuration.d.vue.ts +16 -0
- package/dist/components/PrimeOutputDuration.vue +19 -23
- package/dist/components/PrimeOutputDuration.vue.d.ts +16 -0
- package/dist/components/PrimeOutputLink.d.vue.ts +16 -0
- package/dist/components/PrimeOutputLink.vue +27 -29
- package/dist/components/PrimeOutputLink.vue.d.ts +16 -0
- package/dist/components/PrimeOutputList.d.vue.ts +23 -0
- package/dist/components/PrimeOutputList.vue +42 -26
- package/dist/components/PrimeOutputList.vue.d.ts +23 -0
- package/dist/components/PrimeOutputNumber.d.vue.ts +16 -0
- package/dist/components/PrimeOutputNumber.vue +39 -36
- package/dist/components/PrimeOutputNumber.vue.d.ts +16 -0
- package/dist/components/PrimeOutputReference.d.vue.ts +16 -0
- package/dist/components/PrimeOutputReference.vue +30 -32
- package/dist/components/PrimeOutputReference.vue.d.ts +16 -0
- package/dist/components/PrimeOutputText.d.vue.ts +22 -0
- package/dist/components/PrimeOutputText.vue +53 -53
- package/dist/components/PrimeOutputText.vue.d.ts +22 -0
- package/dist/components/PrimePassword.d.vue.ts +33 -0
- package/dist/components/PrimePassword.vue +32 -11
- package/dist/components/PrimePassword.vue.d.ts +33 -0
- package/dist/components/PrimeRadioButton.d.vue.ts +28 -0
- package/dist/components/PrimeRadioButton.vue +29 -19
- package/dist/components/PrimeRadioButton.vue.d.ts +28 -0
- package/dist/components/PrimeRating.d.vue.ts +24 -0
- package/dist/components/PrimeRating.vue +22 -7
- package/dist/components/PrimeRating.vue.d.ts +24 -0
- package/dist/components/PrimeSelect.d.vue.ts +50 -0
- package/dist/components/PrimeSelect.vue +49 -7
- package/dist/components/PrimeSelect.vue.d.ts +50 -0
- package/dist/components/PrimeSelectButton.d.vue.ts +28 -0
- package/dist/components/PrimeSelectButton.vue +27 -7
- package/dist/components/PrimeSelectButton.vue.d.ts +28 -0
- package/dist/components/PrimeSlider.d.vue.ts +26 -0
- package/dist/components/PrimeSlider.vue +28 -10
- package/dist/components/PrimeSlider.vue.d.ts +26 -0
- package/dist/components/PrimeTextarea.d.vue.ts +25 -0
- package/dist/components/PrimeTextarea.vue +23 -7
- package/dist/components/PrimeTextarea.vue.d.ts +25 -0
- package/dist/components/PrimeToggleButton.d.vue.ts +26 -0
- package/dist/components/PrimeToggleButton.vue +25 -7
- package/dist/components/PrimeToggleButton.vue.d.ts +26 -0
- package/dist/components/PrimeToggleSwitch.d.vue.ts +23 -0
- package/dist/components/PrimeToggleSwitch.vue +23 -8
- package/dist/components/PrimeToggleSwitch.vue.d.ts +23 -0
- package/dist/components/PrimeTreeSelect.d.vue.ts +32 -0
- package/dist/components/PrimeTreeSelect.vue +30 -7
- package/dist/components/PrimeTreeSelect.vue.d.ts +32 -0
- package/dist/components/index.d.ts +23 -23
- package/dist/composables/index.d.ts +8 -8
- package/dist/composables/index.js +8 -8
- package/dist/composables/index.mjs +8 -8
- package/dist/composables/useFormKitInput.js +1 -5
- package/dist/composables/useFormKitInput.mjs +1 -13
- package/dist/composables/useFormKitRepeater.js +1 -1
- package/dist/composables/useFormKitRepeater.mjs +17 -45
- package/dist/composables/useFormKitSchema.mjs +2 -10
- package/dist/composables/useInputEditor.js +4 -4
- package/dist/composables/useInputEditor.mjs +24 -52
- package/dist/composables/useInputEditorSchema.js +3 -3
- package/dist/composables/useInputEditorSchema.mjs +17 -25
- package/dist/composables/useOutputDuration.mjs +6 -3
- package/dist/definitions/index.js +2 -2
- package/dist/definitions/index.mjs +2 -2
- package/dist/definitions/input.d.ts +1 -1
- package/dist/definitions/input.mjs +15 -301
- package/dist/definitions/output.d.ts +1 -1
- package/dist/index.d.ts +48 -48
- package/dist/index.js +12 -12
- package/dist/index.mjs +3 -9
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.mjs +27 -31
- package/dist/sass/formkit-primevue.scss +101 -99
- package/package.json +80 -45
- package/dist/vue.d.ts +0 -5
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { useFormKitSchema } from "./useFormKitSchema.
|
|
1
|
+
import { useFormKitSchema } from "./useFormKitSchema.mjs";
|
|
2
2
|
export function useFormKitRepeater() {
|
|
3
3
|
const { addElement, addComponent, addElementsInOuterDiv } = useFormKitSchema();
|
|
4
4
|
function addInsertButton(label = "Add", innerClass = "", outerClass = "", buttonClass = "p-button-sm", iconClass = "pi pi-plus") {
|
|
5
|
-
return addElementsInOuterDiv(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"Button",
|
|
9
|
-
{ onClick: "$addNode($node)", label, class: buttonClass, icon: iconClass },
|
|
10
|
-
"$node.children.length == 0"
|
|
11
|
-
)
|
|
12
|
-
],
|
|
13
|
-
innerClass,
|
|
14
|
-
outerClass
|
|
15
|
-
);
|
|
5
|
+
return addElementsInOuterDiv([
|
|
6
|
+
addComponent("Button", { onClick: "$addNode($node)", label, class: buttonClass, icon: iconClass }, "$node.children.length == 0")
|
|
7
|
+
], innerClass, outerClass);
|
|
16
8
|
}
|
|
17
9
|
function addListGroupFunctions(data, addNodeDefaultObject = {}) {
|
|
18
10
|
const swapElements = (array, index1, index2) => {
|
|
@@ -27,18 +19,17 @@ export function useFormKitRepeater() {
|
|
|
27
19
|
parentNode.input(newArray, false);
|
|
28
20
|
};
|
|
29
21
|
data.removeNode = (parentNode, index) => () => {
|
|
30
|
-
parentNode.input(
|
|
31
|
-
parentNode._value.filter((_, i) => i !== index),
|
|
32
|
-
false
|
|
33
|
-
);
|
|
22
|
+
parentNode.input(parentNode._value.filter((_, i) => i !== index), false);
|
|
34
23
|
};
|
|
35
24
|
data.moveNodeUp = (parentNode, index) => () => {
|
|
36
25
|
const array = [...parentNode.value];
|
|
37
|
-
if (index > 0)
|
|
26
|
+
if (index > 0)
|
|
27
|
+
parentNode.input(swapElements(array, index - 1, index), false);
|
|
38
28
|
};
|
|
39
29
|
data.moveNodeDown = (parentNode, index) => () => {
|
|
40
30
|
const array = [...parentNode.value];
|
|
41
|
-
if (index < array.length - 1)
|
|
31
|
+
if (index < array.length - 1)
|
|
32
|
+
parentNode.input(swapElements(array, index, index + 1), false);
|
|
42
33
|
};
|
|
43
34
|
data.copyNode = (parentNode, index) => () => {
|
|
44
35
|
const obj = parentNode.value[index];
|
|
@@ -50,33 +41,14 @@ export function useFormKitRepeater() {
|
|
|
50
41
|
const addButtonComponent = (onClick = "", label2 = "", icon = "", severity = "", render2 = "true", styleClass = "p-button-sm") => {
|
|
51
42
|
return addComponent("Button", { onClick, label: label2, icon, class: styleClass, severity }, render2);
|
|
52
43
|
};
|
|
53
|
-
return addElementsInOuterDiv(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"secondary",
|
|
62
|
-
"$index != 0"
|
|
63
|
-
),
|
|
64
|
-
addElement("span", [], { class: "p-space" }, "$index == 0"),
|
|
65
|
-
addButtonComponent(
|
|
66
|
-
"$moveNodeDown($node.parent, $index)",
|
|
67
|
-
"",
|
|
68
|
-
"pi pi-arrow-down",
|
|
69
|
-
"secondary",
|
|
70
|
-
"$index < $node.parent.value.length -1"
|
|
71
|
-
),
|
|
72
|
-
addElement("span", [], { class: "p-space" }, "$index == $node.parent.value.length -1")
|
|
73
|
-
],
|
|
74
|
-
`p-action-buttons ${innerClass}`,
|
|
75
|
-
outerClass,
|
|
76
|
-
label,
|
|
77
|
-
help,
|
|
78
|
-
render
|
|
79
|
-
);
|
|
44
|
+
return addElementsInOuterDiv([
|
|
45
|
+
addButtonComponent("$removeNode($node.parent, $index)", "", "pi pi-times", "danger"),
|
|
46
|
+
addButtonComponent("$copyNode($node.parent, $index)", "", "pi pi-plus"),
|
|
47
|
+
addButtonComponent("$moveNodeUp($node.parent, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"),
|
|
48
|
+
addElement("span", [], { class: "p-space" }, "$index == 0"),
|
|
49
|
+
addButtonComponent("$moveNodeDown($node.parent, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.parent.value.length -1"),
|
|
50
|
+
addElement("span", [], { class: "p-space" }, "$index == $node.parent.value.length -1")
|
|
51
|
+
], `p-action-buttons ${innerClass}`, outerClass, label, help, render);
|
|
80
52
|
}
|
|
81
53
|
return { addInsertButton, addGroupButtons, addListGroupFunctions };
|
|
82
54
|
}
|
|
@@ -48,19 +48,11 @@ export function useFormKitSchema() {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
const addElementsInOuterDiv = (children = [], innerClass = "", outerClass = "", label = "", help = "", render = true) => {
|
|
51
|
-
const inner = addElement("div", children, {
|
|
52
|
-
class: `formkit-inner ${innerClass}`,
|
|
53
|
-
style: "position: relative;"
|
|
54
|
-
});
|
|
51
|
+
const inner = addElement("div", children, { class: `formkit-inner ${innerClass}`, style: "position: relative;" });
|
|
55
52
|
const labelDiv = addElement("label", [label], { class: "formkit-label" });
|
|
56
53
|
const wrapperDiv = addElement("div", [labelDiv, inner], { class: "formkit-wrapper" });
|
|
57
54
|
const helpDiv = addElement("div", [help], { class: "formkit-help" });
|
|
58
|
-
return addElement(
|
|
59
|
-
"div",
|
|
60
|
-
[wrapperDiv, helpDiv],
|
|
61
|
-
{ class: `formkit-outer ${outerClass}`, style: "position: relative;" },
|
|
62
|
-
render
|
|
63
|
-
);
|
|
55
|
+
return addElement("div", [wrapperDiv, helpDiv], { class: `formkit-outer ${outerClass}`, style: "position: relative;" }, render);
|
|
64
56
|
};
|
|
65
57
|
return { addComponent, addElement, addGroup, addList, addListGroup, addElementsInOuterDiv };
|
|
66
58
|
}
|
|
@@ -21,9 +21,9 @@ function useInputEditor() {
|
|
|
21
21
|
}
|
|
22
22
|
return [key, value];
|
|
23
23
|
});
|
|
24
|
-
tempData =
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
tempData = {
|
|
25
|
+
...Object.fromEntries(mapped)
|
|
26
|
+
};
|
|
27
27
|
}
|
|
28
28
|
const readonlyValue = data.readonly === true ? true : void 0;
|
|
29
29
|
const disabledValue = data.disabled === true ? true : void 0;
|
|
@@ -47,7 +47,7 @@ function useInputEditor() {
|
|
|
47
47
|
selectButton: void 0
|
|
48
48
|
};
|
|
49
49
|
const useOptions = formkitInput ? primeInputWithOptionNames.map(s => `prime${s}`).includes(formkitInput) : false;
|
|
50
|
-
let result
|
|
50
|
+
let result;
|
|
51
51
|
if (useOptions) {
|
|
52
52
|
result = {
|
|
53
53
|
...data,
|
|
@@ -1,50 +1,14 @@
|
|
|
1
1
|
export function useInputEditor() {
|
|
2
|
-
const primeInputWithOptionNames = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"MultiSelect",
|
|
6
|
-
"RadioButton",
|
|
7
|
-
"Select",
|
|
8
|
-
"SelectButton",
|
|
9
|
-
"TreeSelect"
|
|
10
|
-
];
|
|
11
|
-
const primeInputNames = [
|
|
12
|
-
...primeInputWithOptionNames,
|
|
13
|
-
"AutoComplete",
|
|
14
|
-
"Checkbox",
|
|
15
|
-
"ColorPicker",
|
|
16
|
-
"DatePicker",
|
|
17
|
-
"Editor",
|
|
18
|
-
"InputMask",
|
|
19
|
-
"InputNumber",
|
|
20
|
-
"InputOtp",
|
|
21
|
-
"InputText",
|
|
22
|
-
"Knob",
|
|
23
|
-
"Password",
|
|
24
|
-
"Rating",
|
|
25
|
-
"Slider",
|
|
26
|
-
"Textarea",
|
|
27
|
-
"ToggleButton",
|
|
28
|
-
"ToggleSwitch"
|
|
29
|
-
].sort();
|
|
30
|
-
const primeOutputNames = [
|
|
31
|
-
"OutputBoolean",
|
|
32
|
-
"OutputDate",
|
|
33
|
-
"OutputDuration",
|
|
34
|
-
"OutputLink",
|
|
35
|
-
"OutputList",
|
|
36
|
-
"OutputNumber",
|
|
37
|
-
"OutputReference",
|
|
38
|
-
"OutputText"
|
|
39
|
-
];
|
|
2
|
+
const primeInputWithOptionNames = ["CascadeSelect", "Listbox", "MultiSelect", "RadioButton", "Select", "SelectButton", "TreeSelect"];
|
|
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", "OutputReference", "OutputText"];
|
|
40
5
|
function editorDataToSchema(data) {
|
|
41
|
-
if (!data)
|
|
6
|
+
if (!data)
|
|
7
|
+
return {};
|
|
42
8
|
const formkitInput = data?._dollar_formkit;
|
|
43
9
|
let tempData = {};
|
|
44
10
|
if (data.prime && Array.isArray(data.prime) && data.prime.length > 0) {
|
|
45
|
-
const mapped = data.prime.filter(
|
|
46
|
-
(entry) => entry && typeof entry === "object" && "prime_key" in entry && "prime_value" in entry
|
|
47
|
-
).map((entry) => {
|
|
11
|
+
const mapped = data.prime.filter((entry) => entry && typeof entry === "object" && "prime_key" in entry && "prime_value" in entry).map((entry) => {
|
|
48
12
|
const key = entry.prime_key || "";
|
|
49
13
|
let value = entry.prime_value;
|
|
50
14
|
if (formkitInput === "primeInputOtp" && key === "length" && value !== void 0) {
|
|
@@ -52,7 +16,7 @@ export function useInputEditor() {
|
|
|
52
16
|
}
|
|
53
17
|
return [key, value];
|
|
54
18
|
});
|
|
55
|
-
tempData =
|
|
19
|
+
tempData = { ...Object.fromEntries(mapped) };
|
|
56
20
|
}
|
|
57
21
|
const readonlyValue = data.readonly === true ? true : void 0;
|
|
58
22
|
const disabledValue = data.disabled === true ? true : void 0;
|
|
@@ -63,11 +27,14 @@ export function useInputEditor() {
|
|
|
63
27
|
preserve: preserveValue
|
|
64
28
|
};
|
|
65
29
|
let outerClass = "";
|
|
66
|
-
if (data.outerClass)
|
|
30
|
+
if (data.outerClass)
|
|
31
|
+
outerClass = `${outerClass} ${data.outerClass}`.trim();
|
|
67
32
|
let wrapperClass = "";
|
|
68
|
-
if (data.wrapperClass)
|
|
33
|
+
if (data.wrapperClass)
|
|
34
|
+
wrapperClass = `${wrapperClass} ${data.wrapperClass}`.trim();
|
|
69
35
|
let innerClass = "";
|
|
70
|
-
if (data.innerClass)
|
|
36
|
+
if (data.innerClass)
|
|
37
|
+
innerClass = `${innerClass} ${data.innerClass}`.trim();
|
|
71
38
|
const undefinedObject = {
|
|
72
39
|
prime: void 0,
|
|
73
40
|
schemaResultFormKey: void 0,
|
|
@@ -76,7 +43,7 @@ export function useInputEditor() {
|
|
|
76
43
|
selectButton: void 0
|
|
77
44
|
};
|
|
78
45
|
const useOptions = formkitInput ? primeInputWithOptionNames.map((s) => `prime${s}`).includes(formkitInput) : false;
|
|
79
|
-
let result
|
|
46
|
+
let result;
|
|
80
47
|
if (useOptions) {
|
|
81
48
|
result = {
|
|
82
49
|
...data,
|
|
@@ -114,7 +81,8 @@ export function useInputEditor() {
|
|
|
114
81
|
return result;
|
|
115
82
|
}
|
|
116
83
|
function dataToSchema(data) {
|
|
117
|
-
if (!data)
|
|
84
|
+
if (!data)
|
|
85
|
+
return {};
|
|
118
86
|
const schema = editorDataToSchema(data);
|
|
119
87
|
if (schema?.options && Array.isArray(schema.options)) {
|
|
120
88
|
const options = schema.options.map((o) => o ? JSON.parse(JSON.stringify(o)) : {});
|
|
@@ -124,11 +92,13 @@ export function useInputEditor() {
|
|
|
124
92
|
}
|
|
125
93
|
}
|
|
126
94
|
function editorDataToJson(data) {
|
|
127
|
-
if (!data)
|
|
95
|
+
if (!data)
|
|
96
|
+
return "{}";
|
|
128
97
|
return JSON.stringify(dataToSchema(data));
|
|
129
98
|
}
|
|
130
99
|
function objectToString(data) {
|
|
131
|
-
if (!data)
|
|
100
|
+
if (!data)
|
|
101
|
+
return "{}";
|
|
132
102
|
return `{${Object.entries(data).map(([key, value]) => {
|
|
133
103
|
if (key === "options" && Array.isArray(value) && value.length > 0) {
|
|
134
104
|
let result = "[";
|
|
@@ -146,7 +116,8 @@ export function useInputEditor() {
|
|
|
146
116
|
}).join()}}`;
|
|
147
117
|
}
|
|
148
118
|
function editorDataToObject(data) {
|
|
149
|
-
if (!data)
|
|
119
|
+
if (!data)
|
|
120
|
+
return "{}";
|
|
150
121
|
try {
|
|
151
122
|
const jsonData = editorDataToJson(data);
|
|
152
123
|
return objectToString(JSON.parse(jsonData));
|
|
@@ -156,7 +127,8 @@ export function useInputEditor() {
|
|
|
156
127
|
}
|
|
157
128
|
}
|
|
158
129
|
function schemaToEditorData(schema) {
|
|
159
|
-
if (!schema)
|
|
130
|
+
if (!schema)
|
|
131
|
+
return {};
|
|
160
132
|
const formkitInput = schema?.$formkit;
|
|
161
133
|
return { ...schema, _dollar_formkit: formkitInput };
|
|
162
134
|
}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useInputEditorSchema = useInputEditorSchema;
|
|
7
|
-
var _useFormKitRepeater = require("./useFormKitRepeater
|
|
8
|
-
var _useFormKitSchema = require("./useFormKitSchema
|
|
9
|
-
var _useInputEditor = require("./useInputEditor
|
|
7
|
+
var _useFormKitRepeater = require("./useFormKitRepeater");
|
|
8
|
+
var _useFormKitSchema = require("./useFormKitSchema");
|
|
9
|
+
var _useInputEditor = require("./useInputEditor");
|
|
10
10
|
function useInputEditorSchema() {
|
|
11
11
|
const {
|
|
12
12
|
addList,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useFormKitRepeater } from "./useFormKitRepeater.
|
|
2
|
-
import { useFormKitSchema } from "./useFormKitSchema.
|
|
3
|
-
import { useInputEditor } from "./useInputEditor.
|
|
1
|
+
import { useFormKitRepeater } from "./useFormKitRepeater.mjs";
|
|
2
|
+
import { useFormKitSchema } from "./useFormKitSchema.mjs";
|
|
3
|
+
import { useInputEditor } from "./useInputEditor.mjs";
|
|
4
4
|
export function useInputEditorSchema() {
|
|
5
5
|
const { addList, addListGroup } = useFormKitSchema();
|
|
6
6
|
const { addInsertButton, addGroupButtons } = useFormKitRepeater();
|
|
@@ -269,11 +269,10 @@ export function useInputEditorSchema() {
|
|
|
269
269
|
key: "schema_validation-label",
|
|
270
270
|
preserve: true
|
|
271
271
|
},
|
|
272
|
-
addList(
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
addListGroup([
|
|
272
|
+
addList("options", [
|
|
273
|
+
addInsertButton("Add Option"),
|
|
274
|
+
addListGroup(
|
|
275
|
+
[
|
|
277
276
|
{
|
|
278
277
|
$formkit: "primeInputText",
|
|
279
278
|
label: "Label",
|
|
@@ -287,17 +286,13 @@ export function useInputEditorSchema() {
|
|
|
287
286
|
outerClass: "col-4"
|
|
288
287
|
},
|
|
289
288
|
addGroupButtons()
|
|
290
|
-
]
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"prime",
|
|
298
|
-
[
|
|
299
|
-
addInsertButton("Add PrimeVue Attribute"),
|
|
300
|
-
addListGroup([
|
|
289
|
+
]
|
|
290
|
+
)
|
|
291
|
+
], true, "$get(selectButton).value === 'showOptions'", { key: "schema_options", preserve: true }),
|
|
292
|
+
addList("prime", [
|
|
293
|
+
addInsertButton("Add PrimeVue Attribute"),
|
|
294
|
+
addListGroup(
|
|
295
|
+
[
|
|
301
296
|
{
|
|
302
297
|
$formkit: "primeInputText",
|
|
303
298
|
label: "PrimeVue Key",
|
|
@@ -311,12 +306,9 @@ export function useInputEditorSchema() {
|
|
|
311
306
|
outerClass: "col-3"
|
|
312
307
|
},
|
|
313
308
|
addGroupButtons()
|
|
314
|
-
]
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
"$get(selectButton).value === 'showPrime'",
|
|
318
|
-
{ key: "schema_prime", preserve: true }
|
|
319
|
-
)
|
|
309
|
+
]
|
|
310
|
+
)
|
|
311
|
+
], true, "$get(selectButton).value === 'showPrime'", { key: "schema_prime", preserve: true })
|
|
320
312
|
];
|
|
321
313
|
}
|
|
322
314
|
return { editorSchema, primeInputOptions };
|
|
@@ -11,8 +11,10 @@ export function useOutputDuration() {
|
|
|
11
11
|
if (lowerDuration.includes("h")) {
|
|
12
12
|
hours = +(lowerDuration.split("h")[0]?.trim() || "0");
|
|
13
13
|
const remainder = lowerDuration.split("h")[1] || "";
|
|
14
|
-
if (remainder.includes("m"))
|
|
15
|
-
|
|
14
|
+
if (remainder.includes("m"))
|
|
15
|
+
minutes = +(remainder.split("m")[0]?.trim() || "0");
|
|
16
|
+
else if (/^\d+$/.test(remainder))
|
|
17
|
+
minutes = +remainder;
|
|
16
18
|
} else if (lowerDuration.includes("m")) {
|
|
17
19
|
minutes = +(lowerDuration.split("m")[0]?.trim() || "0");
|
|
18
20
|
} else if (/^\d+$/.test(lowerDuration)) {
|
|
@@ -25,7 +27,8 @@ export function useOutputDuration() {
|
|
|
25
27
|
const minutes = durationToMinutes(duration);
|
|
26
28
|
const hours = Math.trunc(minutes / 60);
|
|
27
29
|
const remainingMinutes = minutes % 60;
|
|
28
|
-
if (minutes === 0)
|
|
30
|
+
if (minutes === 0)
|
|
31
|
+
return "0";
|
|
29
32
|
return `${hours > 0 ? `${hours}h` : ""}${hours > 0 && remainingMinutes > 0 ? " " : ""}${remainingMinutes > 0 ? `${remainingMinutes}m` : ""}`;
|
|
30
33
|
}
|
|
31
34
|
return { durationToMinutes, formattedDuration };
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.primeOutputs = exports.primeInputs = void 0;
|
|
7
|
-
var _input = require("./input
|
|
8
|
-
var _output = require("./output
|
|
7
|
+
var _input = require("./input");
|
|
8
|
+
var _output = require("./output");
|
|
9
9
|
const primeInputs = exports.primeInputs = {
|
|
10
10
|
primeAutoComplete: _input.primeAutoCompleteDefinition,
|
|
11
11
|
primeInputText: _input.primeInputTextDefinition,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
primeToggleButtonDefinition,
|
|
22
22
|
primeToggleSwitchDefinition,
|
|
23
23
|
primeTreeSelectDefinition
|
|
24
|
-
} from "./input.
|
|
24
|
+
} from "./input.mjs";
|
|
25
25
|
import {
|
|
26
26
|
primeOutputBooleanDefinition,
|
|
27
27
|
primeOutputDateDefinition,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
primeOutputNumberDefinition,
|
|
32
32
|
primeOutputReferenceDefinition,
|
|
33
33
|
primeOutputTextDefinition
|
|
34
|
-
} from "./output.
|
|
34
|
+
} from "./output.mjs";
|
|
35
35
|
export const primeInputs = {
|
|
36
36
|
primeAutoComplete: primeAutoCompleteDefinition,
|
|
37
37
|
primeInputText: primeInputTextDefinition,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FormKitTypeDefinition } from
|
|
1
|
+
import type { FormKitTypeDefinition } from '@formkit/core';
|
|
2
2
|
export declare const primeAutoCompleteDefinition: FormKitTypeDefinition;
|
|
3
3
|
export declare const primeInputTextDefinition: FormKitTypeDefinition;
|
|
4
4
|
export declare const primeInputNumberDefinition: FormKitTypeDefinition;
|