@holo-js/forms 0.3.24 → 0.3.25

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.
@@ -229,7 +229,9 @@ function buildFormData(value, path = "", formData = new FormData()) {
229
229
  return formData;
230
230
  }
231
231
  if (Array.isArray(value)) {
232
- for (const item of value) buildFormData(item, `${path}[]`, formData);
232
+ for (const [index, item] of value.entries()) {
233
+ buildFormData(item, `${path}[${isPlainFormObject(item) || Array.isArray(item) ? index : ""}]`, formData);
234
+ }
233
235
  return formData;
234
236
  }
235
237
  if (isPlainFormObject(value)) {
@@ -781,7 +783,13 @@ function createFormClient(schemaDefinition, options = {}) {
781
783
  const action = options.action ?? liveForm?.action;
782
784
  const liveFormData = getActiveBrowserFormData(liveForm);
783
785
  const formData = liveFormData ?? buildFormData(state.values);
784
- const localSubmission = liveFormData ? await runValidationForInput(liveFormData) : await runValidation();
786
+ if (liveFormData) {
787
+ const nativeFields = new Set([...liveFormData.keys()].map((name) => name.replace(/\[\d+\]$/, "[]")));
788
+ for (const [name, value] of buildFormData(state.values)) {
789
+ if (!nativeFields.has(name)) formData.append(name, value);
790
+ }
791
+ }
792
+ const localSubmission = liveFormData ? await runValidationForInput(formData) : await runValidation();
785
793
  if (!localSubmission.valid) {
786
794
  return localSubmission;
787
795
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holo-js/forms",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "description": "Holo-JS Framework - forms-first validation and submission contracts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,11 +28,11 @@
28
28
  "test": "vitest --run && node --test --test-concurrency=3 ../../tests/forms-native-browser.mjs ../../tests/forms-native-packages.mjs"
29
29
  },
30
30
  "dependencies": {
31
- "@holo-js/kernel": "^0.3.24",
32
- "@holo-js/validation": "^0.3.24"
31
+ "@holo-js/kernel": "^0.3.25",
32
+ "@holo-js/validation": "^0.3.25"
33
33
  },
34
34
  "peerDependencies": {
35
- "@holo-js/security": "^0.3.24"
35
+ "@holo-js/security": "^0.3.25"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@holo-js/security": {