@formisch/vue 0.7.4 → 0.7.5
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/index.js +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -551,6 +551,7 @@ function focus(form, config) {
|
|
|
551
551
|
function getAllErrors(form) {
|
|
552
552
|
let allErrors = null;
|
|
553
553
|
walkFieldStore(form[INTERNAL], (internalFieldStore) => {
|
|
554
|
+
if (internalFieldStore.kind === "array") internalFieldStore.items.value;
|
|
554
555
|
const errors = internalFieldStore.errors.value;
|
|
555
556
|
if (errors) if (allErrors) allErrors.push(...errors);
|
|
556
557
|
else allErrors = [...errors];
|
|
@@ -603,7 +604,15 @@ function insert(form, config) {
|
|
|
603
604
|
const newItems = [...items];
|
|
604
605
|
newItems.splice(insertIndex, 0, createId());
|
|
605
606
|
internalArrayStore.items.value = newItems;
|
|
606
|
-
for (let index = items.length; index > insertIndex; index--)
|
|
607
|
+
for (let index = items.length; index > insertIndex; index--) {
|
|
608
|
+
if (!internalArrayStore.children[index]) {
|
|
609
|
+
const path = JSON.parse(internalArrayStore.name);
|
|
610
|
+
internalArrayStore.children[index] = {};
|
|
611
|
+
path.push(index);
|
|
612
|
+
initializeFieldStore(internalArrayStore.children[index], internalArrayStore.schema.item, void 0, path);
|
|
613
|
+
}
|
|
614
|
+
copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
615
|
+
}
|
|
607
616
|
if (!internalArrayStore.children[insertIndex]) {
|
|
608
617
|
const path = JSON.parse(internalArrayStore.name);
|
|
609
618
|
internalArrayStore.children[insertIndex] = {};
|