@sfxcode/formkit-primevue 1.9.12 → 1.11.0

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.
Files changed (38) hide show
  1. package/README.md +8 -7
  2. package/dist/components/PrimeCalendar.vue +1 -1
  3. package/dist/components/PrimeCascadeSelect.vue +1 -1
  4. package/dist/components/PrimeCheckbox.vue +1 -1
  5. package/dist/components/PrimeChips.vue +1 -1
  6. package/dist/components/PrimeColorPicker.vue +1 -1
  7. package/dist/components/PrimeDropdown.vue +1 -1
  8. package/dist/components/PrimeEditor.vue +1 -1
  9. package/dist/components/PrimeInputMask.vue +1 -1
  10. package/dist/components/PrimeInputNumber.vue +1 -1
  11. package/dist/components/PrimeInputOtp.vue +1 -1
  12. package/dist/components/PrimeInputSwitch.vue +1 -1
  13. package/dist/components/PrimeInputText.vue +2 -2
  14. package/dist/components/PrimeKnob.vue +1 -1
  15. package/dist/components/PrimeListbox.vue +1 -1
  16. package/dist/components/PrimeMultiSelect.vue +1 -1
  17. package/dist/components/PrimePassword.vue +1 -1
  18. package/dist/components/PrimeRadioButton.vue +1 -1
  19. package/dist/components/PrimeRating.vue +1 -1
  20. package/dist/components/PrimeSelectButton.vue +1 -1
  21. package/dist/components/PrimeSlider.vue +1 -1
  22. package/dist/components/PrimeTextarea.vue +1 -1
  23. package/dist/components/PrimeToggleButton.vue +1 -1
  24. package/dist/components/PrimeTreeSelect.vue +1 -1
  25. package/dist/components/PrimeTriStateCheckbox.vue +1 -1
  26. package/dist/composables/index.d.ts +2 -1
  27. package/dist/composables/index.js +8 -1
  28. package/dist/composables/index.mjs +3 -1
  29. package/dist/composables/useFormKitSchema.d.ts +5 -5
  30. package/dist/composables/useFormKitSchema.js +15 -10
  31. package/dist/composables/useFormKitSchema.mjs +15 -10
  32. package/dist/composables/useInputEditorSchema.d.ts +132 -0
  33. package/dist/composables/useInputEditorSchema.js +345 -0
  34. package/dist/composables/useInputEditorSchema.mjs +300 -0
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +6 -0
  37. package/dist/index.mjs +2 -1
  38. package/package.json +23 -23
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useInputEditorSchema = useInputEditorSchema;
7
+ var _useFormKitSchema = require("./useFormKitSchema");
8
+ function useInputEditorSchema() {
9
+ const {
10
+ addElement,
11
+ addList,
12
+ addListGroup,
13
+ addComponent
14
+ } = (0, _useFormKitSchema.useFormKitSchema)();
15
+ function addFlexElement(children) {
16
+ return addElement("div", children, {
17
+ style: "min-width: 40rem;display: flex;gap: 1rem;"
18
+ });
19
+ }
20
+ function addGroupButtons() {
21
+ const addButtonComponent = (onClick = "", label = "", icon = "", severity = "", render = "true", styleClass = "p-button-sm", style = "margin-left: 0.5rem;") => {
22
+ return addComponent("Button", {
23
+ onClick,
24
+ label,
25
+ icon,
26
+ class: styleClass,
27
+ style,
28
+ severity
29
+ }, render);
30
+ };
31
+ return addElement("div", [addButtonComponent("$removeNode($node, $index)", "", "pi pi-times", "danger"), addButtonComponent("$copyNode($node, $index)", "", "pi pi-plus"), addButtonComponent("$moveNodeUp($node, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"), addElement("span", [], {
32
+ style: "margin-left: 0.5rem;margin-right: 2.5rem;"
33
+ }, "$index == 0"), addButtonComponent("$moveNodeDown($node, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.value.length -1"), addElement("span", [], {
34
+ style: "margin-left: 0.5rem;margin-right: 2.5rem;"
35
+ }, "$index == $node.value.length -1")], {
36
+ style: "padding-top: 1.5rem;"
37
+ });
38
+ }
39
+ const primeInputWithOptionNames = ["CascadeSelect", "Dropdown", "Listbox", "MultiSelect", "RadioButton", "SelectButton", "TreeSelect"];
40
+ const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Calendar", "Checkbox", "Chips", "ColorPicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputSwitch", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "TriStateCheckbox"].sort();
41
+ function primeInputOptions(list) {
42
+ return list.map(name => {
43
+ return {
44
+ label: name,
45
+ value: `prime${name}`
46
+ };
47
+ });
48
+ }
49
+ const selectOptions = [{
50
+ label: "Base",
51
+ value: "showBasic"
52
+ }, {
53
+ label: "Display",
54
+ value: "showDisplay"
55
+ }, {
56
+ label: "Validation",
57
+ value: "showValidation"
58
+ }, {
59
+ label: "Options",
60
+ value: "showOptions"
61
+ }, {
62
+ label: "Prime",
63
+ value: "showPrime"
64
+ }];
65
+ const validationOptions = [{
66
+ label: "Blur",
67
+ value: "blur"
68
+ }, {
69
+ label: "Live",
70
+ value: "live"
71
+ }, {
72
+ label: "Dirty",
73
+ value: "dirty"
74
+ }, {
75
+ label: "Submit",
76
+ value: "submit"
77
+ }];
78
+ const positionOptions = [{
79
+ label: "Left",
80
+ value: "left"
81
+ }, {
82
+ label: "Right",
83
+ value: "right"
84
+ }];
85
+ function editorDataToSchema(data) {
86
+ const formkitInput = data?._dollar_formkit;
87
+ let tempData = {};
88
+ if (data.prime?.length > 0) {
89
+ const mapped = data.prime?.map(entry => [entry.prime_key, entry.prime_value]);
90
+ tempData = Object.assign(...mapped.map(([key, val]) => ({
91
+ [key]: val
92
+ })));
93
+ }
94
+ const readonlyValue = data.readonly ? true : void 0;
95
+ const disabledValue = data.disabled ? true : void 0;
96
+ const preserveValue = data.preserve ? true : void 0;
97
+ const defaultObject = {
98
+ readonly: readonlyValue,
99
+ disabled: disabledValue,
100
+ preserve: preserveValue
101
+ };
102
+ const undefinedObject = {
103
+ prime: void 0,
104
+ schemaResultFormKey: void 0,
105
+ _dollar_formkit: void 0,
106
+ slots: void 0,
107
+ selectButton: void 0
108
+ };
109
+ const useOptions = primeInputWithOptionNames.map(s => `prime${s}`).includes(formkitInput);
110
+ if (useOptions) return {
111
+ ...data,
112
+ $formkit: formkitInput,
113
+ ...tempData,
114
+ ...undefinedObject,
115
+ ...defaultObject,
116
+ optionLabel: "label",
117
+ optionValue: "value"
118
+ };else return {
119
+ ...data,
120
+ $formkit: formkitInput,
121
+ ...tempData,
122
+ ...undefinedObject,
123
+ ...defaultObject,
124
+ options: void 0
125
+ };
126
+ }
127
+ function editorDataToJson(data) {
128
+ return JSON.stringify(editorDataToSchema(data));
129
+ }
130
+ function editorDataToObject(data) {
131
+ return `{${Object.entries(JSON.parse(editorDataToJson(data))).map(([key, value]) => `${key}: '${value}'`).join()}}`;
132
+ }
133
+ function schemaToEditorData(schema) {
134
+ const formkitInput = schema?.$formkit;
135
+ return {
136
+ ...schema,
137
+ _dollar_formkit: formkitInput
138
+ };
139
+ }
140
+ function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
141
+ return [{
142
+ $formkit: "primeDropdown",
143
+ id: "inputSelection",
144
+ name: "_dollar_formkit",
145
+ label: "Prime Input",
146
+ value: "primeInputText",
147
+ optionLabel: "label",
148
+ optionValue: "value",
149
+ options: inputOptions,
150
+ key: "schema_inputSelection",
151
+ preserve: true
152
+ }, {
153
+ $formkit: "primeInputText",
154
+ name: "name",
155
+ label: "Field Name",
156
+ validation: "required",
157
+ validationVisibility: "live",
158
+ key: "schema_name",
159
+ preserve: true
160
+ }, {
161
+ $formkit: "primeSelectButton",
162
+ id: "selectButton",
163
+ name: "selectButton",
164
+ options: selectOptions,
165
+ optionLabel: "label",
166
+ optionValue: "value",
167
+ value: "showBasic",
168
+ allowEmpty: false,
169
+ key: "schema_selectButton",
170
+ preserve: true
171
+ }, {
172
+ $formkit: "primeInputText",
173
+ if: "$get(selectButton).value === 'showBasic'",
174
+ name: "label",
175
+ label: "Input Label",
176
+ key: "schema_label",
177
+ preserve: true
178
+ }, {
179
+ $formkit: "primeInputText",
180
+ if: "$get(selectButton).value === 'showBasic'",
181
+ name: "help",
182
+ label: "Input Help",
183
+ key: "schema_help",
184
+ preserve: true
185
+ }, {
186
+ $formkit: "primeInputText",
187
+ if: "$get(selectButton).value === 'showBasic'",
188
+ name: "id",
189
+ label: "Input ID",
190
+ key: "schema_id",
191
+ preserve: true
192
+ }, {
193
+ $formkit: "primeInputText",
194
+ if: "$get(selectButton).value === 'showBasic'",
195
+ name: "value",
196
+ label: "Input Value",
197
+ key: "schema_value",
198
+ preserve: true
199
+ }, {
200
+ $formkit: "primeInputText",
201
+ if: "$get(selectButton).value === 'showBasic'",
202
+ name: "key",
203
+ label: "Input Key",
204
+ key: "schema_key",
205
+ preserve: true
206
+ }, {
207
+ $formkit: "primeCheckbox",
208
+ if: "$get(selectButton).value === 'showBasic'",
209
+ name: "preserve",
210
+ label: "Input Preserve",
211
+ key: "schema_preserve",
212
+ value: false,
213
+ preserve: true
214
+ }, {
215
+ $formkit: "primeInputText",
216
+ if: "$get(selectButton).value === 'showValidation'",
217
+ name: "validation",
218
+ label: "Field Validation",
219
+ key: "schema_validation",
220
+ preserve: true
221
+ }, {
222
+ $formkit: "primeDropdown",
223
+ if: "$get(selectButton).value === 'showValidation'",
224
+ name: "validation-visibility",
225
+ label: "Field Validation Visibility",
226
+ value: "blur",
227
+ optionLabel: "label",
228
+ optionValue: "value",
229
+ options: validationOptions,
230
+ key: "schema_validation-visibility",
231
+ preserve: true
232
+ }, {
233
+ $formkit: "primeInputText",
234
+ if: "$get(selectButton).value === 'showValidation'",
235
+ name: "validation-label",
236
+ label: "Field Validation Label",
237
+ key: "schema_validation-label",
238
+ preserve: true
239
+ }, {
240
+ $formkit: "primeInputText",
241
+ if: "$get(selectButton).value === 'showDisplay'",
242
+ name: "tabindex",
243
+ label: "Tab Index",
244
+ key: "schema_tabindex",
245
+ preserve: true
246
+ }, {
247
+ $formkit: "primeInputText",
248
+ if: "$get(selectButton).value === 'showDisplay'",
249
+ name: "if",
250
+ label: "Should Render",
251
+ key: "schema_if",
252
+ preserve: true
253
+ }, {
254
+ $formkit: "primeInputText",
255
+ if: "$get(selectButton).value === 'showDisplay'",
256
+ name: "style",
257
+ label: "Input Style",
258
+ key: "schema_style",
259
+ preserve: true
260
+ }, {
261
+ $formkit: "primeInputText",
262
+ if: "$get(selectButton).value === 'showDisplay'",
263
+ name: "class",
264
+ label: "Input StyleClass",
265
+ key: "schema_class",
266
+ preserve: true
267
+ }, {
268
+ $formkit: "primeInputText",
269
+ if: "$get(selectButton).value === 'showDisplay'",
270
+ name: "icon",
271
+ label: "Icon",
272
+ key: "schema_icon",
273
+ preserve: true
274
+ }, {
275
+ $formkit: "primeDropdown",
276
+ if: "$get(selectButton).value === 'showDisplay'",
277
+ name: "iconPosition",
278
+ label: "Icon Position",
279
+ optionLabel: "label",
280
+ optionValue: "value",
281
+ options: positionOptions,
282
+ key: "schema_iconPosition",
283
+ preserve: true
284
+ }, {
285
+ $formkit: "primeCheckbox",
286
+ if: "$get(selectButton).value === 'showDisplay'",
287
+ name: "disabled",
288
+ label: "Input Disabled",
289
+ key: "schema_disabled",
290
+ value: false,
291
+ preserve: true
292
+ }, {
293
+ $formkit: "primeCheckbox",
294
+ if: "$get(selectButton).value === 'showDisplay'",
295
+ name: "readonly",
296
+ label: "Input Read Only",
297
+ key: "schema_readonly",
298
+ value: false,
299
+ preserve: true
300
+ }, addList("options", [addFlexElement([addComponent("Button", {
301
+ onClick: "$addNode($node)",
302
+ label: "Add Option",
303
+ class: "p-button-sm",
304
+ style: "margin-bottom: 2rem;",
305
+ icon: "pi pi-plus"
306
+ }, "$node.value.length == 0")]), addListGroup([addFlexElement([{
307
+ $formkit: "primeInputText",
308
+ label: "Label",
309
+ name: "label"
310
+ }, {
311
+ $formkit: "primeInputText",
312
+ label: "Value",
313
+ name: "value"
314
+ }, addGroupButtons()])])], true, "$get(selectButton).value === 'showOptions'", {
315
+ key: "schema_options",
316
+ preserve: true
317
+ }), addList("prime", [addFlexElement([addComponent("Button", {
318
+ onClick: "$addNode($node)",
319
+ label: "Add PrimeVue Attribute",
320
+ class: "p-button-sm",
321
+ style: "margin-bottom: 2rem;",
322
+ icon: "pi pi-plus"
323
+ }, "$node.value.length == 0")]), addListGroup([addFlexElement([{
324
+ $formkit: "primeInputText",
325
+ label: "PrimeVue Property",
326
+ name: "prime_key"
327
+ }, {
328
+ $formkit: "primeInputText",
329
+ label: "Value",
330
+ name: "prime_value"
331
+ }, addGroupButtons()])])], true, "$get(selectButton).value === 'showPrime'", {
332
+ key: "schema_prime",
333
+ preserve: true
334
+ })];
335
+ }
336
+ return {
337
+ editorSchema,
338
+ primeInputNames,
339
+ primeInputOptions,
340
+ editorDataToSchema,
341
+ editorDataToJson,
342
+ editorDataToCode: editorDataToObject,
343
+ schemaToEditorData
344
+ };
345
+ }
@@ -0,0 +1,300 @@
1
+ import { useFormKitSchema } from "./useFormKitSchema.mjs";
2
+ export function useInputEditorSchema() {
3
+ const { addElement, addList, addListGroup, addComponent } = useFormKitSchema();
4
+ function addFlexElement(children) {
5
+ return addElement("div", children, { style: "min-width: 40rem;display: flex;gap: 1rem;" });
6
+ }
7
+ function addGroupButtons() {
8
+ const addButtonComponent = (onClick = "", label = "", icon = "", severity = "", render = "true", styleClass = "p-button-sm", style = "margin-left: 0.5rem;") => {
9
+ return addComponent("Button", { onClick, label, icon, class: styleClass, style, severity }, render);
10
+ };
11
+ return addElement("div", [
12
+ addButtonComponent("$removeNode($node, $index)", "", "pi pi-times", "danger"),
13
+ addButtonComponent("$copyNode($node, $index)", "", "pi pi-plus"),
14
+ addButtonComponent("$moveNodeUp($node, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"),
15
+ addElement("span", [], { style: "margin-left: 0.5rem;margin-right: 2.5rem;" }, "$index == 0"),
16
+ addButtonComponent("$moveNodeDown($node, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.value.length -1"),
17
+ addElement("span", [], { style: "margin-left: 0.5rem;margin-right: 2.5rem;" }, "$index == $node.value.length -1")
18
+ ], { style: "padding-top: 1.5rem;" });
19
+ }
20
+ const primeInputWithOptionNames = ["CascadeSelect", "Dropdown", "Listbox", "MultiSelect", "RadioButton", "SelectButton", "TreeSelect"];
21
+ const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Calendar", "Checkbox", "Chips", "ColorPicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputSwitch", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "TriStateCheckbox"].sort();
22
+ function primeInputOptions(list) {
23
+ return list.map((name) => {
24
+ return { label: name, value: `prime${name}` };
25
+ });
26
+ }
27
+ const selectOptions = [
28
+ { label: "Base", value: "showBasic" },
29
+ { label: "Display", value: "showDisplay" },
30
+ { label: "Validation", value: "showValidation" },
31
+ { label: "Options", value: "showOptions" },
32
+ { label: "Prime", value: "showPrime" }
33
+ ];
34
+ const validationOptions = [
35
+ { label: "Blur", value: "blur" },
36
+ { label: "Live", value: "live" },
37
+ { label: "Dirty", value: "dirty" },
38
+ { label: "Submit", value: "submit" }
39
+ ];
40
+ const positionOptions = [
41
+ { label: "Left", value: "left" },
42
+ { label: "Right", value: "right" }
43
+ ];
44
+ function editorDataToSchema(data) {
45
+ const formkitInput = data?._dollar_formkit;
46
+ let tempData = {};
47
+ if (data.prime?.length > 0) {
48
+ const mapped = data.prime?.map((entry) => [entry.prime_key, entry.prime_value]);
49
+ tempData = Object.assign(...mapped.map(([key, val]) => ({ [key]: val })));
50
+ }
51
+ const readonlyValue = data.readonly ? true : void 0;
52
+ const disabledValue = data.disabled ? true : void 0;
53
+ const preserveValue = data.preserve ? true : void 0;
54
+ const defaultObject = { readonly: readonlyValue, disabled: disabledValue, preserve: preserveValue };
55
+ const undefinedObject = { prime: void 0, schemaResultFormKey: void 0, _dollar_formkit: void 0, slots: void 0, selectButton: void 0 };
56
+ const useOptions = primeInputWithOptionNames.map((s) => `prime${s}`).includes(formkitInput);
57
+ if (useOptions)
58
+ return { ...data, $formkit: formkitInput, ...tempData, ...undefinedObject, ...defaultObject, optionLabel: "label", optionValue: "value" };
59
+ else
60
+ return { ...data, $formkit: formkitInput, ...tempData, ...undefinedObject, ...defaultObject, options: void 0 };
61
+ }
62
+ function editorDataToJson(data) {
63
+ return JSON.stringify(editorDataToSchema(data));
64
+ }
65
+ function editorDataToObject(data) {
66
+ return `{${Object.entries(JSON.parse(editorDataToJson(data))).map(([key, value]) => `${key}: '${value}'`).join()}}`;
67
+ }
68
+ function schemaToEditorData(schema) {
69
+ const formkitInput = schema?.$formkit;
70
+ return { ...schema, _dollar_formkit: formkitInput };
71
+ }
72
+ function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
73
+ return [
74
+ {
75
+ $formkit: "primeDropdown",
76
+ id: "inputSelection",
77
+ name: "_dollar_formkit",
78
+ label: "Prime Input",
79
+ value: "primeInputText",
80
+ optionLabel: "label",
81
+ optionValue: "value",
82
+ options: inputOptions,
83
+ key: "schema_inputSelection",
84
+ preserve: true
85
+ },
86
+ {
87
+ $formkit: "primeInputText",
88
+ name: "name",
89
+ label: "Field Name",
90
+ validation: "required",
91
+ validationVisibility: "live",
92
+ key: "schema_name",
93
+ preserve: true
94
+ },
95
+ {
96
+ $formkit: "primeSelectButton",
97
+ id: "selectButton",
98
+ name: "selectButton",
99
+ options: selectOptions,
100
+ optionLabel: "label",
101
+ optionValue: "value",
102
+ value: "showBasic",
103
+ allowEmpty: false,
104
+ key: "schema_selectButton",
105
+ preserve: true
106
+ },
107
+ {
108
+ $formkit: "primeInputText",
109
+ if: "$get(selectButton).value === 'showBasic'",
110
+ name: "label",
111
+ label: "Input Label",
112
+ key: "schema_label",
113
+ preserve: true
114
+ },
115
+ {
116
+ $formkit: "primeInputText",
117
+ if: "$get(selectButton).value === 'showBasic'",
118
+ name: "help",
119
+ label: "Input Help",
120
+ key: "schema_help",
121
+ preserve: true
122
+ },
123
+ {
124
+ $formkit: "primeInputText",
125
+ if: "$get(selectButton).value === 'showBasic'",
126
+ name: "id",
127
+ label: "Input ID",
128
+ key: "schema_id",
129
+ preserve: true
130
+ },
131
+ {
132
+ $formkit: "primeInputText",
133
+ if: "$get(selectButton).value === 'showBasic'",
134
+ name: "value",
135
+ label: "Input Value",
136
+ key: "schema_value",
137
+ preserve: true
138
+ },
139
+ {
140
+ $formkit: "primeInputText",
141
+ if: "$get(selectButton).value === 'showBasic'",
142
+ name: "key",
143
+ label: "Input Key",
144
+ key: "schema_key",
145
+ preserve: true
146
+ },
147
+ {
148
+ $formkit: "primeCheckbox",
149
+ if: "$get(selectButton).value === 'showBasic'",
150
+ name: "preserve",
151
+ label: "Input Preserve",
152
+ key: "schema_preserve",
153
+ value: false,
154
+ preserve: true
155
+ },
156
+ {
157
+ $formkit: "primeInputText",
158
+ if: "$get(selectButton).value === 'showValidation'",
159
+ name: "validation",
160
+ label: "Field Validation",
161
+ key: "schema_validation",
162
+ preserve: true
163
+ },
164
+ {
165
+ $formkit: "primeDropdown",
166
+ if: "$get(selectButton).value === 'showValidation'",
167
+ name: "validation-visibility",
168
+ label: "Field Validation Visibility",
169
+ value: "blur",
170
+ optionLabel: "label",
171
+ optionValue: "value",
172
+ options: validationOptions,
173
+ key: "schema_validation-visibility",
174
+ preserve: true
175
+ },
176
+ {
177
+ $formkit: "primeInputText",
178
+ if: "$get(selectButton).value === 'showValidation'",
179
+ name: "validation-label",
180
+ label: "Field Validation Label",
181
+ key: "schema_validation-label",
182
+ preserve: true
183
+ },
184
+ {
185
+ $formkit: "primeInputText",
186
+ if: "$get(selectButton).value === 'showDisplay'",
187
+ name: "tabindex",
188
+ label: "Tab Index",
189
+ key: "schema_tabindex",
190
+ preserve: true
191
+ },
192
+ {
193
+ $formkit: "primeInputText",
194
+ if: "$get(selectButton).value === 'showDisplay'",
195
+ name: "if",
196
+ label: "Should Render",
197
+ key: "schema_if",
198
+ preserve: true
199
+ },
200
+ {
201
+ $formkit: "primeInputText",
202
+ if: "$get(selectButton).value === 'showDisplay'",
203
+ name: "style",
204
+ label: "Input Style",
205
+ key: "schema_style",
206
+ preserve: true
207
+ },
208
+ {
209
+ $formkit: "primeInputText",
210
+ if: "$get(selectButton).value === 'showDisplay'",
211
+ name: "class",
212
+ label: "Input StyleClass",
213
+ key: "schema_class",
214
+ preserve: true
215
+ },
216
+ {
217
+ $formkit: "primeInputText",
218
+ if: "$get(selectButton).value === 'showDisplay'",
219
+ name: "icon",
220
+ label: "Icon",
221
+ key: "schema_icon",
222
+ preserve: true
223
+ },
224
+ {
225
+ $formkit: "primeDropdown",
226
+ if: "$get(selectButton).value === 'showDisplay'",
227
+ name: "iconPosition",
228
+ label: "Icon Position",
229
+ optionLabel: "label",
230
+ optionValue: "value",
231
+ options: positionOptions,
232
+ key: "schema_iconPosition",
233
+ preserve: true
234
+ },
235
+ {
236
+ $formkit: "primeCheckbox",
237
+ if: "$get(selectButton).value === 'showDisplay'",
238
+ name: "disabled",
239
+ label: "Input Disabled",
240
+ key: "schema_disabled",
241
+ value: false,
242
+ preserve: true
243
+ },
244
+ {
245
+ $formkit: "primeCheckbox",
246
+ if: "$get(selectButton).value === 'showDisplay'",
247
+ name: "readonly",
248
+ label: "Input Read Only",
249
+ key: "schema_readonly",
250
+ value: false,
251
+ preserve: true
252
+ },
253
+ addList("options", [
254
+ addFlexElement([
255
+ addComponent("Button", { onClick: "$addNode($node)", label: "Add Option", class: "p-button-sm", style: "margin-bottom: 2rem;", icon: "pi pi-plus" }, "$node.value.length == 0")
256
+ ]),
257
+ addListGroup(
258
+ [
259
+ addFlexElement([
260
+ {
261
+ $formkit: "primeInputText",
262
+ label: "Label",
263
+ name: "label"
264
+ },
265
+ {
266
+ $formkit: "primeInputText",
267
+ label: "Value",
268
+ name: "value"
269
+ },
270
+ addGroupButtons()
271
+ ])
272
+ ]
273
+ )
274
+ ], true, "$get(selectButton).value === 'showOptions'", { key: "schema_options", preserve: true }),
275
+ addList("prime", [
276
+ addFlexElement([
277
+ addComponent("Button", { onClick: "$addNode($node)", label: "Add PrimeVue Attribute", class: "p-button-sm", style: "margin-bottom: 2rem;", icon: "pi pi-plus" }, "$node.value.length == 0")
278
+ ]),
279
+ addListGroup(
280
+ [
281
+ addFlexElement([
282
+ {
283
+ $formkit: "primeInputText",
284
+ label: "PrimeVue Property",
285
+ name: "prime_key"
286
+ },
287
+ {
288
+ $formkit: "primeInputText",
289
+ label: "Value",
290
+ name: "prime_value"
291
+ },
292
+ addGroupButtons()
293
+ ])
294
+ ]
295
+ )
296
+ ], true, "$get(selectButton).value === 'showPrime'", { key: "schema_prime", preserve: true })
297
+ ];
298
+ }
299
+ return { editorSchema, primeInputNames, primeInputOptions, editorDataToSchema, editorDataToJson, editorDataToCode: editorDataToObject, schemaToEditorData };
300
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { useFormKitSchema } from './composables';
1
+ import { useFormKitSchema, useInputEditorSchema } from './composables';
2
2
  import { primeInputs } from './definitions';
3
- export { useFormKitSchema, primeInputs, };
3
+ export { useFormKitSchema, useInputEditorSchema, primeInputs, };
package/dist/index.js CHANGED
@@ -15,5 +15,11 @@ Object.defineProperty(exports, "useFormKitSchema", {
15
15
  return _composables.useFormKitSchema;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "useInputEditorSchema", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _composables.useInputEditorSchema;
22
+ }
23
+ });
18
24
  var _composables = require("./composables");
19
25
  var _definitions = require("./definitions");
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { useFormKitSchema } from "./composables/index.mjs";
1
+ import { useFormKitSchema, useInputEditorSchema } from "./composables/index.mjs";
2
2
  import { primeInputs } from "./definitions/index.mjs";
3
3
  export {
4
4
  useFormKitSchema,
5
+ useInputEditorSchema,
5
6
  primeInputs
6
7
  };