@reformer/core 1.1.0 → 2.0.0-beta.11

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.
Files changed (221) hide show
  1. package/dist/behaviors/compute-from.d.ts +2 -0
  2. package/dist/behaviors/compute-from.js +31 -0
  3. package/dist/behaviors/copy-from.d.ts +2 -0
  4. package/dist/behaviors/copy-from.js +29 -0
  5. package/dist/behaviors/enable-when.d.ts +2 -0
  6. package/dist/behaviors/enable-when.js +25 -0
  7. package/dist/behaviors/reset-when.d.ts +2 -0
  8. package/dist/behaviors/reset-when.js +24 -0
  9. package/dist/behaviors/revalidate-when.d.ts +2 -0
  10. package/dist/behaviors/revalidate-when.js +18 -0
  11. package/dist/behaviors/sync-fields.d.ts +2 -0
  12. package/dist/behaviors/sync-fields.js +41 -0
  13. package/dist/behaviors/transform-value.d.ts +2 -0
  14. package/dist/behaviors/transform-value.js +45 -0
  15. package/dist/behaviors/watch-field.d.ts +2 -0
  16. package/dist/behaviors/watch-field.js +21 -0
  17. package/dist/behaviors.d.ts +6 -2
  18. package/dist/behaviors.js +27 -228
  19. package/dist/core/behavior/behavior-context.d.ts +32 -14
  20. package/dist/core/behavior/behavior-registry.d.ts +15 -27
  21. package/dist/core/behavior/behaviors/compute-from.d.ts +50 -21
  22. package/dist/core/behavior/behaviors/copy-from.d.ts +39 -14
  23. package/dist/core/behavior/behaviors/enable-when.d.ts +88 -19
  24. package/dist/core/behavior/behaviors/reset-when.d.ts +31 -18
  25. package/dist/core/behavior/behaviors/revalidate-when.d.ts +40 -17
  26. package/dist/core/behavior/behaviors/sync-fields.d.ts +34 -14
  27. package/dist/core/behavior/behaviors/transform-value.d.ts +116 -44
  28. package/dist/core/behavior/behaviors/watch-field.d.ts +66 -21
  29. package/dist/core/behavior/compose-behavior.d.ts +2 -12
  30. package/dist/core/behavior/index.d.ts +0 -1
  31. package/dist/core/behavior/types.d.ts +2 -8
  32. package/dist/core/factories/node-factory.d.ts +6 -29
  33. package/dist/core/nodes/array-node.d.ts +42 -22
  34. package/dist/core/nodes/field-node.d.ts +51 -26
  35. package/dist/core/nodes/form-node.d.ts +18 -20
  36. package/dist/core/nodes/group-node.d.ts +37 -212
  37. package/dist/core/types/deep-schema.d.ts +2 -12
  38. package/dist/core/types/field-path.d.ts +1 -1
  39. package/dist/core/types/form-context.d.ts +36 -30
  40. package/dist/core/types/{group-node-proxy.d.ts → form-proxy.d.ts} +12 -42
  41. package/dist/core/types/index.d.ts +52 -6
  42. package/dist/core/types/validation-schema.d.ts +3 -12
  43. package/dist/core/utils/abstract-registry.d.ts +74 -0
  44. package/dist/core/utils/aggregate-signals.d.ts +71 -0
  45. package/dist/core/utils/create-form.d.ts +3 -20
  46. package/dist/core/utils/error-handler.d.ts +1 -18
  47. package/dist/core/utils/field-path-navigator.d.ts +1 -1
  48. package/dist/core/{validation → utils}/field-path.d.ts +23 -6
  49. package/dist/core/utils/form-observer.d.ts +176 -0
  50. package/dist/core/utils/form-proxy-builder.d.ts +25 -0
  51. package/dist/core/utils/form-submitter.d.ts +121 -0
  52. package/dist/core/utils/index.d.ts +10 -2
  53. package/dist/core/utils/registry-helpers.d.ts +0 -7
  54. package/dist/core/utils/safe-effect.d.ts +73 -0
  55. package/dist/core/utils/status-machine.d.ts +153 -0
  56. package/dist/core/utils/type-guards.d.ts +5 -23
  57. package/dist/core/utils/unique-id.d.ts +53 -0
  58. package/dist/core/validation/core/apply-when.d.ts +3 -9
  59. package/dist/core/validation/core/apply.d.ts +2 -13
  60. package/dist/core/validation/core/validate-async.d.ts +2 -8
  61. package/dist/core/validation/core/validate-tree.d.ts +10 -10
  62. package/dist/core/validation/core/validate.d.ts +1 -7
  63. package/dist/core/validation/index.d.ts +8 -2
  64. package/dist/core/validation/validate-form.d.ts +1 -38
  65. package/dist/core/validation/validation-applicator.d.ts +2 -21
  66. package/dist/core/validation/validation-context.d.ts +67 -28
  67. package/dist/core/validation/validation-registry.d.ts +11 -25
  68. package/dist/core/validation/validators/array-validators.d.ts +2 -12
  69. package/dist/core/validation/validators/date-utils.d.ts +26 -0
  70. package/dist/core/validation/validators/email.d.ts +2 -9
  71. package/dist/core/validation/validators/future-date.d.ts +35 -0
  72. package/dist/core/validation/validators/index.d.ts +7 -1
  73. package/dist/core/validation/validators/is-date.d.ts +36 -0
  74. package/dist/core/validation/validators/max-age.d.ts +36 -0
  75. package/dist/core/validation/validators/max-date.d.ts +36 -0
  76. package/dist/core/validation/validators/max-length.d.ts +3 -10
  77. package/dist/core/validation/validators/max.d.ts +3 -10
  78. package/dist/core/validation/validators/min-age.d.ts +36 -0
  79. package/dist/core/validation/validators/min-date.d.ts +36 -0
  80. package/dist/core/validation/validators/min-length.d.ts +3 -10
  81. package/dist/core/validation/validators/min.d.ts +3 -10
  82. package/dist/core/validation/validators/number.d.ts +2 -9
  83. package/dist/core/validation/validators/past-date.d.ts +35 -0
  84. package/dist/core/validation/validators/pattern.d.ts +2 -9
  85. package/dist/core/validation/validators/phone.d.ts +2 -9
  86. package/dist/core/validation/validators/required.d.ts +2 -9
  87. package/dist/core/validation/validators/url.d.ts +2 -9
  88. package/dist/date-utils-xUWFslTj.js +29 -0
  89. package/dist/field-path-DuKdGcIE.js +66 -0
  90. package/dist/hooks/types.d.ts +328 -0
  91. package/dist/hooks/useArrayLength.d.ts +31 -0
  92. package/dist/hooks/useFormControl.d.ts +15 -39
  93. package/dist/hooks/useFormControlValue.d.ts +167 -0
  94. package/dist/hooks/useHiddenCondition.d.ts +25 -0
  95. package/dist/hooks/useSignalSubscription.d.ts +17 -0
  96. package/dist/index-D25LsbRm.js +73 -0
  97. package/dist/index.d.ts +8 -1
  98. package/dist/index.js +3271 -8
  99. package/dist/registry-helpers-Bv_BJ1s-.js +615 -0
  100. package/dist/safe-effect-Dh8uw81c.js +20 -0
  101. package/dist/validate-C3XiA_zf.js +10 -0
  102. package/dist/validators/email.d.ts +2 -0
  103. package/dist/validators/email.js +13 -0
  104. package/dist/validators/future-date.d.ts +2 -0
  105. package/dist/validators/future-date.js +20 -0
  106. package/dist/validators/is-date.d.ts +2 -0
  107. package/dist/validators/is-date.js +12 -0
  108. package/dist/validators/max-age.d.ts +2 -0
  109. package/dist/validators/max-age.js +20 -0
  110. package/dist/validators/max-date.d.ts +2 -0
  111. package/dist/validators/max-date.js +20 -0
  112. package/dist/validators/max-length.d.ts +2 -0
  113. package/dist/validators/max-length.js +11 -0
  114. package/dist/validators/max.d.ts +2 -0
  115. package/dist/validators/max.js +11 -0
  116. package/dist/validators/min-age.d.ts +2 -0
  117. package/dist/validators/min-age.js +20 -0
  118. package/dist/validators/min-date.d.ts +2 -0
  119. package/dist/validators/min-date.js +20 -0
  120. package/dist/validators/min-length.d.ts +2 -0
  121. package/dist/validators/min-length.js +11 -0
  122. package/dist/validators/min.d.ts +2 -0
  123. package/dist/validators/min.js +11 -0
  124. package/dist/validators/number.d.ts +2 -0
  125. package/dist/validators/number.js +35 -0
  126. package/dist/validators/past-date.d.ts +2 -0
  127. package/dist/validators/past-date.js +20 -0
  128. package/dist/validators/pattern.d.ts +2 -0
  129. package/dist/validators/pattern.js +11 -0
  130. package/dist/validators/phone.d.ts +2 -0
  131. package/dist/validators/phone.js +35 -0
  132. package/dist/validators/required.d.ts +2 -0
  133. package/dist/validators/required.js +15 -0
  134. package/dist/validators/url.d.ts +2 -0
  135. package/dist/validators/url.js +19 -0
  136. package/dist/validators-BGsNOgT1.js +207 -0
  137. package/dist/validators.d.ts +6 -2
  138. package/dist/validators.js +54 -296
  139. package/llms.txt +8887 -59
  140. package/package.json +87 -8
  141. package/dist/core/behavior/behavior-applicator.d.ts +0 -71
  142. package/dist/core/behavior/behavior-applicator.js +0 -92
  143. package/dist/core/behavior/behavior-context.js +0 -38
  144. package/dist/core/behavior/behavior-registry.js +0 -198
  145. package/dist/core/behavior/behaviors/compute-from.js +0 -84
  146. package/dist/core/behavior/behaviors/copy-from.js +0 -64
  147. package/dist/core/behavior/behaviors/enable-when.js +0 -81
  148. package/dist/core/behavior/behaviors/index.js +0 -11
  149. package/dist/core/behavior/behaviors/reset-when.js +0 -63
  150. package/dist/core/behavior/behaviors/revalidate-when.js +0 -51
  151. package/dist/core/behavior/behaviors/sync-fields.js +0 -66
  152. package/dist/core/behavior/behaviors/transform-value.js +0 -110
  153. package/dist/core/behavior/behaviors/watch-field.js +0 -56
  154. package/dist/core/behavior/compose-behavior.js +0 -166
  155. package/dist/core/behavior/create-field-path.d.ts +0 -20
  156. package/dist/core/behavior/create-field-path.js +0 -69
  157. package/dist/core/behavior/index.js +0 -17
  158. package/dist/core/behavior/types.js +0 -7
  159. package/dist/core/context/form-context-impl.d.ts +0 -29
  160. package/dist/core/context/form-context-impl.js +0 -37
  161. package/dist/core/factories/index.js +0 -6
  162. package/dist/core/factories/node-factory.js +0 -281
  163. package/dist/core/nodes/array-node.js +0 -534
  164. package/dist/core/nodes/field-node.js +0 -510
  165. package/dist/core/nodes/form-node.js +0 -343
  166. package/dist/core/nodes/group-node/field-registry.d.ts +0 -191
  167. package/dist/core/nodes/group-node/field-registry.js +0 -215
  168. package/dist/core/nodes/group-node/index.d.ts +0 -11
  169. package/dist/core/nodes/group-node/index.js +0 -11
  170. package/dist/core/nodes/group-node/proxy-builder.d.ts +0 -71
  171. package/dist/core/nodes/group-node/proxy-builder.js +0 -161
  172. package/dist/core/nodes/group-node/state-manager.d.ts +0 -184
  173. package/dist/core/nodes/group-node/state-manager.js +0 -265
  174. package/dist/core/nodes/group-node.js +0 -770
  175. package/dist/core/types/deep-schema.js +0 -11
  176. package/dist/core/types/field-path.js +0 -4
  177. package/dist/core/types/form-context.js +0 -25
  178. package/dist/core/types/group-node-proxy.js +0 -31
  179. package/dist/core/types/index.js +0 -4
  180. package/dist/core/types/validation-schema.js +0 -10
  181. package/dist/core/utils/create-form.js +0 -24
  182. package/dist/core/utils/debounce.d.ts +0 -160
  183. package/dist/core/utils/debounce.js +0 -197
  184. package/dist/core/utils/error-handler.js +0 -226
  185. package/dist/core/utils/field-path-navigator.js +0 -374
  186. package/dist/core/utils/index.js +0 -14
  187. package/dist/core/utils/registry-helpers.js +0 -79
  188. package/dist/core/utils/registry-stack.js +0 -86
  189. package/dist/core/utils/resources.d.ts +0 -41
  190. package/dist/core/utils/resources.js +0 -69
  191. package/dist/core/utils/subscription-manager.js +0 -214
  192. package/dist/core/utils/type-guards.js +0 -169
  193. package/dist/core/validation/core/apply-when.js +0 -41
  194. package/dist/core/validation/core/apply.js +0 -38
  195. package/dist/core/validation/core/index.js +0 -8
  196. package/dist/core/validation/core/validate-async.js +0 -45
  197. package/dist/core/validation/core/validate-tree.js +0 -37
  198. package/dist/core/validation/core/validate.js +0 -38
  199. package/dist/core/validation/field-path.js +0 -147
  200. package/dist/core/validation/index.js +0 -33
  201. package/dist/core/validation/validate-form.js +0 -152
  202. package/dist/core/validation/validation-applicator.js +0 -217
  203. package/dist/core/validation/validation-context.js +0 -75
  204. package/dist/core/validation/validation-registry.js +0 -298
  205. package/dist/core/validation/validators/array-validators.js +0 -86
  206. package/dist/core/validation/validators/date.d.ts +0 -38
  207. package/dist/core/validation/validators/date.js +0 -117
  208. package/dist/core/validation/validators/email.js +0 -60
  209. package/dist/core/validation/validators/index.js +0 -14
  210. package/dist/core/validation/validators/max-length.js +0 -60
  211. package/dist/core/validation/validators/max.js +0 -60
  212. package/dist/core/validation/validators/min-length.js +0 -60
  213. package/dist/core/validation/validators/min.js +0 -60
  214. package/dist/core/validation/validators/number.js +0 -90
  215. package/dist/core/validation/validators/pattern.js +0 -62
  216. package/dist/core/validation/validators/phone.js +0 -58
  217. package/dist/core/validation/validators/required.js +0 -69
  218. package/dist/core/validation/validators/url.js +0 -55
  219. package/dist/create-field-path-CdPF3lIK.js +0 -704
  220. package/dist/hooks/useFormControl.js +0 -298
  221. package/dist/node-factory-D7DOnSSN.js +0 -3200
