@sfxcode/formkit-primevue 2.2.3 → 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.
@@ -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.2.3",
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"