@sfxcode/formkit-primevue 2.3.1 → 2.3.2
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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 sfxcode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -7,10 +7,14 @@ 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
|
+
function generateSchemaItemId() {
|
|
11
|
+
return `id-${Math.random().toString(36).substring(2, 15)}`;
|
|
12
|
+
}
|
|
10
13
|
function editorDataToSchema(data) {
|
|
14
|
+
if (!data) return {};
|
|
11
15
|
const formkitInput = data?._dollar_formkit;
|
|
12
16
|
let tempData = {};
|
|
13
|
-
if (data.prime?.length > 0) {
|
|
17
|
+
if (data.prime && data.prime?.length > 0) {
|
|
14
18
|
const mapped = data.prime?.map(entry => {
|
|
15
19
|
const key = entry.prime_key;
|
|
16
20
|
let value = entry.prime_value;
|
|
@@ -96,6 +100,7 @@ function useInputEditor() {
|
|
|
96
100
|
}
|
|
97
101
|
return {
|
|
98
102
|
primeInputNames,
|
|
103
|
+
generateSchemaItemId,
|
|
99
104
|
editorDataToSchema,
|
|
100
105
|
editorDataToJson,
|
|
101
106
|
editorDataToCode: editorDataToObject,
|
|
@@ -1,10 +1,15 @@
|
|
|
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
|
+
function generateSchemaItemId() {
|
|
5
|
+
return `id-${Math.random().toString(36).substring(2, 15)}`;
|
|
6
|
+
}
|
|
4
7
|
function editorDataToSchema(data) {
|
|
8
|
+
if (!data)
|
|
9
|
+
return {};
|
|
5
10
|
const formkitInput = data?._dollar_formkit;
|
|
6
11
|
let tempData = {};
|
|
7
|
-
if (data.prime?.length > 0) {
|
|
12
|
+
if (data.prime && data.prime?.length > 0) {
|
|
8
13
|
const mapped = data.prime?.map((entry) => {
|
|
9
14
|
const key = entry.prime_key;
|
|
10
15
|
let value = entry.prime_value;
|
|
@@ -59,5 +64,5 @@ export function useInputEditor() {
|
|
|
59
64
|
const formkitInput = schema?.$formkit;
|
|
60
65
|
return { ...schema, _dollar_formkit: formkitInput };
|
|
61
66
|
}
|
|
62
|
-
return { primeInputNames, editorDataToSchema, editorDataToJson, editorDataToCode: editorDataToObject, schemaToEditorData };
|
|
67
|
+
return { primeInputNames, generateSchemaItemId, editorDataToSchema, editorDataToJson, editorDataToCode: editorDataToObject, schemaToEditorData };
|
|
63
68
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.2",
|
|
5
5
|
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom",
|
|
@@ -88,21 +88,22 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@formkit/addons": "^1.6.5",
|
|
91
|
+
"@formkit/drag-and-drop": "^0.1.6",
|
|
91
92
|
"@formkit/i18n": "^1.6.5",
|
|
92
93
|
"@formkit/vue": "^1.6.5",
|
|
93
94
|
"primeicons": "^7.0.0",
|
|
94
|
-
"primevue": "4.0.
|
|
95
|
+
"primevue": "4.0.1"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
|
97
|
-
"@antfu/eslint-config": "2.23.
|
|
98
|
+
"@antfu/eslint-config": "2.23.2",
|
|
98
99
|
"@formkit/core": "^1.6.5",
|
|
99
|
-
"@primevue/themes": "4.0.
|
|
100
|
+
"@primevue/themes": "4.0.1",
|
|
100
101
|
"@types/node": "^20.14.11",
|
|
101
102
|
"@unocss/preset-icons": "0.61.5",
|
|
102
103
|
"@unocss/preset-uno": "0.61.5",
|
|
103
104
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
104
|
-
"@vitest/coverage-v8": "^2.0.
|
|
105
|
-
"@vitest/ui": "^2.0.
|
|
105
|
+
"@vitest/coverage-v8": "^2.0.4",
|
|
106
|
+
"@vitest/ui": "^2.0.4",
|
|
106
107
|
"@vue/compiler-sfc": "^3.4.33",
|
|
107
108
|
"@vue/server-renderer": "^3.4.33",
|
|
108
109
|
"@vue/test-utils": "^2.4.6",
|
|
@@ -119,7 +120,7 @@
|
|
|
119
120
|
"json-editor-vue": "^0.15.1",
|
|
120
121
|
"mkdist": "^1.5.4",
|
|
121
122
|
"quill": "^2.0.2",
|
|
122
|
-
"sass": "^1.
|
|
123
|
+
"sass": "^1.76.0",
|
|
123
124
|
"tslib": "^2.6.3",
|
|
124
125
|
"typescript": "^5.5.3",
|
|
125
126
|
"unbuild": "2.0.0",
|
|
@@ -133,10 +134,10 @@
|
|
|
133
134
|
"vite-plugin-pages": "^0.32.3",
|
|
134
135
|
"vite-ssg": "^0.23.8",
|
|
135
136
|
"vitepress": "1.3.1",
|
|
136
|
-
"vitest": "^2.0.
|
|
137
|
+
"vitest": "^2.0.4",
|
|
137
138
|
"vue": "^3.4.33",
|
|
138
139
|
"vue-demi": "^0.14.8",
|
|
139
140
|
"vue-router": "^4.4.0",
|
|
140
|
-
"vue-tsc": "^2.0.
|
|
141
|
+
"vue-tsc": "^2.0.28"
|
|
141
142
|
}
|
|
142
143
|
}
|