@formisch/solid 0.9.4 → 0.9.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/dev.js +10 -1
- package/dist/dev.jsx +10 -1
- package/dist/index.js +10 -1
- package/dist/index.jsx +10 -1
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -394,6 +394,7 @@ function focus(form, config) {
|
|
|
394
394
|
function getAllErrors(form) {
|
|
395
395
|
let allErrors = null;
|
|
396
396
|
walkFieldStore(form[INTERNAL], (internalFieldStore) => {
|
|
397
|
+
if (internalFieldStore.kind === "array") internalFieldStore.items.value;
|
|
397
398
|
const errors = internalFieldStore.errors.value;
|
|
398
399
|
if (errors) if (allErrors) allErrors.push(...errors);
|
|
399
400
|
else allErrors = [...errors];
|
|
@@ -439,7 +440,15 @@ function insert(form, config) {
|
|
|
439
440
|
const newItems = [...items];
|
|
440
441
|
newItems.splice(insertIndex, 0, createUniqueId());
|
|
441
442
|
internalArrayStore.items.value = newItems;
|
|
442
|
-
for (let index = items.length; index > insertIndex; index--)
|
|
443
|
+
for (let index = items.length; index > insertIndex; index--) {
|
|
444
|
+
if (!internalArrayStore.children[index]) {
|
|
445
|
+
const path = JSON.parse(internalArrayStore.name);
|
|
446
|
+
internalArrayStore.children[index] = {};
|
|
447
|
+
path.push(index);
|
|
448
|
+
initializeFieldStore(internalArrayStore.children[index], internalArrayStore.schema.item, void 0, path);
|
|
449
|
+
}
|
|
450
|
+
copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
451
|
+
}
|
|
443
452
|
if (!internalArrayStore.children[insertIndex]) {
|
|
444
453
|
const path = JSON.parse(internalArrayStore.name);
|
|
445
454
|
internalArrayStore.children[insertIndex] = {};
|
package/dist/dev.jsx
CHANGED
|
@@ -392,6 +392,7 @@ function focus(form, config) {
|
|
|
392
392
|
function getAllErrors(form) {
|
|
393
393
|
let allErrors = null;
|
|
394
394
|
walkFieldStore(form[INTERNAL], (internalFieldStore) => {
|
|
395
|
+
if (internalFieldStore.kind === "array") internalFieldStore.items.value;
|
|
395
396
|
const errors = internalFieldStore.errors.value;
|
|
396
397
|
if (errors) if (allErrors) allErrors.push(...errors);
|
|
397
398
|
else allErrors = [...errors];
|
|
@@ -437,7 +438,15 @@ function insert(form, config) {
|
|
|
437
438
|
const newItems = [...items];
|
|
438
439
|
newItems.splice(insertIndex, 0, createId());
|
|
439
440
|
internalArrayStore.items.value = newItems;
|
|
440
|
-
for (let index = items.length; index > insertIndex; index--)
|
|
441
|
+
for (let index = items.length; index > insertIndex; index--) {
|
|
442
|
+
if (!internalArrayStore.children[index]) {
|
|
443
|
+
const path = JSON.parse(internalArrayStore.name);
|
|
444
|
+
internalArrayStore.children[index] = {};
|
|
445
|
+
path.push(index);
|
|
446
|
+
initializeFieldStore(internalArrayStore.children[index], internalArrayStore.schema.item, void 0, path);
|
|
447
|
+
}
|
|
448
|
+
copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
449
|
+
}
|
|
441
450
|
if (!internalArrayStore.children[insertIndex]) {
|
|
442
451
|
const path = JSON.parse(internalArrayStore.name);
|
|
443
452
|
internalArrayStore.children[insertIndex] = {};
|
package/dist/index.js
CHANGED
|
@@ -394,6 +394,7 @@ function focus(form, config) {
|
|
|
394
394
|
function getAllErrors(form) {
|
|
395
395
|
let allErrors = null;
|
|
396
396
|
walkFieldStore(form[INTERNAL], (internalFieldStore) => {
|
|
397
|
+
if (internalFieldStore.kind === "array") internalFieldStore.items.value;
|
|
397
398
|
const errors = internalFieldStore.errors.value;
|
|
398
399
|
if (errors) if (allErrors) allErrors.push(...errors);
|
|
399
400
|
else allErrors = [...errors];
|
|
@@ -439,7 +440,15 @@ function insert(form, config) {
|
|
|
439
440
|
const newItems = [...items];
|
|
440
441
|
newItems.splice(insertIndex, 0, createUniqueId());
|
|
441
442
|
internalArrayStore.items.value = newItems;
|
|
442
|
-
for (let index = items.length; index > insertIndex; index--)
|
|
443
|
+
for (let index = items.length; index > insertIndex; index--) {
|
|
444
|
+
if (!internalArrayStore.children[index]) {
|
|
445
|
+
const path = JSON.parse(internalArrayStore.name);
|
|
446
|
+
internalArrayStore.children[index] = {};
|
|
447
|
+
path.push(index);
|
|
448
|
+
initializeFieldStore(internalArrayStore.children[index], internalArrayStore.schema.item, void 0, path);
|
|
449
|
+
}
|
|
450
|
+
copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
451
|
+
}
|
|
443
452
|
if (!internalArrayStore.children[insertIndex]) {
|
|
444
453
|
const path = JSON.parse(internalArrayStore.name);
|
|
445
454
|
internalArrayStore.children[insertIndex] = {};
|
package/dist/index.jsx
CHANGED
|
@@ -392,6 +392,7 @@ function focus(form, config) {
|
|
|
392
392
|
function getAllErrors(form) {
|
|
393
393
|
let allErrors = null;
|
|
394
394
|
walkFieldStore(form[INTERNAL], (internalFieldStore) => {
|
|
395
|
+
if (internalFieldStore.kind === "array") internalFieldStore.items.value;
|
|
395
396
|
const errors = internalFieldStore.errors.value;
|
|
396
397
|
if (errors) if (allErrors) allErrors.push(...errors);
|
|
397
398
|
else allErrors = [...errors];
|
|
@@ -437,7 +438,15 @@ function insert(form, config) {
|
|
|
437
438
|
const newItems = [...items];
|
|
438
439
|
newItems.splice(insertIndex, 0, createId());
|
|
439
440
|
internalArrayStore.items.value = newItems;
|
|
440
|
-
for (let index = items.length; index > insertIndex; index--)
|
|
441
|
+
for (let index = items.length; index > insertIndex; index--) {
|
|
442
|
+
if (!internalArrayStore.children[index]) {
|
|
443
|
+
const path = JSON.parse(internalArrayStore.name);
|
|
444
|
+
internalArrayStore.children[index] = {};
|
|
445
|
+
path.push(index);
|
|
446
|
+
initializeFieldStore(internalArrayStore.children[index], internalArrayStore.schema.item, void 0, path);
|
|
447
|
+
}
|
|
448
|
+
copyItemState(internalArrayStore.children[index - 1], internalArrayStore.children[index]);
|
|
449
|
+
}
|
|
441
450
|
if (!internalArrayStore.children[insertIndex]) {
|
|
442
451
|
const path = JSON.parse(internalArrayStore.name);
|
|
443
452
|
internalArrayStore.children[insertIndex] = {};
|