@sfxcode/formkit-primevue 2.2.2 → 2.3.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.
- package/dist/composables/useInputEditorSchema.d.ts +7 -71
- package/dist/composables/useInputEditorSchema.js +40 -30
- package/dist/composables/useInputEditorSchema.mjs +129 -112
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +25 -0
- package/dist/plugins/index.mjs +20 -0
- package/package.json +6 -1
|
@@ -1,40 +1,15 @@
|
|
|
1
1
|
export declare function useInputEditorSchema(): {
|
|
2
2
|
editorSchema: (inputOptions?: any[]) => ({
|
|
3
|
+
$el: string;
|
|
4
|
+
if: string;
|
|
5
|
+
attrs: object;
|
|
6
|
+
children: string | any[];
|
|
7
|
+
} | {
|
|
3
8
|
$formkit: string;
|
|
4
9
|
if: string;
|
|
5
10
|
name: string;
|
|
6
11
|
dynamic: boolean;
|
|
7
12
|
children: object[];
|
|
8
|
-
} | {
|
|
9
|
-
$formkit: string;
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
optionLabel: string;
|
|
15
|
-
optionValue: string;
|
|
16
|
-
options: any[];
|
|
17
|
-
key: string;
|
|
18
|
-
preserve: boolean;
|
|
19
|
-
validation?: undefined;
|
|
20
|
-
validationVisibility?: undefined;
|
|
21
|
-
allowEmpty?: undefined;
|
|
22
|
-
if?: undefined;
|
|
23
|
-
} | {
|
|
24
|
-
$formkit: string;
|
|
25
|
-
name: string;
|
|
26
|
-
label: string;
|
|
27
|
-
validation: string;
|
|
28
|
-
validationVisibility: string;
|
|
29
|
-
key: string;
|
|
30
|
-
preserve: boolean;
|
|
31
|
-
id?: undefined;
|
|
32
|
-
value?: undefined;
|
|
33
|
-
optionLabel?: undefined;
|
|
34
|
-
optionValue?: undefined;
|
|
35
|
-
options?: undefined;
|
|
36
|
-
allowEmpty?: undefined;
|
|
37
|
-
if?: undefined;
|
|
38
13
|
} | {
|
|
39
14
|
$formkit: string;
|
|
40
15
|
id: string;
|
|
@@ -49,10 +24,8 @@ export declare function useInputEditorSchema(): {
|
|
|
49
24
|
allowEmpty: boolean;
|
|
50
25
|
key: string;
|
|
51
26
|
preserve: boolean;
|
|
52
|
-
label?: undefined;
|
|
53
|
-
validation?: undefined;
|
|
54
|
-
validationVisibility?: undefined;
|
|
55
27
|
if?: undefined;
|
|
28
|
+
label?: undefined;
|
|
56
29
|
} | {
|
|
57
30
|
$formkit: string;
|
|
58
31
|
if: string;
|
|
@@ -61,27 +34,10 @@ export declare function useInputEditorSchema(): {
|
|
|
61
34
|
key: string;
|
|
62
35
|
preserve: boolean;
|
|
63
36
|
id?: undefined;
|
|
64
|
-
value?: undefined;
|
|
65
|
-
optionLabel?: undefined;
|
|
66
|
-
optionValue?: undefined;
|
|
67
37
|
options?: undefined;
|
|
68
|
-
validation?: undefined;
|
|
69
|
-
validationVisibility?: undefined;
|
|
70
|
-
allowEmpty?: undefined;
|
|
71
|
-
} | {
|
|
72
|
-
$formkit: string;
|
|
73
|
-
if: string;
|
|
74
|
-
name: string;
|
|
75
|
-
label: string;
|
|
76
|
-
key: string;
|
|
77
|
-
value: boolean;
|
|
78
|
-
preserve: boolean;
|
|
79
|
-
id?: undefined;
|
|
80
38
|
optionLabel?: undefined;
|
|
81
39
|
optionValue?: undefined;
|
|
82
|
-
|
|
83
|
-
validation?: undefined;
|
|
84
|
-
validationVisibility?: undefined;
|
|
40
|
+
value?: undefined;
|
|
85
41
|
allowEmpty?: undefined;
|
|
86
42
|
} | {
|
|
87
43
|
$formkit: string;
|
|
@@ -98,26 +54,6 @@ export declare function useInputEditorSchema(): {
|
|
|
98
54
|
key: string;
|
|
99
55
|
preserve: boolean;
|
|
100
56
|
id?: undefined;
|
|
101
|
-
validation?: undefined;
|
|
102
|
-
validationVisibility?: undefined;
|
|
103
|
-
allowEmpty?: undefined;
|
|
104
|
-
} | {
|
|
105
|
-
$formkit: string;
|
|
106
|
-
if: string;
|
|
107
|
-
name: string;
|
|
108
|
-
label: string;
|
|
109
|
-
optionLabel: string;
|
|
110
|
-
optionValue: string;
|
|
111
|
-
options: {
|
|
112
|
-
label: string;
|
|
113
|
-
value: string;
|
|
114
|
-
}[];
|
|
115
|
-
key: string;
|
|
116
|
-
preserve: boolean;
|
|
117
|
-
id?: undefined;
|
|
118
|
-
value?: undefined;
|
|
119
|
-
validation?: undefined;
|
|
120
|
-
validationVisibility?: undefined;
|
|
121
57
|
allowEmpty?: undefined;
|
|
122
58
|
})[];
|
|
123
59
|
primeInputNames: string[];
|
|
@@ -14,7 +14,12 @@ function useInputEditorSchema() {
|
|
|
14
14
|
} = (0, _useFormKitSchema.useFormKitSchema)();
|
|
15
15
|
function addFlexElement(children) {
|
|
16
16
|
return addElement("div", children, {
|
|
17
|
-
style: "
|
|
17
|
+
style: "max-width: 40rem;display: flex;gap: 1rem;"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function addGridElement(children) {
|
|
21
|
+
return addElement("div", children, {
|
|
22
|
+
style: "display: grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap: 1rem;"
|
|
18
23
|
});
|
|
19
24
|
}
|
|
20
25
|
function addGroupButtons() {
|
|
@@ -36,8 +41,8 @@ function useInputEditorSchema() {
|
|
|
36
41
|
style: "padding-top: 1.5rem;"
|
|
37
42
|
});
|
|
38
43
|
}
|
|
39
|
-
const primeInputWithOptionNames = ["CascadeSelect", "
|
|
40
|
-
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "
|
|
44
|
+
const primeInputWithOptionNames = ["CascadeSelect", "Listbox", "MultiSelect", "RadioButton", "Select", "SelectButton", "TreeSelect"];
|
|
45
|
+
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Checkbox", "ColorPicker", "DatePicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "ToggleSwitch"].sort();
|
|
41
46
|
function primeInputOptions(list) {
|
|
42
47
|
return list.map(name => {
|
|
43
48
|
return {
|
|
@@ -86,7 +91,12 @@ function useInputEditorSchema() {
|
|
|
86
91
|
const formkitInput = data?._dollar_formkit;
|
|
87
92
|
let tempData = {};
|
|
88
93
|
if (data.prime?.length > 0) {
|
|
89
|
-
const mapped = data.prime?.map(entry =>
|
|
94
|
+
const mapped = data.prime?.map(entry => {
|
|
95
|
+
const key = entry.prime_key;
|
|
96
|
+
let value = entry.prime_value;
|
|
97
|
+
if (formkitInput === "primeInputOtp" && key === "length") value = +value;
|
|
98
|
+
return [key, value];
|
|
99
|
+
});
|
|
90
100
|
tempData = Object.assign(...mapped.map(([key, val]) => ({
|
|
91
101
|
[key]: val
|
|
92
102
|
})));
|
|
@@ -138,7 +148,7 @@ function useInputEditorSchema() {
|
|
|
138
148
|
};
|
|
139
149
|
}
|
|
140
150
|
function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
|
|
141
|
-
return [{
|
|
151
|
+
return [addGridElement([{
|
|
142
152
|
$formkit: "primeSelect",
|
|
143
153
|
id: "inputSelection",
|
|
144
154
|
name: "_dollar_formkit",
|
|
@@ -157,7 +167,7 @@ function useInputEditorSchema() {
|
|
|
157
167
|
validationVisibility: "live",
|
|
158
168
|
key: "schema_name",
|
|
159
169
|
preserve: true
|
|
160
|
-
}, {
|
|
170
|
+
}]), {
|
|
161
171
|
$formkit: "primeSelectButton",
|
|
162
172
|
id: "selectButton",
|
|
163
173
|
name: "selectButton",
|
|
@@ -183,6 +193,13 @@ function useInputEditorSchema() {
|
|
|
183
193
|
key: "schema_help",
|
|
184
194
|
preserve: true
|
|
185
195
|
}, {
|
|
196
|
+
$formkit: "primeInputText",
|
|
197
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
198
|
+
name: "value",
|
|
199
|
+
label: "Input Value",
|
|
200
|
+
key: "schema_value",
|
|
201
|
+
preserve: true
|
|
202
|
+
}, addGridElement([{
|
|
186
203
|
$formkit: "primeInputText",
|
|
187
204
|
if: "$get(selectButton).value === 'showBasic'",
|
|
188
205
|
name: "id",
|
|
@@ -192,16 +209,16 @@ function useInputEditorSchema() {
|
|
|
192
209
|
}, {
|
|
193
210
|
$formkit: "primeInputText",
|
|
194
211
|
if: "$get(selectButton).value === 'showBasic'",
|
|
195
|
-
name: "
|
|
196
|
-
label: "Input
|
|
197
|
-
key: "
|
|
212
|
+
name: "key",
|
|
213
|
+
label: "Input Key",
|
|
214
|
+
key: "schema_key",
|
|
198
215
|
preserve: true
|
|
199
216
|
}, {
|
|
200
217
|
$formkit: "primeInputText",
|
|
201
218
|
if: "$get(selectButton).value === 'showBasic'",
|
|
202
|
-
name: "
|
|
203
|
-
label: "
|
|
204
|
-
key: "
|
|
219
|
+
name: "tabindex",
|
|
220
|
+
label: "Tab Index",
|
|
221
|
+
key: "schema_tabindex",
|
|
205
222
|
preserve: true
|
|
206
223
|
}, {
|
|
207
224
|
$formkit: "primeCheckbox",
|
|
@@ -211,7 +228,7 @@ function useInputEditorSchema() {
|
|
|
211
228
|
key: "schema_preserve",
|
|
212
229
|
value: false,
|
|
213
230
|
preserve: true
|
|
214
|
-
}, {
|
|
231
|
+
}]), {
|
|
215
232
|
$formkit: "primeInputText",
|
|
216
233
|
if: "$get(selectButton).value === 'showValidation'",
|
|
217
234
|
name: "validation",
|
|
@@ -236,19 +253,12 @@ function useInputEditorSchema() {
|
|
|
236
253
|
label: "Field Validation Label",
|
|
237
254
|
key: "schema_validation-label",
|
|
238
255
|
preserve: true
|
|
239
|
-
}, {
|
|
256
|
+
}, addGridElement([{
|
|
240
257
|
$formkit: "primeInputText",
|
|
241
258
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
242
|
-
name: "
|
|
243
|
-
label: "
|
|
244
|
-
key: "
|
|
245
|
-
preserve: true
|
|
246
|
-
}, {
|
|
247
|
-
$formkit: "primeInputText",
|
|
248
|
-
if: "$get(selectButton).value === 'showDisplay'",
|
|
249
|
-
name: "if",
|
|
250
|
-
label: "Should Render",
|
|
251
|
-
key: "schema_if",
|
|
259
|
+
name: "class",
|
|
260
|
+
label: "Input StyleClass",
|
|
261
|
+
key: "schema_class",
|
|
252
262
|
preserve: true
|
|
253
263
|
}, {
|
|
254
264
|
$formkit: "primeInputText",
|
|
@@ -257,14 +267,14 @@ function useInputEditorSchema() {
|
|
|
257
267
|
label: "Input Style",
|
|
258
268
|
key: "schema_style",
|
|
259
269
|
preserve: true
|
|
260
|
-
}, {
|
|
270
|
+
}]), {
|
|
261
271
|
$formkit: "primeInputText",
|
|
262
272
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
263
|
-
name: "
|
|
264
|
-
label: "
|
|
265
|
-
key: "
|
|
273
|
+
name: "if",
|
|
274
|
+
label: "Should Render (if-Expression)",
|
|
275
|
+
key: "schema_if",
|
|
266
276
|
preserve: true
|
|
267
|
-
}, {
|
|
277
|
+
}, addGridElement([{
|
|
268
278
|
$formkit: "primeInputText",
|
|
269
279
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
270
280
|
name: "icon",
|
|
@@ -297,7 +307,7 @@ function useInputEditorSchema() {
|
|
|
297
307
|
key: "schema_readonly",
|
|
298
308
|
value: false,
|
|
299
309
|
preserve: true
|
|
300
|
-
}, addList("options", [addFlexElement([addComponent("Button", {
|
|
310
|
+
}]), addList("options", [addFlexElement([addComponent("Button", {
|
|
301
311
|
onClick: "$addNode($node)",
|
|
302
312
|
label: "Add Option",
|
|
303
313
|
class: "p-button-sm",
|
|
@@ -2,7 +2,10 @@ import { useFormKitSchema } from "./useFormKitSchema.mjs";
|
|
|
2
2
|
export function useInputEditorSchema() {
|
|
3
3
|
const { addElement, addList, addListGroup, addComponent } = useFormKitSchema();
|
|
4
4
|
function addFlexElement(children) {
|
|
5
|
-
return addElement("div", children, { style: "
|
|
5
|
+
return addElement("div", children, { style: "max-width: 40rem;display: flex;gap: 1rem;" });
|
|
6
|
+
}
|
|
7
|
+
function addGridElement(children) {
|
|
8
|
+
return addElement("div", children, { style: "display: grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap: 1rem;" });
|
|
6
9
|
}
|
|
7
10
|
function addGroupButtons() {
|
|
8
11
|
const addButtonComponent = (onClick = "", label = "", icon = "", severity = "", render = "true", styleClass = "p-button-sm", style = "margin-left: 0.5rem;") => {
|
|
@@ -17,8 +20,8 @@ export function useInputEditorSchema() {
|
|
|
17
20
|
addElement("span", [], { style: "margin-left: 0.5rem;margin-right: 2.5rem;" }, "$index == $node.value.length -1")
|
|
18
21
|
], { style: "padding-top: 1.5rem;" });
|
|
19
22
|
}
|
|
20
|
-
const primeInputWithOptionNames = ["CascadeSelect", "
|
|
21
|
-
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "
|
|
23
|
+
const primeInputWithOptionNames = ["CascadeSelect", "Listbox", "MultiSelect", "RadioButton", "Select", "SelectButton", "TreeSelect"];
|
|
24
|
+
const primeInputNames = [...primeInputWithOptionNames, "AutoComplete", "Checkbox", "ColorPicker", "DatePicker", "Editor", "InputMask", "InputNumber", "InputOtp", "InputText", "Knob", "Password", "Rating", "Slider", "Textarea", "ToggleButton", "ToggleSwitch"].sort();
|
|
22
25
|
function primeInputOptions(list) {
|
|
23
26
|
return list.map((name) => {
|
|
24
27
|
return { label: name, value: `prime${name}` };
|
|
@@ -45,7 +48,13 @@ export function useInputEditorSchema() {
|
|
|
45
48
|
const formkitInput = data?._dollar_formkit;
|
|
46
49
|
let tempData = {};
|
|
47
50
|
if (data.prime?.length > 0) {
|
|
48
|
-
const mapped = data.prime?.map((entry) =>
|
|
51
|
+
const mapped = data.prime?.map((entry) => {
|
|
52
|
+
const key = entry.prime_key;
|
|
53
|
+
let value = entry.prime_value;
|
|
54
|
+
if (formkitInput === "primeInputOtp" && key === "length")
|
|
55
|
+
value = +value;
|
|
56
|
+
return [key, value];
|
|
57
|
+
});
|
|
49
58
|
tempData = Object.assign(...mapped.map(([key, val]) => ({ [key]: val })));
|
|
50
59
|
}
|
|
51
60
|
const readonlyValue = data.readonly ? true : void 0;
|
|
@@ -71,27 +80,29 @@ export function useInputEditorSchema() {
|
|
|
71
80
|
}
|
|
72
81
|
function editorSchema(inputOptions = primeInputOptions(primeInputNames)) {
|
|
73
82
|
return [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
addGridElement([
|
|
84
|
+
{
|
|
85
|
+
$formkit: "primeSelect",
|
|
86
|
+
id: "inputSelection",
|
|
87
|
+
name: "_dollar_formkit",
|
|
88
|
+
label: "Prime Input",
|
|
89
|
+
value: "primeInputText",
|
|
90
|
+
optionLabel: "label",
|
|
91
|
+
optionValue: "value",
|
|
92
|
+
options: inputOptions,
|
|
93
|
+
key: "schema_inputSelection",
|
|
94
|
+
preserve: true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
$formkit: "primeInputText",
|
|
98
|
+
name: "name",
|
|
99
|
+
label: "Field Name",
|
|
100
|
+
validation: "required",
|
|
101
|
+
validationVisibility: "live",
|
|
102
|
+
key: "schema_name",
|
|
103
|
+
preserve: true
|
|
104
|
+
}
|
|
105
|
+
]),
|
|
95
106
|
{
|
|
96
107
|
$formkit: "primeSelectButton",
|
|
97
108
|
id: "selectButton",
|
|
@@ -120,14 +131,6 @@ export function useInputEditorSchema() {
|
|
|
120
131
|
key: "schema_help",
|
|
121
132
|
preserve: true
|
|
122
133
|
},
|
|
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
134
|
{
|
|
132
135
|
$formkit: "primeInputText",
|
|
133
136
|
if: "$get(selectButton).value === 'showBasic'",
|
|
@@ -136,23 +139,41 @@ export function useInputEditorSchema() {
|
|
|
136
139
|
key: "schema_value",
|
|
137
140
|
preserve: true
|
|
138
141
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
142
|
+
addGridElement([
|
|
143
|
+
{
|
|
144
|
+
$formkit: "primeInputText",
|
|
145
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
146
|
+
name: "id",
|
|
147
|
+
label: "Input ID",
|
|
148
|
+
key: "schema_id",
|
|
149
|
+
preserve: true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
$formkit: "primeInputText",
|
|
153
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
154
|
+
name: "key",
|
|
155
|
+
label: "Input Key",
|
|
156
|
+
key: "schema_key",
|
|
157
|
+
preserve: true
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
$formkit: "primeInputText",
|
|
161
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
162
|
+
name: "tabindex",
|
|
163
|
+
label: "Tab Index",
|
|
164
|
+
key: "schema_tabindex",
|
|
165
|
+
preserve: true
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
$formkit: "primeCheckbox",
|
|
169
|
+
if: "$get(selectButton).value === 'showBasic'",
|
|
170
|
+
name: "preserve",
|
|
171
|
+
label: "Input Preserve",
|
|
172
|
+
key: "schema_preserve",
|
|
173
|
+
value: false,
|
|
174
|
+
preserve: true
|
|
175
|
+
}
|
|
176
|
+
]),
|
|
156
177
|
{
|
|
157
178
|
$formkit: "primeInputText",
|
|
158
179
|
if: "$get(selectButton).value === 'showValidation'",
|
|
@@ -181,75 +202,71 @@ export function useInputEditorSchema() {
|
|
|
181
202
|
key: "schema_validation-label",
|
|
182
203
|
preserve: true
|
|
183
204
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
205
|
+
addGridElement([
|
|
206
|
+
{
|
|
207
|
+
$formkit: "primeInputText",
|
|
208
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
209
|
+
name: "class",
|
|
210
|
+
label: "Input StyleClass",
|
|
211
|
+
key: "schema_class",
|
|
212
|
+
preserve: true
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
$formkit: "primeInputText",
|
|
216
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
217
|
+
name: "style",
|
|
218
|
+
label: "Input Style",
|
|
219
|
+
key: "schema_style",
|
|
220
|
+
preserve: true
|
|
221
|
+
}
|
|
222
|
+
]),
|
|
192
223
|
{
|
|
193
224
|
$formkit: "primeInputText",
|
|
194
225
|
if: "$get(selectButton).value === 'showDisplay'",
|
|
195
226
|
name: "if",
|
|
196
|
-
label: "Should Render",
|
|
227
|
+
label: "Should Render (if-Expression)",
|
|
197
228
|
key: "schema_if",
|
|
198
229
|
preserve: true
|
|
199
230
|
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
},
|
|
231
|
+
addGridElement([
|
|
232
|
+
{
|
|
233
|
+
$formkit: "primeInputText",
|
|
234
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
235
|
+
name: "icon",
|
|
236
|
+
label: "Icon",
|
|
237
|
+
key: "schema_icon",
|
|
238
|
+
preserve: true
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
$formkit: "primeSelect",
|
|
242
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
243
|
+
name: "iconPosition",
|
|
244
|
+
label: "Icon Position",
|
|
245
|
+
optionLabel: "label",
|
|
246
|
+
optionValue: "value",
|
|
247
|
+
options: positionOptions,
|
|
248
|
+
key: "schema_iconPosition",
|
|
249
|
+
preserve: true
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
$formkit: "primeCheckbox",
|
|
253
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
254
|
+
name: "disabled",
|
|
255
|
+
label: "Input Disabled",
|
|
256
|
+
key: "schema_disabled",
|
|
257
|
+
value: false,
|
|
258
|
+
preserve: true
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
$formkit: "primeCheckbox",
|
|
262
|
+
if: "$get(selectButton).value === 'showDisplay'",
|
|
263
|
+
name: "readonly",
|
|
264
|
+
label: "Input Read Only",
|
|
265
|
+
key: "schema_readonly",
|
|
266
|
+
value: false,
|
|
267
|
+
preserve: true
|
|
268
|
+
}
|
|
269
|
+
]),
|
|
253
270
|
addList("options", [
|
|
254
271
|
addFlexElement([
|
|
255
272
|
addComponent("Button", { onClick: "$addNode($node)", label: "Add Option", class: "p-button-sm", style: "margin-bottom: 2rem;", icon: "pi pi-plus" }, "$node.value.length == 0")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addPrimeAsteriskPlugin(node: any): any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addPrimeAsteriskPlugin = addPrimeAsteriskPlugin;
|
|
7
|
+
function addPrimeAsteriskPlugin(node) {
|
|
8
|
+
if (!node.props.type.startsWith("prime")) return;
|
|
9
|
+
node.on("created", () => {
|
|
10
|
+
const schemaFn = node.props.definition.schema;
|
|
11
|
+
node.props.definition.schema = (sectionsSchema = {}) => {
|
|
12
|
+
sectionsSchema.label = {
|
|
13
|
+
children: ["$label", {
|
|
14
|
+
$el: "span",
|
|
15
|
+
if: "$state.required",
|
|
16
|
+
attrs: {
|
|
17
|
+
class: "p-formkit-asterisk"
|
|
18
|
+
},
|
|
19
|
+
children: ["*"]
|
|
20
|
+
}]
|
|
21
|
+
};
|
|
22
|
+
return schemaFn(sectionsSchema);
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function addPrimeAsteriskPlugin(node) {
|
|
2
|
+
if (!node.props.type.startsWith("prime"))
|
|
3
|
+
return;
|
|
4
|
+
node.on("created", () => {
|
|
5
|
+
const schemaFn = node.props.definition.schema;
|
|
6
|
+
node.props.definition.schema = (sectionsSchema = {}) => {
|
|
7
|
+
sectionsSchema.label = {
|
|
8
|
+
children: ["$label", {
|
|
9
|
+
$el: "span",
|
|
10
|
+
if: "$state.required",
|
|
11
|
+
attrs: {
|
|
12
|
+
class: "p-formkit-asterisk"
|
|
13
|
+
},
|
|
14
|
+
children: ["*"]
|
|
15
|
+
}]
|
|
16
|
+
};
|
|
17
|
+
return schemaFn(sectionsSchema);
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom",
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
"import": "./dist/definitions/index.mjs",
|
|
35
35
|
"require": "./dist/definitions/index.js"
|
|
36
36
|
},
|
|
37
|
+
"./plugins": {
|
|
38
|
+
"types": "./dist/plugins/index.d.ts",
|
|
39
|
+
"import": "./dist/plugins/index.mjs",
|
|
40
|
+
"require": "./dist/plugins/index.js"
|
|
41
|
+
},
|
|
37
42
|
"./dist/sass/formkit-primevue.scss": {
|
|
38
43
|
"import": "./dist/sass/formkit-primevue.scss",
|
|
39
44
|
"require": "./dist/sass/formkit-primevue.scss"
|