@dynamicforms/vue-forms 0.18.0 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -662,6 +662,10 @@ export declare abstract class FieldBase<T = any, X extends object = Extras> {
662
662
  * List of errors. The array handed out is the one the element holds, and a validator writes into it in place,
663
663
  * so a transaction that is open takes the element into its record here: a rollback that put back everything
664
664
  * except the errors would leave a state the form never held.
665
+ *
666
+ * The array and its members are Vue proxies, not the raw instances a validator returned - `field.errors[0] ===
667
+ * myError` is `false` for the very error that produced it. Unwrapping here would lose the tracked read a
668
+ * template needs to re-render when a message behind a `Ref` changes; `toRaw()` compares identity instead.
665
669
  */
666
670
  get errors(): ValidationError[];
667
671
  set errors(newValue: ValidationError[]);
@@ -825,6 +829,8 @@ export declare abstract class FieldBase<T = any, X extends object = Extras> {
825
829
  /**
826
830
  * Records a child's new verdict in this element's tally. The child reports it as it settles, and the commit
827
831
  * settles the deepest element first, so the tally a container reads when its own turn comes is finished.
832
+ * The delta is applied here rather than recomputed by walking the members at commit, which would cost
833
+ * `O(members)` per container and turn a list fill back into the quadratic walk this tally exists to avoid.
828
834
  */
829
835
  protected childValidityChanged(nowValid: boolean): void;
830
836
  /**
@@ -999,6 +1005,7 @@ declare namespace Form {
999
1005
  GroupValueInput,
1000
1006
  Group,
1001
1007
  NullableGroup,
1008
+ isEqual,
1002
1009
  ListValue,
1003
1010
  List,
1004
1011
  NullableList,
@@ -1221,6 +1228,16 @@ declare class InAllowedValues<T = any> extends Validator {
1221
1228
 
1222
1229
  export declare function isCallableFunction(msg?: RenderContentRef): msg is RenderContentCallable;
1223
1230
 
1231
+ /**
1232
+ * Structural equality that treats a `FieldBase` as what it holds. `isEqual(fieldA, fieldB)` and
1233
+ * `isEqual(list.items, other.items)` compare values the way `isEqual(fieldA.value, fieldB.value)` already does,
1234
+ * without a call site having to unwrap every element by hand.
1235
+ *
1236
+ * Two `FieldBase` operands skip `isEqualWith`'s dispatch and compare `.value` directly — about 40% faster than
1237
+ * routing the same comparison through the customizer, measured comparing two single-field elements.
1238
+ */
1239
+ export declare function isEqual(a: unknown, b: unknown): boolean;
1240
+
1224
1241
  /**
1225
1242
  * Type guard to check if content is a custom component definition
1226
1243
  * @param msg - Content to check
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamicforms/vue-forms",
3
3
  "private": false,
4
- "version": "0.18.0",
4
+ "version": "1.1.0",
5
5
  "type": "module",
6
- "description": "A lightweight Vue.js library for form state management with built-in validation, conditional logic, nested structures, and a rich event system. UI-agnostic and TypeScript-first.",
7
- "author": "Jure Erzno\u017enik",
6
+ "description": "A Vue.js library for form state management with built-in validation, conditional logic, nested structures, and a rich event system. UI-agnostic and TypeScript-first.",
7
+ "author": "Jure Erznožnik",
8
8
  "files": [
9
9
  "dist/*"
10
10
  ],
@@ -92,5 +92,9 @@
92
92
  "vue-eslint-parser": "^10.4.1",
93
93
  "vue-markdown-render": "^2.3.0",
94
94
  "vue-tsc": "^2"
95
+ },
96
+ "allowScripts": {
97
+ "@parcel/watcher@2.5.6": true,
98
+ "unrs-resolver@1.12.2": true
95
99
  }
96
100
  }
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @dynamicforms/vue-forms
2
2
 
3
- A lightweight, reactive data entry forms library for Vue.js that handles form state management without dictating your
3
+ A reactive data entry forms library for Vue.js that handles form state management without dictating your
4
4
  UI components.
5
5
 
6
6
  ## Introduction
@@ -18,7 +18,6 @@ mechanism applies at every level of a nested form.
18
18
  - **Fields that react to each other**: Conditional visibility, enablement and values are declared as statements over other fields, and an action pipeline lets a handler intercept, transform or abort an event.
19
19
  - **Reactive & Type-Safe**: Every member of a field, group or list is a tracked read, and a group's value type is inferred from the fields it holds, nested structures included.
20
20
  - **Structural serialization**: A group's value is the shape of its fields, and `Group.createFromFormData()` turns a plain object back into a form.
21
- - **Lightweight**: `vue` (^3.5.2) is the only peer dependency and `lodash-es` the only runtime one.
22
21
 
23
22
  ## Features
24
23
 
@@ -42,7 +41,6 @@ mechanism applies at every level of a nested form.
42
41
  as a second type argument, checked by the compiler and read through `extra`
43
42
  - **Display modes**: control field visibility with different display modes (Full, Hidden, Invisible, Suppress)
44
43
  - **TypeScript support**: full type definitions, and a group's value type inferred from the fields it holds
45
- - **Lightweight**: `vue` (^3.5.2) is the only peer dependency and `lodash-es` the only runtime one
46
44
 
47
45
  ## Installation
48
46