@sfxcode/formkit-primevue 3.2.1 → 3.2.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.
@@ -13,11 +13,11 @@ function useFormKitRepeater() {
13
13
  } = (0, _useFormKitSchema.useFormKitSchema)();
14
14
  function addInsertButton(label = "Add", innerClass = "", outerClass = "", buttonClass = "p-button-sm", iconClass = "pi pi-plus") {
15
15
  return addElementsInOuterDiv([addComponent("Button", {
16
- onClick: "$addNode($node)",
16
+ onClick: "$addNode($node.parent)",
17
17
  label,
18
18
  class: buttonClass,
19
19
  icon: iconClass
20
- }, "$node.value.length == 0")], innerClass, outerClass);
20
+ }, "$node.parent.value.length == 0")], innerClass, outerClass);
21
21
  }
22
22
  function addListGroupFunctions(data, addNodeDefaultObject = {}) {
23
23
  const swapElements = (array, index1, index2) => {
@@ -60,11 +60,11 @@ function useFormKitRepeater() {
60
60
  severity
61
61
  }, render2);
62
62
  };
63
- return addElementsInOuterDiv([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", [], {
63
+ return addElementsInOuterDiv([addButtonComponent("$removeNode($node.parent, $index)", "", "pi pi-times", "danger"), addButtonComponent("$copyNode($node.parent, $index)", "", "pi pi-plus"), addButtonComponent("$moveNodeUp($node.parent, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"), addElement("span", [], {
64
64
  class: "p-space"
65
- }, "$index == 0"), addButtonComponent("$moveNodeDown($node, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.value.length -1"), addElement("span", [], {
65
+ }, "$index == 0"), addButtonComponent("$moveNodeDown($node.parent, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.parent.value.length -1"), addElement("span", [], {
66
66
  class: "p-space"
67
- }, "$index == $node.value.length -1")], `p-action-buttons ${innerClass}`, outerClass, label, help, render);
67
+ }, "$index == $node.parent.value.length -1")], `p-action-buttons ${innerClass}`, outerClass, label, help, render);
68
68
  }
69
69
  return {
70
70
  addInsertButton,
@@ -3,7 +3,7 @@ export function useFormKitRepeater() {
3
3
  const { addElement, addComponent, addElementsInOuterDiv } = useFormKitSchema();
4
4
  function addInsertButton(label = "Add", innerClass = "", outerClass = "", buttonClass = "p-button-sm", iconClass = "pi pi-plus") {
5
5
  return addElementsInOuterDiv([
6
- addComponent("Button", { onClick: "$addNode($node)", label, class: buttonClass, icon: iconClass }, "$node.value.length == 0")
6
+ addComponent("Button", { onClick: "$addNode($node.parent)", label, class: buttonClass, icon: iconClass }, "$node.parent.value.length == 0")
7
7
  ], innerClass, outerClass);
8
8
  }
9
9
  function addListGroupFunctions(data, addNodeDefaultObject = {}) {
@@ -42,12 +42,12 @@ export function useFormKitRepeater() {
42
42
  return addComponent("Button", { onClick, label: label2, icon, class: styleClass, severity }, render2);
43
43
  };
44
44
  return addElementsInOuterDiv([
45
- addButtonComponent("$removeNode($node, $index)", "", "pi pi-times", "danger"),
46
- addButtonComponent("$copyNode($node, $index)", "", "pi pi-plus"),
47
- addButtonComponent("$moveNodeUp($node, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"),
45
+ addButtonComponent("$removeNode($node.parent, $index)", "", "pi pi-times", "danger"),
46
+ addButtonComponent("$copyNode($node.parent, $index)", "", "pi pi-plus"),
47
+ addButtonComponent("$moveNodeUp($node.parent, $index)", "", "pi pi-arrow-up", "secondary", "$index != 0"),
48
48
  addElement("span", [], { class: "p-space" }, "$index == 0"),
49
- addButtonComponent("$moveNodeDown($node, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.value.length -1"),
50
- addElement("span", [], { class: "p-space" }, "$index == $node.value.length -1")
49
+ addButtonComponent("$moveNodeDown($node.parent, $index)", "", "pi pi-arrow-down", "secondary", "$index < $node.parent.value.length -1"),
50
+ addElement("span", [], { class: "p-space" }, "$index == $node.parent.value.length -1")
51
51
  ], `p-action-buttons ${innerClass}`, outerClass, label, help, render);
52
52
  }
53
53
  return { addInsertButton, addGroupButtons, addListGroupFunctions };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "3.2.1",
4
+ "version": "3.2.2",
5
5
  "packageManager": "pnpm@10.26.0+sha512.3b3f6c725ebe712506c0ab1ad4133cf86b1f4b687effce62a9b38b4d72e3954242e643190fc51fa1642949c735f403debd44f5cb0edd657abe63a8b6a7e1e402",
6
6
  "author": {
7
7
  "name": "Tom",