@sfxcode/formkit-primevue 1.9.1 → 1.9.3
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/README.md
CHANGED
|
@@ -30,7 +30,7 @@ import { primeInputs } from '@sfxcode/formkit-primevue'
|
|
|
30
30
|
|
|
31
31
|
### Basic Styling
|
|
32
32
|
|
|
33
|
-
Basic styling is provided with the
|
|
33
|
+
Basic styling is provided with the [formkit-primevue.scss](https://github.com/sfxcode/formkit-primevue/blob/main/src/sass/formkit-primevue.scss) file.
|
|
34
34
|
|
|
35
35
|
Features:
|
|
36
36
|
|
|
@@ -45,14 +45,14 @@ You can use it or take it as base for your own styling.
|
|
|
45
45
|
- All inputs are wrapped in a div with a **p-formkit** class
|
|
46
46
|
- Most Prime Components have access to class / styles attributes
|
|
47
47
|
- PT and PTOptions are available ([https://primevue.org/passthrough/](https://primevue.org/passthrough/))
|
|
48
|
-
- [Styling](https://formkit-primevue.netlify.app/
|
|
48
|
+
- [Styling](https://formkit-primevue.netlify.app/styling/base) and [PT](https://formkit-primevue.netlify.app/styling/passThrough) demo available
|
|
49
49
|
|
|
50
50
|
### Samples
|
|
51
51
|
|
|
52
52
|
Some samples for common tasks are available
|
|
53
53
|
|
|
54
|
-
- Repeater (with the help of the useFormKitSchema
|
|
55
|
-
- Grid
|
|
54
|
+
- [Repeater](https://formkit-primevue.netlify.app/samples/repeater) (with the help of the useFormKitSchema composable)
|
|
55
|
+
- [Grid](https://formkit-primevue.netlify.app/samples/grid)
|
|
56
56
|
|
|
57
57
|
## Showcases
|
|
58
58
|
|
|
@@ -31,7 +31,7 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<div :class="context.options_class" class="p-formkit">
|
|
34
|
-
<div v-for="option in context.options" :key="option.value" :class="context.option_class">
|
|
34
|
+
<div v-for="option in context.options" :key="option.value" :class="context.attrs.option_class">
|
|
35
35
|
<RadioButton
|
|
36
36
|
:id="context.id"
|
|
37
37
|
v-model="context._value"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare function useFormKitSchema(): {
|
|
2
2
|
addComponent: (component?: string, props?: object, render?: string) => object;
|
|
3
|
-
addElement: (element?: string, children?: any[], attrs?: object, render?: string) => {
|
|
3
|
+
addElement: (element?: string, children?: any[] | string, attrs?: object, render?: string) => {
|
|
4
4
|
$el: string;
|
|
5
5
|
if: string;
|
|
6
6
|
attrs: object;
|
|
7
|
-
children: any[];
|
|
7
|
+
children: string | any[];
|
|
8
8
|
};
|
|
9
9
|
addGroup: (name: string, children?: object[], render?: string) => {
|
|
10
10
|
$formkit: string;
|
|
@@ -53,27 +53,27 @@ function useFormKitSchema() {
|
|
|
53
53
|
array[index1] = array.splice(index2, 1, array[index1])[0];
|
|
54
54
|
return array;
|
|
55
55
|
};
|
|
56
|
-
data.addNode =
|
|
57
|
-
const newArray = [...
|
|
58
|
-
|
|
56
|
+
data.addNode = parentNode => () => {
|
|
57
|
+
const newArray = [...parentNode.value, addNodeDefaultObject];
|
|
58
|
+
parentNode.input(newArray, false);
|
|
59
59
|
};
|
|
60
|
-
data.removeNode = (
|
|
61
|
-
|
|
60
|
+
data.removeNode = (parentNode, index) => () => {
|
|
61
|
+
parentNode.input(parentNode._value.filter((_, i) => i !== index), false);
|
|
62
62
|
};
|
|
63
|
-
data.moveNodeUp = (
|
|
64
|
-
const array = [...
|
|
65
|
-
if (index > 0)
|
|
63
|
+
data.moveNodeUp = (parentNode, index) => () => {
|
|
64
|
+
const array = [...parentNode.value];
|
|
65
|
+
if (index > 0) parentNode.input(swapElements(array, index - 1, index), false);
|
|
66
66
|
};
|
|
67
|
-
data.moveNodeDown = (
|
|
68
|
-
const array = [...
|
|
69
|
-
if (index < array.length - 1)
|
|
67
|
+
data.moveNodeDown = (parentNode, index) => () => {
|
|
68
|
+
const array = [...parentNode.value];
|
|
69
|
+
if (index < array.length - 1) parentNode.input(swapElements(array, index, index + 1), false);
|
|
70
70
|
};
|
|
71
|
-
data.copyNode = (
|
|
72
|
-
const obj =
|
|
73
|
-
const newArray = [...
|
|
71
|
+
data.copyNode = (parentNode, index) => () => {
|
|
72
|
+
const obj = parentNode.value[index];
|
|
73
|
+
const newArray = [...parentNode.value, {
|
|
74
74
|
...obj
|
|
75
75
|
}];
|
|
76
|
-
|
|
76
|
+
parentNode.input(newArray, false);
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
return {
|
|
@@ -47,27 +47,27 @@ export function useFormKitSchema() {
|
|
|
47
47
|
array[index1] = array.splice(index2, 1, array[index1])[0];
|
|
48
48
|
return array;
|
|
49
49
|
};
|
|
50
|
-
data.addNode = (
|
|
51
|
-
const newArray = [...
|
|
52
|
-
|
|
50
|
+
data.addNode = (parentNode) => () => {
|
|
51
|
+
const newArray = [...parentNode.value, addNodeDefaultObject];
|
|
52
|
+
parentNode.input(newArray, false);
|
|
53
53
|
};
|
|
54
|
-
data.removeNode = (
|
|
55
|
-
|
|
54
|
+
data.removeNode = (parentNode, index) => () => {
|
|
55
|
+
parentNode.input(parentNode._value.filter((_, i) => i !== index), false);
|
|
56
56
|
};
|
|
57
|
-
data.moveNodeUp = (
|
|
58
|
-
const array = [...
|
|
57
|
+
data.moveNodeUp = (parentNode, index) => () => {
|
|
58
|
+
const array = [...parentNode.value];
|
|
59
59
|
if (index > 0)
|
|
60
|
-
|
|
60
|
+
parentNode.input(swapElements(array, index - 1, index), false);
|
|
61
61
|
};
|
|
62
|
-
data.moveNodeDown = (
|
|
63
|
-
const array = [...
|
|
62
|
+
data.moveNodeDown = (parentNode, index) => () => {
|
|
63
|
+
const array = [...parentNode.value];
|
|
64
64
|
if (index < array.length - 1)
|
|
65
|
-
|
|
65
|
+
parentNode.input(swapElements(array, index, index + 1), false);
|
|
66
66
|
};
|
|
67
|
-
data.copyNode = (
|
|
68
|
-
const obj =
|
|
69
|
-
const newArray = [...
|
|
70
|
-
|
|
67
|
+
data.copyNode = (parentNode, index) => () => {
|
|
68
|
+
const obj = parentNode.value[index];
|
|
69
|
+
const newArray = [...parentNode.value, { ...obj }];
|
|
70
|
+
parentNode.input(newArray, false);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
return { addComponent, addElement, addGroup, addList, addListGroup, addListGroupFunctions };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tom",
|
|
7
7
|
"email": "tom@sfxcode.com"
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
"vue": "^3.4.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@formkit/addons": "^1.
|
|
64
|
-
"@formkit/i18n": "^1.
|
|
65
|
-
"@formkit/vue": "^1.
|
|
63
|
+
"@formkit/addons": "^1.6.0",
|
|
64
|
+
"@formkit/i18n": "^1.6.0",
|
|
65
|
+
"@formkit/vue": "^1.6.0",
|
|
66
66
|
"primeicons": "^6.0.1",
|
|
67
67
|
"primevue": "^3.49.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@antfu/eslint-config": "2.8.0",
|
|
71
|
-
"@formkit/core": "^1.
|
|
71
|
+
"@formkit/core": "^1.6.0",
|
|
72
72
|
"@types/node": "^20.11.25",
|
|
73
73
|
"@unocss/preset-icons": "^0.58.5",
|
|
74
74
|
"@unocss/preset-uno": "0.58.5",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"unplugin-auto-import": "^0.17.5",
|
|
96
96
|
"unplugin-vue-components": "^0.26.0",
|
|
97
97
|
"vanilla-jsoneditor": "^0.22.0",
|
|
98
|
-
"vite": "^5.1.
|
|
98
|
+
"vite": "^5.1.6",
|
|
99
99
|
"vite-plugin-dts": "^3.7.3",
|
|
100
100
|
"vite-plugin-eslint": "^1.8.1",
|
|
101
101
|
"vite-plugin-pages": "^0.32.0",
|