@@ -0,0 +1,167 @@
1
+ import { FieldNode } from '../core/nodes/field-node';
2
+ import { FormValue } from '../core/types';
3
+ /**
4
+ * React-хук для подписки только на значение поля.
5
+ *
6
+ * Оптимизированная версия {@link useFormControl}, которая подписывается
7
+ * только на сигнал `value`. Компонент не будет ре-рендериться при изменении
8
+ * `errors`, `touched`, `valid` и других свойств состояния.
9
+ *
10
+ * ## Когда использовать
11
+ *
12
+ * - **Условный рендеринг** на основе значения другого поля
13
+ * - **Вычисляемые значения** зависящие от значения поля
14
+ * - **Read-only отображение** значения без интерактивности
15
+ * - **Оптимизация производительности** когда не нужны другие свойства состояния
16
+ *
17
+ * ## Когда НЕ использовать
18
+ *
19
+ * Если компоненту нужны `errors`, `touched`, `disabled` или другие свойства -
20
+ * используйте {@link useFormControl}. Множественные подписки на один контрол
21
+ * через разные хуки менее эффективны, чем одна подписка через `useFormControl`.
22
+ *
23
+ * @typeParam T - Тип значения поля
24
+ * @param control - FieldNode для подписки на значение
25
+ * @returns Текущее значение поля
26
+ *
27
+ * @example Условный рендеринг секции
28
+ * ```tsx
29
+ * import { useFormControlValue } from '@reformer/core';
30
+ *
31
+ * interface FormFields {
32
+ * hasShipping: FieldNode<boolean>;
33
+ * shippingAddress: GroupNode<AddressFields>;
34
+ * }
35
+ *
36
+ * function ShippingSection({ form }: { form: FormFields }) {
37
+ * // Подписка только на значение checkbox
38
+ * const hasShipping = useFormControlValue(form.hasShipping);
39
+ *
40
+ * if (!hasShipping) {
41
+ * return null;
42
+ * }
43
+ *
44
+ * return (
45
+ * <div className="shipping-section">
46
+ * <h3>Shipping Address</h3>
47
+ * <AddressForm control={form.shippingAddress} />
48
+ * </div>
49
+ * );
50
+ * }
51
+ * ```
52
+ *
53
+ * @example Динамические опции на основе другого поля
54
+ * ```tsx
55
+ * interface FormFields {
56
+ * country: FieldNode<string>;
57
+ * city: FieldNode<string>;
58
+ * }
59
+ *
60
+ * function CitySelect({ form }: { form: FormFields }) {
61
+ * const country = useFormControlValue(form.country);
62
+ * const { value, disabled } = useFormControl(form.city);
63
+ *
64
+ * // Получаем города для выбранной страны
65
+ * const cities = useMemo(() => getCitiesForCountry(country), [country]);
66
+ *
67
+ * // Сбрасываем город при смене страны
68
+ * useEffect(() => {
69
+ * form.city.setValue('');
70
+ * }, [country, form.city]);
71
+ *
72
+ * return (
73
+ * <select
74
+ * value={value}
75
+ * disabled={disabled || !country}
76
+ * onChange={e => form.city.setValue(e.target.value)}
77
+ * >
78
+ * <option value="">Select city...</option>
79
+ * {cities.map(city => (
80
+ * <option key={city.id} value={city.id}>{city.name}</option>
81
+ * ))}
82
+ * </select>
83
+ * );
84
+ * }
85
+ * ```
86
+ *
87
+ * @example Отображение суммы в реальном времени
88
+ * ```tsx
89
+ * interface OrderItem {
90
+ * quantity: FieldNode<number>;
91
+ * price: FieldNode<number>;
92
+ * }
93
+ *
94
+ * function OrderTotal({ items }: { items: ArrayNode<OrderItem> }) {
95
+ * // Для каждого элемента получаем только значения
96
+ * const quantities = items.map(item => useFormControlValue(item.controls.quantity));
97
+ * const prices = items.map(item => useFormControlValue(item.controls.price));
98
+ *
99
+ * const total = quantities.reduce((sum, qty, i) => sum + qty * prices[i], 0);
100
+ *
101
+ * return (
102
+ * <div className="order-total">
103
+ * <strong>Total: ${total.toFixed(2)}</strong>
104
+ * </div>
105
+ * );
106
+ * }
107
+ * ```
108
+ *
109
+ * @example Preview значения
110
+ * ```tsx
111
+ * interface MarkdownEditorProps {
112
+ * control: FieldNode<string>;
113
+ * }
114
+ *
115
+ * function MarkdownPreview({ control }: MarkdownEditorProps) {
116
+ * // Подписка только на значение для preview
117
+ * const markdown = useFormControlValue(control);
118
+ *
119
+ * const html = useMemo(() => marked(markdown), [markdown]);
120
+ *
121
+ * return (
122
+ * <div
123
+ * className="markdown-preview"
124
+ * dangerouslySetInnerHTML={{ __html: html }}
125
+ * />
126
+ * );
127
+ * }
128
+ *
129
+ * // Основной редактор использует useFormControl для полного состояния
130
+ * function MarkdownEditor({ control }: MarkdownEditorProps) {
131
+ * const { value, shouldShowError, errors } = useFormControl(control);
132
+ *
133
+ * return (
134
+ * <div className="editor-container">
135
+ * <textarea
136
+ * value={value}
137
+ * onChange={e => control.setValue(e.target.value)}
138
+ * />
139
+ * {shouldShowError && <span className="error">{errors[0]?.message}</span>}
140
+ *
141
+ * {/* Preview обновляется только при изменении value *}
142
+ * <MarkdownPreview control={control} />
143
+ * </div>
144
+ * );
145
+ * }
146
+ * ```
147
+ *
148
+ * @example Счётчик символов
149
+ * ```tsx
150
+ * function CharacterCounter({ control, max }: { control: FieldNode<string>; max: number }) {
151
+ * const value = useFormControlValue(control);
152
+ * const remaining = max - value.length;
153
+ *
154
+ * return (
155
+ * <span className={remaining < 20 ? 'warning' : ''}>
156
+ * {remaining} characters remaining
157
+ * </span>
158
+ * );
159
+ * }
160
+ * ```
161
+ *
162
+ * @see {@link useFormControl} - для полного состояния поля
163
+ * @see {@link FieldNode} - тип контрола поля
164
+ *
165
+ * @group React Hooks
166
+ */
167
+ export declare function useFormControlValue<T extends FormValue>(control: FieldNode<T>): T;
@@ -0,0 +1,25 @@
1
+ import { FormProxy, FieldPath } from '../core/types';
2
+ type HiddenFn<T> = (form: FormProxy<T>, path: FieldPath<T>) => boolean;
3
+ /**
4
+ * Хук для реактивной оценки функции hidden.
5
+ *
6
+ * Подписывается на изменения формы через сигналы и возвращает текущее
7
+ * значение hidden-условия.
8
+ *
9
+ * @param hiddenFn - Функция, определяющая скрытие.
10
+ * @param form - {@link FormProxy} формы.
11
+ * @param path - Текущий {@link FieldPath}.
12
+ * @returns `true`, если элемент должен быть скрыт.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { useHiddenCondition } from '@reformer/core';
17
+ *
18
+ * function MaybeHidden({ form, path, children }) {
19
+ * const hidden = useHiddenCondition((f) => !f.subscribeNewsletter.value, form, path);
20
+ * return hidden ? null : <>{children}</>;
21
+ * }
22
+ * ```
23
+ */
24
+ export declare function useHiddenCondition<T>(hiddenFn: HiddenFn<T> | undefined, form: FormProxy<T>, path: FieldPath<T>): boolean;
25
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Signal } from '@preact/signals-core';
2
+ /** @internal */
3
+ export type SignalMap = Record<string, Signal<unknown>>;
4
+ /** @internal */
5
+ export type ExtractSignalValues<T extends SignalMap> = {
6
+ [K in keyof T]: T[K] extends Signal<infer V> ? V : never;
7
+ };
8
+ /** @internal */
9
+ export interface SignalConfig<K extends string> {
10
+ key: K;
11
+ useShallowArrayEqual?: boolean;
12
+ }
13
+ /**
14
+ * Хук для подписки на набор сигналов с кешированием
15
+ * @internal
16
+ */
17
+ export declare function useSignalSubscription<TSignals extends SignalMap, TSnapshot extends ExtractSignalValues<TSignals>>(signals: TSignals, configs: SignalConfig<Extract<keyof TSignals, string>>[], buildSnapshot: (values: ExtractSignalValues<TSignals>) => TSnapshot): TSnapshot;
@@ -0,0 +1,73 @@
1
+ import { c as f } from "./field-path-DuKdGcIE.js";
2
+ import { watchField as m } from "./behaviors/watch-field.js";
3
+ import { a as l, B as c } from "./registry-helpers-Bv_BJ1s-.js";
4
+ import { copyFrom as h } from "./behaviors/copy-from.js";
5
+ import { disableWhen as u, enableWhen as p } from "./behaviors/enable-when.js";
6
+ import { computeFrom as y } from "./behaviors/compute-from.js";
7
+ import { revalidateWhen as d } from "./behaviors/revalidate-when.js";
8
+ import { syncFields as _ } from "./behaviors/sync-fields.js";
9
+ import { resetWhen as P } from "./behaviors/reset-when.js";
10
+ import { createTransformer as b, transformValue as v, transformers as g } from "./behaviors/transform-value.js";
11
+ function s(r) {
12
+ if (!r)
13
+ return f();
14
+ const e = r.__path;
15
+ return A(e);
16
+ }
17
+ function A(r) {
18
+ return new Proxy({}, {
19
+ get(e, t) {
20
+ return typeof t == "symbol" ? void 0 : {
21
+ __path: r ? `${r}.${t}` : t,
22
+ __key: t
23
+ };
24
+ }
25
+ });
26
+ }
27
+ function B(r, e) {
28
+ const t = (Array.isArray(r) ? r : [r]).filter(Boolean), o = Array.isArray(e) ? e : [e];
29
+ for (const a of t) {
30
+ const i = s(a);
31
+ for (const n of o)
32
+ n(i);
33
+ }
34
+ }
35
+ function F(r, e, t) {
36
+ if (!r) return;
37
+ let o = !1;
38
+ m(
39
+ r,
40
+ (a, i) => {
41
+ if (!o && e(a)) {
42
+ const n = f();
43
+ t(n), o = !0;
44
+ }
45
+ },
46
+ { immediate: !0 }
47
+ );
48
+ }
49
+ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50
+ __proto__: null,
51
+ BehaviorContextImpl: l,
52
+ BehaviorRegistry: c,
53
+ apply: B,
54
+ applyWhen: F,
55
+ computeFrom: y,
56
+ copyFrom: h,
57
+ createTransformer: b,
58
+ disableWhen: u,
59
+ enableWhen: p,
60
+ resetWhen: P,
61
+ revalidateWhen: d,
62
+ syncFields: _,
63
+ toBehaviorFieldPath: s,
64
+ transformValue: v,
65
+ transformers: g,
66
+ watchField: m
67
+ }, Symbol.toStringTag, { value: "Module" }));
68
+ export {
69
+ B as a,
70
+ F as b,
71
+ z as i,
72
+ s as t
73
+ };
package/dist/index.d.ts CHANGED
@@ -6,5 +6,12 @@ export { FieldNode } from './core/nodes/field-node';
6
6
  export { GroupNode } from './core/nodes/group-node';
7
7
  export { ArrayNode } from './core/nodes/array-node';
8
8
  export type { SetValueOptions } from './core/nodes/form-node';
9
- export { useFormControl, useFormControlValue } from './hooks/useFormControl';
9
+ export { useFormControl } from './hooks/useFormControl';
10
+ export { useFormControlValue } from './hooks/useFormControlValue';
11
+ export { useArrayLength } from './hooks/useArrayLength';
12
+ export { useHiddenCondition } from './hooks/useHiddenCondition';
13
+ export type { FieldControlState, ArrayControlState } from './hooks/types';
10
14
  export type { BehaviorSchemaFn } from './core/behavior/types';
15
+ export { validateForm } from './core/validation/validate-form';
16
+ export * as behaviors from './core/behavior';
17
+ export * as validators from './core/validation';