@lehnihon/bit-form 2.2.2 → 2.2.3

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 (88) hide show
  1. package/dist/angular/index.cjs +1 -1
  2. package/dist/angular/index.cjs.map +1 -1
  3. package/dist/angular/index.d.cts +3 -3
  4. package/dist/angular/index.d.ts +3 -3
  5. package/dist/angular/index.js +1 -1
  6. package/dist/angular/index.js.map +1 -1
  7. package/dist/{types-DqeN9Kq_.d.ts → bus-CILR-ENq.d.cts} +15 -26
  8. package/dist/{types-DqeN9Kq_.d.cts → bus-DHQHDwUp.d.ts} +15 -26
  9. package/dist/{chunk-TRPMTJ35.js → chunk-3MUULXXZ.js} +2 -2
  10. package/dist/chunk-3MUULXXZ.js.map +1 -0
  11. package/dist/chunk-FEW3ABPD.js +2 -0
  12. package/dist/{chunk-O5RRLZR7.js.map → chunk-FEW3ABPD.js.map} +1 -1
  13. package/dist/chunk-JO37BU2C.cjs +2 -0
  14. package/dist/chunk-JO37BU2C.cjs.map +1 -0
  15. package/dist/chunk-NNKZFXEK.cjs +2 -0
  16. package/dist/chunk-NNKZFXEK.cjs.map +1 -0
  17. package/dist/chunk-PA6T2CBR.cjs +2 -0
  18. package/dist/chunk-PA6T2CBR.cjs.map +1 -0
  19. package/dist/{chunk-VSWCUQAF.cjs → chunk-T3XN5O7V.cjs} +2 -2
  20. package/dist/chunk-T3XN5O7V.cjs.map +1 -0
  21. package/dist/chunk-ULC4OPIQ.js +2 -0
  22. package/dist/chunk-ULC4OPIQ.js.map +1 -0
  23. package/dist/chunk-VDWCFNA6.js +2 -0
  24. package/dist/chunk-VDWCFNA6.js.map +1 -0
  25. package/dist/devtools/bridge.cjs +1 -1
  26. package/dist/devtools/bridge.cjs.map +1 -1
  27. package/dist/devtools/bridge.js +1 -1
  28. package/dist/devtools/index.cjs +2 -2
  29. package/dist/devtools/index.cjs.map +1 -1
  30. package/dist/devtools/index.js +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +186 -81
  34. package/dist/index.d.ts +186 -81
  35. package/dist/index.js +1 -1
  36. package/dist/mask.cjs +2 -0
  37. package/dist/mask.cjs.map +1 -0
  38. package/dist/mask.d.cts +86 -0
  39. package/dist/mask.d.ts +86 -0
  40. package/dist/mask.js +2 -0
  41. package/dist/{public-types-CLIDR8aC.d.cts → public-types-Bgws0aVJ.d.ts} +5 -2
  42. package/dist/{public-types-Bl94ECPb.d.ts → public-types-SU17BarA.d.cts} +5 -2
  43. package/dist/react/index.cjs +1 -1
  44. package/dist/react/index.d.cts +6 -6
  45. package/dist/react/index.d.ts +6 -6
  46. package/dist/react/index.js +1 -1
  47. package/dist/react-native/index.cjs +1 -1
  48. package/dist/react-native/index.d.cts +5 -5
  49. package/dist/react-native/index.d.ts +5 -5
  50. package/dist/react-native/index.js +1 -1
  51. package/dist/resolvers/joi.d.cts +2 -2
  52. package/dist/resolvers/joi.d.ts +2 -2
  53. package/dist/resolvers/yup.d.cts +2 -2
  54. package/dist/resolvers/yup.d.ts +2 -2
  55. package/dist/resolvers/zod.d.cts +2 -2
  56. package/dist/resolvers/zod.d.ts +2 -2
  57. package/dist/types-D8DgIUhJ.d.cts +27 -0
  58. package/dist/types-D8DgIUhJ.d.ts +27 -0
  59. package/dist/{use-bit-persist-JtinX6Vy.d.ts → use-bit-persist-BlR-hHk6.d.ts} +3 -4
  60. package/dist/{use-bit-persist-BgFBg8lQ.d.cts → use-bit-persist-DEWMhvit.d.cts} +3 -4
  61. package/dist/vue/index.cjs +1 -1
  62. package/dist/vue/index.cjs.map +1 -1
  63. package/dist/vue/index.d.cts +3 -3
  64. package/dist/vue/index.d.ts +3 -3
  65. package/dist/vue/index.js +1 -1
  66. package/dist/vue/index.js.map +1 -1
  67. package/package.json +5 -5
  68. package/dist/bus-B1my-s_o.d.ts +0 -16
  69. package/dist/bus-BI29cKpD.d.cts +0 -16
  70. package/dist/chunk-2UVV7SU4.js +0 -2
  71. package/dist/chunk-2UVV7SU4.js.map +0 -1
  72. package/dist/chunk-676WXU4S.cjs +0 -2
  73. package/dist/chunk-676WXU4S.cjs.map +0 -1
  74. package/dist/chunk-AD7T42HJ.js +0 -1
  75. package/dist/chunk-C4BYXZGB.cjs +0 -1
  76. package/dist/chunk-C4BYXZGB.cjs.map +0 -1
  77. package/dist/chunk-NWPA4F3B.cjs +0 -2
  78. package/dist/chunk-NWPA4F3B.cjs.map +0 -1
  79. package/dist/chunk-O5RRLZR7.js +0 -2
  80. package/dist/chunk-TRPMTJ35.js.map +0 -1
  81. package/dist/chunk-VSWCUQAF.cjs.map +0 -1
  82. package/dist/core/light.cjs +0 -2
  83. package/dist/core/light.cjs.map +0 -1
  84. package/dist/core/light.d.cts +0 -29
  85. package/dist/core/light.d.ts +0 -29
  86. package/dist/core/light.js +0 -2
  87. package/dist/core/light.js.map +0 -1
  88. /package/dist/{chunk-AD7T42HJ.js.map → mask.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,90 +1,195 @@
1
- export { cleanPrefixedKeys, createBitStore, deepClone, deepEqual, deepMerge, extractServerErrors, getDeepValue, isValidationErrorShape, setDeepValue, valueEqual } from './core/light.js';
2
- export { B as BitEqualityFn, a as BitFrameworkConfig, b as BitHistoryMetadata, c as BitPersistMetadata, d as BitSelector, e as BitSelectorSubscriptionOptions, f as BitStoreApi, g as BitStoreHooksApi, h as BitValidationOptions } from './public-types-Bl94ECPb.js';
3
- export { b as bitBus } from './bus-B1my-s_o.js';
4
- import { P as PatternMaskOptions, a as BitMask, C as CurrencyMaskConfig, o as DateMaskConfig, p as BitBuiltInMaskName } from './types-DqeN9Kq_.js';
5
- export { q as BitAfterSubmitEvent, r as BitAfterValidateEvent, l as BitArrayItem, k as BitArrayPath, s as BitBeforeSubmitEvent, t as BitBeforeValidateEvent, u as BitComputedFn, B as BitConfig, i as BitErrors, v as BitFieldChangeEvent, w as BitFieldChangeMeta, x as BitFieldConditional, b as BitFieldDefinition, m as BitFieldState, y as BitFieldValidation, z as BitHistoryConfig, j as BitMaskName, f as BitPath, g as BitPathValue, A as BitPersistConfig, E as BitPersistMode, F as BitPersistStorageAdapter, d as BitPlugin, G as BitPluginContext, H as BitPluginErrorEvent, I as BitPluginHooks, e as BitState, J as BitTouched, K as BitTransformFn, L as BitValidationConfig, h as DeepPartial, S as ScopeStatus, n as ValidateScopeResult, V as ValidatorFn } from './types-DqeN9Kq_.js';
1
+ import { B as BitMask, a as BitMaskName } from './types-D8DgIUhJ.js';
2
+ import { B as BitState, a as BitTransformFn, b as BitFieldChangeEvent, c as BitBeforeSubmitEvent, d as BitAfterSubmitEvent, e as BitFieldDefinition, f as BitErrors, g as BitBeforeValidateEvent, h as BitAfterValidateEvent, i as BitConfig, j as BitComputedFn, k as BitPath, l as BitFieldState, m as BitPathValue, n as BitFieldChangeMeta, D as DeepPartial, o as BitArrayPath, p as BitArrayItem } from './bus-DHQHDwUp.js';
3
+ export { q as BitFieldConditional, r as BitFieldValidation, s as BitHistoryConfig, t as BitPersistConfig, u as BitPersistMode, v as BitPersistStorageAdapter, w as BitPlugin, x as BitPluginContext, y as BitPluginErrorEvent, z as BitPluginHooks, A as BitTouched, C as BitValidationConfig, S as ScopeStatus, V as ValidateScopeResult, E as ValidatorFn, F as bitBus } from './bus-DHQHDwUp.js';
4
+ import { B as BitResolvedConfig, a as BitValidationOptions, b as BitSelector, c as BitSelectorSubscriptionOptions, d as BitHistoryMetadata, e as BitStoreApi, f as BitStoreHooksApi } from './public-types-Bgws0aVJ.js';
5
+ export { g as BitEqualityFn, h as BitFrameworkConfig, i as BitPersistMetadata } from './public-types-Bgws0aVJ.js';
6
6
  export { B as BitDeleteUploadFn, a as BitUploadFn, b as BitUploadResult } from './types-C2mpfhp1.js';
7
7
 
8
- declare const unmask: (value: string | number | null | undefined, allowChars?: string) => string;
9
- declare const unmaskCurrency: (value: any, precision?: number) => number;
10
- declare const createPatternMask: (pattern: string | string[], options?: PatternMaskOptions) => BitMask;
11
- declare const createCurrencyMask: ({ prefix, suffix, thousand, decimal, precision, allowNegative, saveRaw, }: CurrencyMaskConfig) => BitMask;
12
- declare const createCreditCardMask: (options?: PatternMaskOptions) => BitMask;
13
- declare const createDateMask: (config?: DateMaskConfig) => BitMask;
8
+ interface BitLifecycleStorePort<T extends object> {
9
+ getState: () => BitState<T>;
10
+ internalUpdateState: (partial: Partial<BitState<T>>, changedPaths?: string[]) => void;
11
+ internalSaveSnapshot: () => void;
12
+ getTransformEntries: () => [string, BitTransformFn<T>][];
13
+ config: BitResolvedConfig<T>;
14
+ updateDependencies: (changedPath: string, newValues: T) => string[];
15
+ isFieldHidden: (path: string) => boolean;
16
+ evaluateAllDependencies: (values: T) => void;
17
+ getHiddenFields: () => string[];
18
+ clearFieldValidation: (path: string) => void;
19
+ triggerValidation: (scopeFields?: string[]) => void;
20
+ handleFieldAsyncValidation: (path: string, value: any) => void;
21
+ cancelAllValidations: () => void;
22
+ validateNow: (options?: BitValidationOptions) => Promise<boolean>;
23
+ hasValidationsInProgress: (scopeFields?: string[]) => boolean;
24
+ updateDirtyForPath: (path: string, nextValues: T, baselineValues: T) => boolean;
25
+ rebuildDirtyState: (nextValues: T, baselineValues: T) => boolean;
26
+ clearDirtyState: () => void;
27
+ buildDirtyValues: (values: T) => Partial<T>;
28
+ resetHistory: (initialValues: T) => void;
29
+ emitFieldChange: (event: BitFieldChangeEvent<T>) => void;
30
+ emitBeforeSubmit: (event: BitBeforeSubmitEvent<T>) => Promise<void>;
31
+ emitAfterSubmit: (event: BitAfterSubmitEvent<T>) => Promise<void>;
32
+ emitOperationalError: (event: {
33
+ source: "submit";
34
+ error: unknown;
35
+ payload?: unknown;
36
+ }) => Promise<void>;
37
+ }
38
+
39
+ interface BitValidationStorePort<T extends object> {
40
+ getState: () => BitState<T>;
41
+ internalUpdateState: (partial: Partial<BitState<T>>) => void;
42
+ setError: (path: string, message: string | undefined) => void;
43
+ validate: (opts: BitValidationOptions) => Promise<boolean>;
44
+ getFieldConfig: (path: string) => BitFieldDefinition<T> | undefined;
45
+ getScopeFields: (scopeName: string) => string[];
46
+ config: BitResolvedConfig<T>;
47
+ getRequiredErrors: (values: T) => BitErrors<T>;
48
+ getHiddenFields: () => string[];
49
+ emitBeforeValidate: (event: BitBeforeValidateEvent<T>) => Promise<void>;
50
+ emitAfterValidate: (event: BitAfterValidateEvent<T>) => Promise<void>;
51
+ }
14
52
 
15
- /** BRL - Real Brasileiro (R$ 1.000,00) */
16
- declare const maskBRL: BitMask;
17
- /** USD - Dólar Americano ($1,000.00) */
18
- declare const maskUSD: BitMask;
19
- /** EUR - Euro Padrão (€ 1.000,00) - Sufixo comum na Europa */
20
- declare const maskEUR: BitMask;
21
- /** GBP - Libra Esterlina (£1,000.00) */
22
- declare const maskGBP: BitMask;
23
- /** JPY - Iene Japonês (¥1,000) - Geralmente sem decimais */
24
- declare const maskJPY: BitMask;
25
- /** Porcentagem PT-BR (10,5%) */
26
- declare const maskPercent: BitMask;
27
- /** Decimal Genérico PT-BR (1.000,00) - Sem símbolo */
28
- declare const maskDecimal: BitMask;
29
- /** Inteiro (1.000) - Apenas separador de milhar */
30
- declare const maskInteger: BitMask;
31
- /** CPF (000.000.000-00) */
32
- declare const maskCPF: BitMask;
33
- /** CNPJ (00.000.000/0000-00) */
34
- declare const maskCNPJ: BitMask;
35
- declare const maskPhone: BitMask;
36
- /** Telefone Fixo BR (11) 0000-0000 */
37
- declare const maskLandline: BitMask;
38
- /** CEP (00000-000) */
39
- declare const maskCEP: BitMask;
40
- /** Data PT/BR com correção automática de dia/mês */
41
- declare const maskDate: BitMask;
42
- /** Hora Curta (HH:MM) */
43
- declare const maskTime: BitMask;
44
- /** CNH (Carteira de Motorista - 11 dígitos) */
45
- declare const maskCNH: BitMask;
46
- /** RG (00.000.000-X) - Suporta o 'X' como dígito verificador */
47
- declare const maskRG: BitMask;
48
53
  /**
49
- * CPF + CNPJ combinado — alterna automaticamente pelo número de dígitos:
50
- * - Até 11 dígitos → CPF (000.000.000-00)
51
- * - Mais de 11 → CNPJ (00.000.000/0000-00)
54
+ * BitStore
55
+ *
56
+ * The core orchestrator of form state management.
57
+ *
58
+ * This store coordinates multiple managers to provide comprehensive form handling:
59
+ * - Core managers handle essential state and validation
60
+ * - Feature managers provide optional enhancements (history, arrays, scopes)
61
+ * - Query/mutation managers organize domain-specific operations
52
62
  */
53
- declare const maskCPFCNPJ: BitMask;
63
+ declare class BitStore<T extends object = any> implements BitValidationStorePort<T>, BitLifecycleStorePort<T> {
64
+ private state;
65
+ private readonly subscriptions;
66
+ private readonly effects;
67
+ private readonly capabilities;
68
+ config: BitResolvedConfig<T>;
69
+ storeId: string;
70
+ private readonly depsMg;
71
+ private readonly computedMg;
72
+ private readonly dirtyMg;
73
+ private getCapability;
74
+ private get validation();
75
+ private get lifecycle();
76
+ private get history();
77
+ private get arrays();
78
+ private get scope();
79
+ private get query();
80
+ private get error();
81
+ constructor(config?: BitConfig<T>);
82
+ getConfig(): BitResolvedConfig<T>;
83
+ getFieldConfig(path: string): BitFieldDefinition<T> | undefined;
84
+ getScopeFields(scopeName: string): string[];
85
+ getComputedEntries(): [string, BitComputedFn<T>][];
86
+ getTransformEntries(): [string, BitTransformFn<T>][];
87
+ resolveMask(path: string): BitMask | undefined;
88
+ getState(): BitState<T>;
89
+ getFieldState<P extends BitPath<T>>(path: P): BitFieldState<T, BitPathValue<T, P>>;
90
+ get isValid(): boolean;
91
+ get isSubmitting(): boolean;
92
+ get isDirty(): boolean;
93
+ registerField(path: string, config: BitFieldDefinition<T>): void;
94
+ unregisterField<P extends BitPath<T>>(path: P): void;
95
+ unregisterPrefix(prefix: string): void;
96
+ isHidden<P extends BitPath<T>>(path: P): boolean;
97
+ isRequired<P extends BitPath<T>>(path: P): boolean;
98
+ isFieldDirty(path: string): boolean;
99
+ isFieldValidating(path: string): boolean;
100
+ subscribe(listener: () => void): () => void;
101
+ subscribeSelector<TSlice>(selector: BitSelector<T, TSlice>, listener: (slice: TSlice) => void, options?: BitSelectorSubscriptionOptions<TSlice>): () => void;
102
+ subscribePath<P extends BitPath<T>>(path: P, listener: (value: BitPathValue<T, P>) => void, options?: BitSelectorSubscriptionOptions<BitPathValue<T, P>>): () => void;
103
+ watch<P extends BitPath<T>>(path: P, callback: (value: BitPathValue<T, P>) => void): () => void;
104
+ setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
105
+ setFieldWithMeta(path: string, value: any, meta?: BitFieldChangeMeta): void;
106
+ blurField<P extends BitPath<T>>(path: P): void;
107
+ markFieldsTouched(paths: string[]): void;
108
+ replaceValues(newValues: T): void;
109
+ hydrate(values: DeepPartial<T>): void;
110
+ rebase(newValues: T): void;
111
+ setError(path: string, message: string | undefined): void;
112
+ setErrors(errors: BitErrors<T>): void;
113
+ setServerErrors(serverErrors: Record<string, string[] | string>): void;
114
+ reset(): void;
115
+ submit(onSuccess: (values: T, dirtyValues?: Partial<T>) => void | Promise<void>): Promise<void>;
116
+ registerMask(name: BitMaskName, mask: BitMask): void;
117
+ getDirtyValues(): Partial<T>;
118
+ restorePersisted(): Promise<boolean>;
119
+ forceSave(): Promise<void>;
120
+ clearPersisted(): Promise<void>;
121
+ pushItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
122
+ prependItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
123
+ insertItem<P extends BitArrayPath<T>>(path: P, index: number, value: BitArrayItem<BitPathValue<T, P>>): void;
124
+ removeItem<P extends BitArrayPath<T>>(path: P, index: number): void;
125
+ swapItems<P extends BitArrayPath<T>>(path: P, indexA: number, indexB: number): void;
126
+ moveItem<P extends BitArrayPath<T>>(path: P, from: number, to: number): void;
127
+ get canUndo(): boolean;
128
+ get canRedo(): boolean;
129
+ undo(): void;
130
+ redo(): void;
131
+ getHistoryMetadata(): BitHistoryMetadata;
132
+ validate(options?: BitValidationOptions): Promise<boolean>;
133
+ emitBeforeValidate(event: BitBeforeValidateEvent<T>): Promise<void>;
134
+ emitAfterValidate(event: BitAfterValidateEvent<T>): Promise<void>;
135
+ emitBeforeSubmit(event: BitBeforeSubmitEvent<T>): Promise<void>;
136
+ emitAfterSubmit(event: BitAfterSubmitEvent<T>): Promise<void>;
137
+ emitFieldChange(event: BitFieldChangeEvent<T>): void;
138
+ emitOperationalError(event: {
139
+ source: "submit";
140
+ error: unknown;
141
+ payload?: unknown;
142
+ }): Promise<void>;
143
+ hasValidationsInProgress(scopeFields?: string[]): boolean;
144
+ triggerValidation(scopeFields?: string[]): void;
145
+ getStepStatus(scopeName: string): {
146
+ hasErrors: boolean;
147
+ isDirty: boolean;
148
+ errors: Record<string, string>;
149
+ };
150
+ getStepErrors(scopeName: string): Record<string, string>;
151
+ updateDependencies(changedPath: string, newValues: T): string[];
152
+ isFieldHidden(path: string): boolean;
153
+ evaluateAllDependencies(values: T): void;
154
+ getHiddenFields(): string[];
155
+ getRequiredErrors(values: T): BitErrors<T>;
156
+ clearFieldValidation(path: string): void;
157
+ handleFieldAsyncValidation(path: string, value: any): void;
158
+ cancelAllValidations(): void;
159
+ validateNow(options?: BitValidationOptions): Promise<boolean>;
160
+ updateDirtyForPath(path: string, nextValues: T, baselineValues: T): boolean;
161
+ rebuildDirtyState(nextValues: T, baselineValues: T): boolean;
162
+ clearDirtyState(): void;
163
+ buildDirtyValues(values: T): Partial<T>;
164
+ resetHistory(initialValues: T): void;
165
+ internalUpdateState(partialState: Partial<BitState<T>>, changedPaths?: string[]): void;
166
+ internalSaveSnapshot(): void;
167
+ private applyPersistedValues;
168
+ cleanup(): void;
169
+ }
170
+
171
+ declare function resolveBitStoreForHooks<T extends object>(store: BitStoreApi<T> | BitStore<T>): BitStoreHooksApi<T>;
172
+ declare function createBitStore<T extends object = any>(config?: BitConfig<T>): BitStoreApi<T>;
173
+
174
+ declare function deepClone<T>(obj: T): T;
175
+ declare function deepMerge<T>(target: T, source: any): T;
54
176
  /**
55
- * Placa de veículo BR detecta o formato pelo 5.º caractere:
56
- * - Antigo → ABC-1234 (posição 5 é dígito)
57
- * - Mercosul → ABC1D23 (posição 5 é letra)
177
+ * Fast equality for single values. Uses === for primitives, deepEqual for objects/arrays.
178
+ * Prefer over deepEqual when comparing a single field value (e.g. isFieldDirty, getStepStatus).
58
179
  */
59
- declare const maskPlate: BitMask;
60
- /** US Phone ((000) 000-0000) */
61
- declare const maskUSPhone: BitMask;
62
- /** ZIP Code (00000 or 00000-0000) */
63
- declare const maskZipCode: BitMask;
64
- /** Date US (MM/DD/YYYY) - Igual ao BR, mas semântica diferente */
65
- declare const maskDateUS: BitMask;
66
- /** SSN (Social Security Number) */
67
- declare const maskSSN: BitMask;
68
- /** Cartão de Crédito Inteligente (Detecta Visa/Master, Amex e Diners) */
69
- declare const maskCreditCard: BitMask;
70
- /** CVV (3 ou 4 dígitos) */
71
- declare const maskCVV: BitMask;
72
- /** Data ISO (Ideal para base de dados: YYYY-MM-DD) */
73
- declare const maskDateISO: BitMask;
74
- /** Endereço MAC (HH:HH:HH:HH:HH:HH) - Usa o token Hexadecimal */
75
- declare const maskMacAddress: BitMask;
76
- /** Cor Hexadecimal (#HHHHHH) */
77
- declare const maskColorHex: BitMask;
78
- /** IPv4 (000.000.000.000) - Formato de blocos fixos */
79
- declare const maskIPv4: BitMask;
80
- /** IPv6 (HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH) */
81
- declare const maskIPv6: BitMask;
82
- /** * IBAN Internacional
83
- * Força as duas primeiras letras para maiúsculas e agrupa de 4 em 4.
84
- * O tamanho máximo cobre os 34 caracteres do padrão IBAN.
180
+ declare function valueEqual(a: any, b: any): boolean;
181
+ declare function deepEqual(a: any, b: any): boolean;
182
+ declare function getDeepValue(obj: any, path: string): any;
183
+ declare function setDeepValue(obj: any, path: string, value: any): any;
184
+ declare function cleanPrefixedKeys(obj: Record<string, any>, prefix: string): Record<string, any>;
185
+ /**
186
+ * Checks if a value looks like a server validation error response.
187
+ * Handles shapes like { email: "Taken" }, { errors: { email: ["Taken"] } }, etc.
85
188
  */
86
- declare const maskIBAN: BitMask;
87
-
88
- declare const bitMasks: Record<BitBuiltInMaskName, BitMask>;
189
+ declare function isValidationErrorShape(x: unknown): x is Record<string, string | string[]>;
190
+ /**
191
+ * Extracts server errors in the format expected by setServerErrors.
192
+ */
193
+ declare function extractServerErrors(x: unknown): Record<string, string | string[]>;
89
194
 
90
- export { BitBuiltInMaskName, BitMask, CurrencyMaskConfig, DateMaskConfig, PatternMaskOptions, bitMasks, createCreditCardMask, createCurrencyMask, createDateMask, createPatternMask, maskBRL, maskCEP, maskCNH, maskCNPJ, maskCPF, maskCPFCNPJ, maskCVV, maskColorHex, maskCreditCard, maskDate, maskDateISO, maskDateUS, maskDecimal, maskEUR, maskGBP, maskIBAN, maskIPv4, maskIPv6, maskInteger, maskJPY, maskLandline, maskMacAddress, maskPercent, maskPhone, maskPlate, maskRG, maskSSN, maskTime, maskUSD, maskUSPhone, maskZipCode, unmask, unmaskCurrency };
195
+ export { BitAfterSubmitEvent, BitAfterValidateEvent, BitArrayItem, BitArrayPath, BitBeforeSubmitEvent, BitBeforeValidateEvent, BitComputedFn, BitConfig, BitErrors, BitFieldChangeEvent, BitFieldChangeMeta, BitFieldDefinition, BitFieldState, BitHistoryMetadata, BitPath, BitPathValue, BitSelector, BitSelectorSubscriptionOptions, BitState, BitStore, BitStoreApi, BitStoreHooksApi, BitTransformFn, BitValidationOptions, DeepPartial, cleanPrefixedKeys, createBitStore, deepClone, deepEqual, deepMerge, extractServerErrors, getDeepValue, isValidationErrorShape, resolveBitStoreForHooks, setDeepValue, valueEqual };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-AD7T42HJ.js";import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,X as V,Z as W,a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunk-2UVV7SU4.js";export{o as bitBus,V as bitMasks,x as cleanPrefixedKeys,W as createBitStore,i as createCreditCardMask,h as createCurrencyMask,j as createDateMask,g as createPatternMask,r as deepClone,m as deepEqual,e as deepMerge,b as extractServerErrors,p as getDeepValue,a as isValidationErrorShape,k as maskBRL,C as maskCEP,F as maskCNH,z as maskCNPJ,y as maskCPF,H as maskCPFCNPJ,O as maskCVV,R as maskColorHex,N as maskCreditCard,D as maskDate,P as maskDateISO,L as maskDateUS,v as maskDecimal,n as maskEUR,q as maskGBP,U as maskIBAN,S as maskIPv4,T as maskIPv6,w as maskInteger,s as maskJPY,B as maskLandline,Q as maskMacAddress,u as maskPercent,A as maskPhone,I as maskPlate,G as maskRG,M as maskSSN,E as maskTime,l as maskUSD,J as maskUSPhone,K as maskZipCode,t as setDeepValue,c as unmask,d as unmaskCurrency,f as valueEqual};
1
+ import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g}from"./chunk-ULC4OPIQ.js";import"./chunk-VDWCFNA6.js";export{c as BitStore,b as bitBus,t as cleanPrefixedKeys,g as createBitStore,o as deepClone,f as deepEqual,r as deepMerge,a as extractServerErrors,m as getDeepValue,x as isValidationErrorShape,d as resolveBitStoreForHooks,p as setDeepValue,e as valueEqual};
2
2
  //# sourceMappingURL=index.js.map
package/dist/mask.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPA6T2CBRcjs = require('./chunk-PA6T2CBR.cjs');exports.bitMasks = _chunkPA6T2CBRcjs.N; exports.createCreditCardMask = _chunkPA6T2CBRcjs.e; exports.createCurrencyMask = _chunkPA6T2CBRcjs.d; exports.createDateMask = _chunkPA6T2CBRcjs.f; exports.createPatternMask = _chunkPA6T2CBRcjs.c; exports.maskBRL = _chunkPA6T2CBRcjs.g; exports.maskCEP = _chunkPA6T2CBRcjs.s; exports.maskCNH = _chunkPA6T2CBRcjs.v; exports.maskCNPJ = _chunkPA6T2CBRcjs.p; exports.maskCPF = _chunkPA6T2CBRcjs.o; exports.maskCPFCNPJ = _chunkPA6T2CBRcjs.x; exports.maskCVV = _chunkPA6T2CBRcjs.E; exports.maskColorHex = _chunkPA6T2CBRcjs.H; exports.maskCreditCard = _chunkPA6T2CBRcjs.D; exports.maskDate = _chunkPA6T2CBRcjs.t; exports.maskDateISO = _chunkPA6T2CBRcjs.F; exports.maskDateUS = _chunkPA6T2CBRcjs.B; exports.maskDecimal = _chunkPA6T2CBRcjs.m; exports.maskEUR = _chunkPA6T2CBRcjs.i; exports.maskGBP = _chunkPA6T2CBRcjs.j; exports.maskIBAN = _chunkPA6T2CBRcjs.K; exports.maskIPv4 = _chunkPA6T2CBRcjs.I; exports.maskIPv6 = _chunkPA6T2CBRcjs.J; exports.maskInteger = _chunkPA6T2CBRcjs.n; exports.maskJPY = _chunkPA6T2CBRcjs.k; exports.maskLandline = _chunkPA6T2CBRcjs.r; exports.maskMacAddress = _chunkPA6T2CBRcjs.G; exports.maskPercent = _chunkPA6T2CBRcjs.l; exports.maskPhone = _chunkPA6T2CBRcjs.q; exports.maskPlate = _chunkPA6T2CBRcjs.y; exports.maskRG = _chunkPA6T2CBRcjs.w; exports.maskSSN = _chunkPA6T2CBRcjs.C; exports.maskTime = _chunkPA6T2CBRcjs.u; exports.maskUSD = _chunkPA6T2CBRcjs.h; exports.maskUSPhone = _chunkPA6T2CBRcjs.z; exports.maskZipCode = _chunkPA6T2CBRcjs.A; exports.unmask = _chunkPA6T2CBRcjs.a; exports.unmaskCurrency = _chunkPA6T2CBRcjs.b;
2
+ //# sourceMappingURL=mask.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/mask.cjs"],"names":[],"mappings":"AAAA,iIAA4R,yjDAAsmB","file":"/home/runner/work/bit-form/bit-form/dist/mask.cjs"}
@@ -0,0 +1,86 @@
1
+ import { P as PatternMaskOptions, B as BitMask, C as CurrencyMaskConfig, D as DateMaskConfig, b as BitBuiltInMaskName } from './types-D8DgIUhJ.cjs';
2
+ export { a as BitMaskName } from './types-D8DgIUhJ.cjs';
3
+
4
+ declare const unmask: (value: string | number | null | undefined, allowChars?: string) => string;
5
+ declare const unmaskCurrency: (value: any, precision?: number) => number;
6
+ declare const createPatternMask: (pattern: string | string[], options?: PatternMaskOptions) => BitMask;
7
+ declare const createCurrencyMask: ({ prefix, suffix, thousand, decimal, precision, allowNegative, saveRaw, }: CurrencyMaskConfig) => BitMask;
8
+ declare const createCreditCardMask: (options?: PatternMaskOptions) => BitMask;
9
+ declare const createDateMask: (config?: DateMaskConfig) => BitMask;
10
+
11
+ /** BRL - Real Brasileiro (R$ 1.000,00) */
12
+ declare const maskBRL: BitMask;
13
+ /** USD - Dólar Americano ($1,000.00) */
14
+ declare const maskUSD: BitMask;
15
+ /** EUR - Euro Padrão (€ 1.000,00) - Sufixo comum na Europa */
16
+ declare const maskEUR: BitMask;
17
+ /** GBP - Libra Esterlina (£1,000.00) */
18
+ declare const maskGBP: BitMask;
19
+ /** JPY - Iene Japonês (¥1,000) - Geralmente sem decimais */
20
+ declare const maskJPY: BitMask;
21
+ /** Porcentagem PT-BR (10,5%) */
22
+ declare const maskPercent: BitMask;
23
+ /** Decimal Genérico PT-BR (1.000,00) - Sem símbolo */
24
+ declare const maskDecimal: BitMask;
25
+ /** Inteiro (1.000) - Apenas separador de milhar */
26
+ declare const maskInteger: BitMask;
27
+ /** CPF (000.000.000-00) */
28
+ declare const maskCPF: BitMask;
29
+ /** CNPJ (00.000.000/0000-00) */
30
+ declare const maskCNPJ: BitMask;
31
+ declare const maskPhone: BitMask;
32
+ /** Telefone Fixo BR (11) 0000-0000 */
33
+ declare const maskLandline: BitMask;
34
+ /** CEP (00000-000) */
35
+ declare const maskCEP: BitMask;
36
+ /** Data PT/BR com correção automática de dia/mês */
37
+ declare const maskDate: BitMask;
38
+ /** Hora Curta (HH:MM) */
39
+ declare const maskTime: BitMask;
40
+ /** CNH (Carteira de Motorista - 11 dígitos) */
41
+ declare const maskCNH: BitMask;
42
+ /** RG (00.000.000-X) - Suporta o 'X' como dígito verificador */
43
+ declare const maskRG: BitMask;
44
+ /**
45
+ * CPF + CNPJ combinado — alterna automaticamente pelo número de dígitos:
46
+ * - Até 11 dígitos → CPF (000.000.000-00)
47
+ * - Mais de 11 → CNPJ (00.000.000/0000-00)
48
+ */
49
+ declare const maskCPFCNPJ: BitMask;
50
+ /**
51
+ * Placa de veículo BR — detecta o formato pelo 5.º caractere:
52
+ * - Antigo → ABC-1234 (posição 5 é dígito)
53
+ * - Mercosul → ABC1D23 (posição 5 é letra)
54
+ */
55
+ declare const maskPlate: BitMask;
56
+ /** US Phone ((000) 000-0000) */
57
+ declare const maskUSPhone: BitMask;
58
+ /** ZIP Code (00000 or 00000-0000) */
59
+ declare const maskZipCode: BitMask;
60
+ /** Date US (MM/DD/YYYY) - Igual ao BR, mas semântica diferente */
61
+ declare const maskDateUS: BitMask;
62
+ /** SSN (Social Security Number) */
63
+ declare const maskSSN: BitMask;
64
+ /** Cartão de Crédito Inteligente (Detecta Visa/Master, Amex e Diners) */
65
+ declare const maskCreditCard: BitMask;
66
+ /** CVV (3 ou 4 dígitos) */
67
+ declare const maskCVV: BitMask;
68
+ /** Data ISO (Ideal para base de dados: YYYY-MM-DD) */
69
+ declare const maskDateISO: BitMask;
70
+ /** Endereço MAC (HH:HH:HH:HH:HH:HH) - Usa o token Hexadecimal */
71
+ declare const maskMacAddress: BitMask;
72
+ /** Cor Hexadecimal (#HHHHHH) */
73
+ declare const maskColorHex: BitMask;
74
+ /** IPv4 (000.000.000.000) - Formato de blocos fixos */
75
+ declare const maskIPv4: BitMask;
76
+ /** IPv6 (HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH) */
77
+ declare const maskIPv6: BitMask;
78
+ /** * IBAN Internacional
79
+ * Força as duas primeiras letras para maiúsculas e agrupa de 4 em 4.
80
+ * O tamanho máximo cobre os 34 caracteres do padrão IBAN.
81
+ */
82
+ declare const maskIBAN: BitMask;
83
+
84
+ declare const bitMasks: Record<BitBuiltInMaskName, BitMask>;
85
+
86
+ export { BitBuiltInMaskName, BitMask, CurrencyMaskConfig, DateMaskConfig, PatternMaskOptions, bitMasks, createCreditCardMask, createCurrencyMask, createDateMask, createPatternMask, maskBRL, maskCEP, maskCNH, maskCNPJ, maskCPF, maskCPFCNPJ, maskCVV, maskColorHex, maskCreditCard, maskDate, maskDateISO, maskDateUS, maskDecimal, maskEUR, maskGBP, maskIBAN, maskIPv4, maskIPv6, maskInteger, maskJPY, maskLandline, maskMacAddress, maskPercent, maskPhone, maskPlate, maskRG, maskSSN, maskTime, maskUSD, maskUSPhone, maskZipCode, unmask, unmaskCurrency };
package/dist/mask.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ import { P as PatternMaskOptions, B as BitMask, C as CurrencyMaskConfig, D as DateMaskConfig, b as BitBuiltInMaskName } from './types-D8DgIUhJ.js';
2
+ export { a as BitMaskName } from './types-D8DgIUhJ.js';
3
+
4
+ declare const unmask: (value: string | number | null | undefined, allowChars?: string) => string;
5
+ declare const unmaskCurrency: (value: any, precision?: number) => number;
6
+ declare const createPatternMask: (pattern: string | string[], options?: PatternMaskOptions) => BitMask;
7
+ declare const createCurrencyMask: ({ prefix, suffix, thousand, decimal, precision, allowNegative, saveRaw, }: CurrencyMaskConfig) => BitMask;
8
+ declare const createCreditCardMask: (options?: PatternMaskOptions) => BitMask;
9
+ declare const createDateMask: (config?: DateMaskConfig) => BitMask;
10
+
11
+ /** BRL - Real Brasileiro (R$ 1.000,00) */
12
+ declare const maskBRL: BitMask;
13
+ /** USD - Dólar Americano ($1,000.00) */
14
+ declare const maskUSD: BitMask;
15
+ /** EUR - Euro Padrão (€ 1.000,00) - Sufixo comum na Europa */
16
+ declare const maskEUR: BitMask;
17
+ /** GBP - Libra Esterlina (£1,000.00) */
18
+ declare const maskGBP: BitMask;
19
+ /** JPY - Iene Japonês (¥1,000) - Geralmente sem decimais */
20
+ declare const maskJPY: BitMask;
21
+ /** Porcentagem PT-BR (10,5%) */
22
+ declare const maskPercent: BitMask;
23
+ /** Decimal Genérico PT-BR (1.000,00) - Sem símbolo */
24
+ declare const maskDecimal: BitMask;
25
+ /** Inteiro (1.000) - Apenas separador de milhar */
26
+ declare const maskInteger: BitMask;
27
+ /** CPF (000.000.000-00) */
28
+ declare const maskCPF: BitMask;
29
+ /** CNPJ (00.000.000/0000-00) */
30
+ declare const maskCNPJ: BitMask;
31
+ declare const maskPhone: BitMask;
32
+ /** Telefone Fixo BR (11) 0000-0000 */
33
+ declare const maskLandline: BitMask;
34
+ /** CEP (00000-000) */
35
+ declare const maskCEP: BitMask;
36
+ /** Data PT/BR com correção automática de dia/mês */
37
+ declare const maskDate: BitMask;
38
+ /** Hora Curta (HH:MM) */
39
+ declare const maskTime: BitMask;
40
+ /** CNH (Carteira de Motorista - 11 dígitos) */
41
+ declare const maskCNH: BitMask;
42
+ /** RG (00.000.000-X) - Suporta o 'X' como dígito verificador */
43
+ declare const maskRG: BitMask;
44
+ /**
45
+ * CPF + CNPJ combinado — alterna automaticamente pelo número de dígitos:
46
+ * - Até 11 dígitos → CPF (000.000.000-00)
47
+ * - Mais de 11 → CNPJ (00.000.000/0000-00)
48
+ */
49
+ declare const maskCPFCNPJ: BitMask;
50
+ /**
51
+ * Placa de veículo BR — detecta o formato pelo 5.º caractere:
52
+ * - Antigo → ABC-1234 (posição 5 é dígito)
53
+ * - Mercosul → ABC1D23 (posição 5 é letra)
54
+ */
55
+ declare const maskPlate: BitMask;
56
+ /** US Phone ((000) 000-0000) */
57
+ declare const maskUSPhone: BitMask;
58
+ /** ZIP Code (00000 or 00000-0000) */
59
+ declare const maskZipCode: BitMask;
60
+ /** Date US (MM/DD/YYYY) - Igual ao BR, mas semântica diferente */
61
+ declare const maskDateUS: BitMask;
62
+ /** SSN (Social Security Number) */
63
+ declare const maskSSN: BitMask;
64
+ /** Cartão de Crédito Inteligente (Detecta Visa/Master, Amex e Diners) */
65
+ declare const maskCreditCard: BitMask;
66
+ /** CVV (3 ou 4 dígitos) */
67
+ declare const maskCVV: BitMask;
68
+ /** Data ISO (Ideal para base de dados: YYYY-MM-DD) */
69
+ declare const maskDateISO: BitMask;
70
+ /** Endereço MAC (HH:HH:HH:HH:HH:HH) - Usa o token Hexadecimal */
71
+ declare const maskMacAddress: BitMask;
72
+ /** Cor Hexadecimal (#HHHHHH) */
73
+ declare const maskColorHex: BitMask;
74
+ /** IPv4 (000.000.000.000) - Formato de blocos fixos */
75
+ declare const maskIPv4: BitMask;
76
+ /** IPv6 (HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH) */
77
+ declare const maskIPv6: BitMask;
78
+ /** * IBAN Internacional
79
+ * Força as duas primeiras letras para maiúsculas e agrupa de 4 em 4.
80
+ * O tamanho máximo cobre os 34 caracteres do padrão IBAN.
81
+ */
82
+ declare const maskIBAN: BitMask;
83
+
84
+ declare const bitMasks: Record<BitBuiltInMaskName, BitMask>;
85
+
86
+ export { BitBuiltInMaskName, BitMask, CurrencyMaskConfig, DateMaskConfig, PatternMaskOptions, bitMasks, createCreditCardMask, createCurrencyMask, createDateMask, createPatternMask, maskBRL, maskCEP, maskCNH, maskCNPJ, maskCPF, maskCPFCNPJ, maskCVV, maskColorHex, maskCreditCard, maskDate, maskDateISO, maskDateUS, maskDecimal, maskEUR, maskGBP, maskIBAN, maskIPv4, maskIPv6, maskInteger, maskJPY, maskLandline, maskMacAddress, maskPercent, maskPhone, maskPlate, maskRG, maskSSN, maskTime, maskUSD, maskUSPhone, maskZipCode, unmask, unmaskCurrency };
package/dist/mask.js ADDED
@@ -0,0 +1,2 @@
1
+ import{A as U,B as g,C as J,D as R,E as h,F as v,G as A,H as E,I as F,J as G,K as H,N as L,a,b as s,c as k,d as e,e as m,f as t,g as r,h as C,i as n,j as o,k as P,l as i,m as M,n as c,o as d,p,q as B,r as D,s as N,t as f,u,v as I,w as S,x as l,y as x,z as y}from"./chunk-VDWCFNA6.js";export{L as bitMasks,m as createCreditCardMask,e as createCurrencyMask,t as createDateMask,k as createPatternMask,r as maskBRL,N as maskCEP,I as maskCNH,p as maskCNPJ,d as maskCPF,l as maskCPFCNPJ,h as maskCVV,E as maskColorHex,R as maskCreditCard,f as maskDate,v as maskDateISO,g as maskDateUS,M as maskDecimal,n as maskEUR,o as maskGBP,H as maskIBAN,F as maskIPv4,G as maskIPv6,c as maskInteger,P as maskJPY,D as maskLandline,A as maskMacAddress,i as maskPercent,B as maskPhone,x as maskPlate,S as maskRG,J as maskSSN,u as maskTime,C as maskUSD,y as maskUSPhone,U as maskZipCode,a as unmask,s as unmaskCurrency};
2
+ //# sourceMappingURL=mask.js.map
@@ -1,4 +1,5 @@
1
- import { B as BitConfig, V as ValidatorFn, a as BitMask, b as BitFieldDefinition, D as DevToolsOptions, c as BitPersistResolvedConfig, d as BitPlugin, e as BitState, f as BitPath, g as BitPathValue, h as DeepPartial, i as BitErrors, j as BitMaskName, k as BitArrayPath, l as BitArrayItem, S as ScopeStatus, m as BitFieldState } from './types-DqeN9Kq_.cjs';
1
+ import { i as BitConfig, E as ValidatorFn, e as BitFieldDefinition, G as DevToolsOptions, H as BitPersistResolvedConfig, w as BitPlugin, B as BitState, k as BitPath, m as BitPathValue, D as DeepPartial, f as BitErrors, o as BitArrayPath, p as BitArrayItem, S as ScopeStatus, l as BitFieldState } from './bus-DHQHDwUp.js';
2
+ import { B as BitMask, a as BitMaskName } from './types-D8DgIUhJ.js';
2
3
 
3
4
  type BitSelector<T extends object, TSlice> = (state: Readonly<BitState<T>>) => TSlice;
4
5
  type BitEqualityFn<TValue> = (previous: TValue, next: TValue) => boolean;
@@ -36,6 +37,8 @@ interface BitFrameworkConfig<T extends object = any> extends BitConfig<T> {
36
37
  persist: BitPersistResolvedConfig<T>;
37
38
  plugins: BitPlugin<T>[];
38
39
  }
40
+ interface BitResolvedConfig<T extends object = any> extends BitFrameworkConfig<T> {
41
+ }
39
42
  interface BitStoreApi<T extends object = any> {
40
43
  readonly config: Readonly<BitFrameworkConfig<T>>;
41
44
  getConfig(): Readonly<BitFrameworkConfig<T>>;
@@ -88,4 +91,4 @@ interface BitStoreHooksApi<T extends object = any> extends BitStoreApi<T> {
88
91
  getScopeFields(scopeName: string): string[];
89
92
  }
90
93
 
91
- export type { BitEqualityFn as B, BitFrameworkConfig as a, BitHistoryMetadata as b, BitPersistMetadata as c, BitSelector as d, BitSelectorSubscriptionOptions as e, BitStoreApi as f, BitStoreHooksApi as g, BitValidationOptions as h };
94
+ export type { BitResolvedConfig as B, BitValidationOptions as a, BitSelector as b, BitSelectorSubscriptionOptions as c, BitHistoryMetadata as d, BitStoreApi as e, BitStoreHooksApi as f, BitEqualityFn as g, BitFrameworkConfig as h, BitPersistMetadata as i };
@@ -1,4 +1,5 @@
1
- import { B as BitConfig, V as ValidatorFn, a as BitMask, b as BitFieldDefinition, D as DevToolsOptions, c as BitPersistResolvedConfig, d as BitPlugin, e as BitState, f as BitPath, g as BitPathValue, h as DeepPartial, i as BitErrors, j as BitMaskName, k as BitArrayPath, l as BitArrayItem, S as ScopeStatus, m as BitFieldState } from './types-DqeN9Kq_.js';
1
+ import { i as BitConfig, E as ValidatorFn, e as BitFieldDefinition, G as DevToolsOptions, H as BitPersistResolvedConfig, w as BitPlugin, B as BitState, k as BitPath, m as BitPathValue, D as DeepPartial, f as BitErrors, o as BitArrayPath, p as BitArrayItem, S as ScopeStatus, l as BitFieldState } from './bus-CILR-ENq.cjs';
2
+ import { B as BitMask, a as BitMaskName } from './types-D8DgIUhJ.cjs';
2
3
 
3
4
  type BitSelector<T extends object, TSlice> = (state: Readonly<BitState<T>>) => TSlice;
4
5
  type BitEqualityFn<TValue> = (previous: TValue, next: TValue) => boolean;
@@ -36,6 +37,8 @@ interface BitFrameworkConfig<T extends object = any> extends BitConfig<T> {
36
37
  persist: BitPersistResolvedConfig<T>;
37
38
  plugins: BitPlugin<T>[];
38
39
  }
40
+ interface BitResolvedConfig<T extends object = any> extends BitFrameworkConfig<T> {
41
+ }
39
42
  interface BitStoreApi<T extends object = any> {
40
43
  readonly config: Readonly<BitFrameworkConfig<T>>;
41
44
  getConfig(): Readonly<BitFrameworkConfig<T>>;
@@ -88,4 +91,4 @@ interface BitStoreHooksApi<T extends object = any> extends BitStoreApi<T> {
88
91
  getScopeFields(scopeName: string): string[];
89
92
  }
90
93
 
91
- export type { BitEqualityFn as B, BitFrameworkConfig as a, BitHistoryMetadata as b, BitPersistMetadata as c, BitSelector as d, BitSelectorSubscriptionOptions as e, BitStoreApi as f, BitStoreHooksApi as g, BitValidationOptions as h };
94
+ export type { BitResolvedConfig as B, BitValidationOptions as a, BitSelector as b, BitSelectorSubscriptionOptions as c, BitHistoryMetadata as d, BitStoreApi as e, BitStoreHooksApi as f, BitEqualityFn as g, BitFrameworkConfig as h, BitPersistMetadata as i };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkVSWCUQAFcjs = require('../chunk-VSWCUQAF.cjs');require('../chunk-NWPA4F3B.cjs');require('../chunk-C4BYXZGB.cjs');var _chunk676WXU4Scjs = require('../chunk-676WXU4S.cjs');var _react = require('react');function y(e){let{fieldState:t,setValue:a,setBlur:o,store:r}=_chunkVSWCUQAFcjs.d.call(void 0, e),i=_react.useMemo.call(void 0, ()=>r.resolveMask(e),[r.config.masks,r.config.fields,e]),s=_react.useMemo.call(void 0, ()=>_chunk676WXU4Scjs.V.call(void 0, t.value,_nullishCoalesce(i, () => (void 0))),[t.value,i]),u=_react.useCallback.call(void 0, c=>a(_chunk676WXU4Scjs.W.call(void 0, c,_nullishCoalesce(i, () => (void 0)))),[i,a]),{isHidden:m,isRequired:B,value:l,error:n,touched:d,isDirty:b,isValidating:h}=t,M=!!(d&&n),E=d?n:void 0,x=_react.useCallback.call(void 0, c=>{let P=_optionalChain([c, 'optionalAccess', _ => _.target])?c.target.value:c;u(P)},[u]),F=_react.useCallback.call(void 0, ()=>{o()},[o]);return{value:l,displayValue:s,setValue:u,setBlur:o,onChange:x,onBlur:F,props:{value:s,onChange:x,onBlur:F},meta:{error:E,touched:d,invalid:M,isDirty:b,isValidating:h,isHidden:m,isRequired:B,hasError:!!n}}}function K(){let e=_chunkVSWCUQAFcjs.b.call(void 0, ),t=_react.useRef.call(void 0, null),a=_react.useCallback.call(void 0, ()=>{let s=e.getHistoryMetadata();if(t.current&&t.current.canUndo===s.canUndo&&t.current.canRedo===s.canRedo&&t.current.historyIndex===s.historyIndex&&t.current.historySize===s.historySize)return t.current;let u={canUndo:s.canUndo,canRedo:s.canRedo,historyIndex:s.historyIndex,historySize:s.historySize};return t.current=u,u},[e]),o=_react.useSyncExternalStore.call(void 0, e.subscribe.bind(e),a,a),r=_react.useCallback.call(void 0, ()=>{e.undo()},[e]),i=_react.useCallback.call(void 0, ()=>{e.redo()},[e]);return{...o,undo:r,redo:i}}function W(e,t,a){let o=_chunkVSWCUQAFcjs.b.call(void 0, ),r=y(e),i=_react.useRef.call(void 0, null),[s,u]=_react.useState.call(void 0, !1),m=_react.useCallback.call(void 0, async l=>{if(l){u(!0),o.setError(e,void 0);try{let n=await t(l);r.setValue(n.url),i.current=n.key,o.setError(e,void 0)}catch(n){let d=n instanceof Error?n.message:"Upload failed";o.setError(e,d)}finally{u(!1)}}},[t,r,e,o]),B=_react.useCallback.call(void 0, async()=>{let l=i.current;if(l&&a)try{await a(l)}catch(n){let d=n instanceof Error?n.message:"Delete failed";o.setError(e,d);return}r.setValue(null),i.current=null,o.setError(e,void 0)},[a,r,e,o]);return{value:r.value,setValue:r.setValue,error:_optionalChain([r, 'access', _2 => _2.meta, 'optionalAccess', _3 => _3.error]),isValidating:!!_optionalChain([r, 'access', _4 => _4.meta, 'optionalAccess', _5 => _5.isValidating])||s,upload:m,remove:B}}exports.BitFormProvider = _chunkVSWCUQAFcjs.a; exports.useBitArray = _chunkVSWCUQAFcjs.e; exports.useBitField = y; exports.useBitForm = _chunkVSWCUQAFcjs.c; exports.useBitHistory = K; exports.useBitPersist = _chunkVSWCUQAFcjs.i; exports.useBitScope = _chunkVSWCUQAFcjs.f; exports.useBitSteps = _chunkVSWCUQAFcjs.g; exports.useBitStore = _chunkVSWCUQAFcjs.b; exports.useBitUpload = W; exports.useBitWatch = _chunkVSWCUQAFcjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkT3XN5O7Vcjs = require('../chunk-T3XN5O7V.cjs');require('../chunk-NNKZFXEK.cjs');require('../chunk-JO37BU2C.cjs');var _chunkPA6T2CBRcjs = require('../chunk-PA6T2CBR.cjs');var _react = require('react');function y(e){let{fieldState:t,setValue:a,setBlur:o,store:r}=_chunkT3XN5O7Vcjs.d.call(void 0, e),i=_react.useMemo.call(void 0, ()=>r.resolveMask(e),[r.config.masks,r.config.fields,e]),s=_react.useMemo.call(void 0, ()=>_chunkPA6T2CBRcjs.L.call(void 0, t.value,_nullishCoalesce(i, () => (void 0))),[t.value,i]),u=_react.useCallback.call(void 0, c=>a(_chunkPA6T2CBRcjs.M.call(void 0, c,_nullishCoalesce(i, () => (void 0)))),[i,a]),{isHidden:m,isRequired:B,value:l,error:n,touched:d,isDirty:b,isValidating:h}=t,M=!!(d&&n),E=d?n:void 0,x=_react.useCallback.call(void 0, c=>{let P=_optionalChain([c, 'optionalAccess', _ => _.target])?c.target.value:c;u(P)},[u]),F=_react.useCallback.call(void 0, ()=>{o()},[o]);return{value:l,displayValue:s,setValue:u,setBlur:o,onChange:x,onBlur:F,props:{value:s,onChange:x,onBlur:F},meta:{error:E,touched:d,invalid:M,isDirty:b,isValidating:h,isHidden:m,isRequired:B,hasError:!!n}}}function K(){let e=_chunkT3XN5O7Vcjs.b.call(void 0, ),t=_react.useRef.call(void 0, null),a=_react.useCallback.call(void 0, ()=>{let s=e.getHistoryMetadata();if(t.current&&t.current.canUndo===s.canUndo&&t.current.canRedo===s.canRedo&&t.current.historyIndex===s.historyIndex&&t.current.historySize===s.historySize)return t.current;let u={canUndo:s.canUndo,canRedo:s.canRedo,historyIndex:s.historyIndex,historySize:s.historySize};return t.current=u,u},[e]),o=_react.useSyncExternalStore.call(void 0, e.subscribe.bind(e),a,a),r=_react.useCallback.call(void 0, ()=>{e.undo()},[e]),i=_react.useCallback.call(void 0, ()=>{e.redo()},[e]);return{...o,undo:r,redo:i}}function W(e,t,a){let o=_chunkT3XN5O7Vcjs.b.call(void 0, ),r=y(e),i=_react.useRef.call(void 0, null),[s,u]=_react.useState.call(void 0, !1),m=_react.useCallback.call(void 0, async l=>{if(l){u(!0),o.setError(e,void 0);try{let n=await t(l);r.setValue(n.url),i.current=n.key,o.setError(e,void 0)}catch(n){let d=n instanceof Error?n.message:"Upload failed";o.setError(e,d)}finally{u(!1)}}},[t,r,e,o]),B=_react.useCallback.call(void 0, async()=>{let l=i.current;if(l&&a)try{await a(l)}catch(n){let d=n instanceof Error?n.message:"Delete failed";o.setError(e,d);return}r.setValue(null),i.current=null,o.setError(e,void 0)},[a,r,e,o]);return{value:r.value,setValue:r.setValue,error:_optionalChain([r, 'access', _2 => _2.meta, 'optionalAccess', _3 => _3.error]),isValidating:!!_optionalChain([r, 'access', _4 => _4.meta, 'optionalAccess', _5 => _5.isValidating])||s,upload:m,remove:B}}exports.BitFormProvider = _chunkT3XN5O7Vcjs.a; exports.useBitArray = _chunkT3XN5O7Vcjs.e; exports.useBitField = y; exports.useBitForm = _chunkT3XN5O7Vcjs.c; exports.useBitHistory = K; exports.useBitPersist = _chunkT3XN5O7Vcjs.i; exports.useBitScope = _chunkT3XN5O7Vcjs.f; exports.useBitSteps = _chunkT3XN5O7Vcjs.g; exports.useBitStore = _chunkT3XN5O7Vcjs.b; exports.useBitUpload = W; exports.useBitWatch = _chunkT3XN5O7Vcjs.h;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,12 +1,12 @@
1
- import { g as UseBitFieldResult, h as UseBitHistoryResult, i as UseBitUploadResult } from '../use-bit-persist-BgFBg8lQ.cjs';
2
- export { B as BitFormProvider, j as UseBitFieldBindProps, k as UseBitFieldMeta, U as UseBitPersistResult, l as UseBitStepsResult, u as useBitArray, a as useBitForm, b as useBitPersist, c as useBitScope, d as useBitSteps, e as useBitStore, f as useBitWatch } from '../use-bit-persist-BgFBg8lQ.cjs';
3
- import { f as BitPath } from '../types-DqeN9Kq_.cjs';
4
- export { S as ScopeStatus, n as ValidateScopeResult } from '../types-DqeN9Kq_.cjs';
5
- import '../bus-BI29cKpD.cjs';
1
+ import { U as UseBitFieldResult, a as UseBitHistoryResult, b as UseBitUploadResult } from '../use-bit-persist-DEWMhvit.cjs';
2
+ export { B as BitFormProvider, c as UseBitFieldBindProps, d as UseBitFieldMeta, e as UseBitPersistResult, f as UseBitStepsResult, u as useBitArray, g as useBitForm, h as useBitPersist, i as useBitScope, j as useBitSteps, k as useBitStore, l as useBitWatch } from '../use-bit-persist-DEWMhvit.cjs';
3
+ import { k as BitPath } from '../bus-CILR-ENq.cjs';
4
+ export { S as ScopeStatus, V as ValidateScopeResult } from '../bus-CILR-ENq.cjs';
6
5
  import { a as BitUploadFn, B as BitDeleteUploadFn } from '../types-C2mpfhp1.cjs';
7
6
  import 'react/jsx-runtime';
8
7
  import 'react';
9
- import '../public-types-CLIDR8aC.cjs';
8
+ import '../public-types-SU17BarA.cjs';
9
+ import '../types-D8DgIUhJ.cjs';
10
10
 
11
11
  declare function useBitField<TForm extends object = any, P extends BitPath<TForm> = BitPath<TForm>>(path: P): UseBitFieldResult<TForm, P>;
12
12
 
@@ -1,12 +1,12 @@
1
- import { g as UseBitFieldResult, h as UseBitHistoryResult, i as UseBitUploadResult } from '../use-bit-persist-JtinX6Vy.js';
2
- export { B as BitFormProvider, j as UseBitFieldBindProps, k as UseBitFieldMeta, U as UseBitPersistResult, l as UseBitStepsResult, u as useBitArray, a as useBitForm, b as useBitPersist, c as useBitScope, d as useBitSteps, e as useBitStore, f as useBitWatch } from '../use-bit-persist-JtinX6Vy.js';
3
- import { f as BitPath } from '../types-DqeN9Kq_.js';
4
- export { S as ScopeStatus, n as ValidateScopeResult } from '../types-DqeN9Kq_.js';
5
- import '../bus-B1my-s_o.js';
1
+ import { U as UseBitFieldResult, a as UseBitHistoryResult, b as UseBitUploadResult } from '../use-bit-persist-BlR-hHk6.js';
2
+ export { B as BitFormProvider, c as UseBitFieldBindProps, d as UseBitFieldMeta, e as UseBitPersistResult, f as UseBitStepsResult, u as useBitArray, g as useBitForm, h as useBitPersist, i as useBitScope, j as useBitSteps, k as useBitStore, l as useBitWatch } from '../use-bit-persist-BlR-hHk6.js';
3
+ import { k as BitPath } from '../bus-DHQHDwUp.js';
4
+ export { S as ScopeStatus, V as ValidateScopeResult } from '../bus-DHQHDwUp.js';
6
5
  import { a as BitUploadFn, B as BitDeleteUploadFn } from '../types-C2mpfhp1.js';
7
6
  import 'react/jsx-runtime';
8
7
  import 'react';
9
- import '../public-types-Bl94ECPb.js';
8
+ import '../public-types-Bgws0aVJ.js';
9
+ import '../types-D8DgIUhJ.js';
10
10
 
11
11
  declare function useBitField<TForm extends object = any, P extends BitPath<TForm> = BitPath<TForm>>(path: P): UseBitFieldResult<TForm, P>;
12
12
 
@@ -1,2 +1,2 @@
1
- import{a as k,b as p,c as T,d as g,e as H,f as I,g as z,h as C,i as D}from"../chunk-TRPMTJ35.js";import"../chunk-O5RRLZR7.js";import"../chunk-AD7T42HJ.js";import{V as R,W as S}from"../chunk-2UVV7SU4.js";import{useMemo as V,useCallback as f}from"react";function y(e){let{fieldState:t,setValue:a,setBlur:o,store:r}=g(e),i=V(()=>r.resolveMask(e),[r.config.masks,r.config.fields,e]),s=V(()=>R(t.value,i??void 0),[t.value,i]),u=f(c=>a(S(c,i??void 0)),[i,a]),{isHidden:m,isRequired:B,value:l,error:n,touched:d,isDirty:b,isValidating:h}=t,M=!!(d&&n),E=d?n:void 0,x=f(c=>{let P=c?.target?c.target.value:c;u(P)},[u]),F=f(()=>{o()},[o]);return{value:l,displayValue:s,setValue:u,setBlur:o,onChange:x,onBlur:F,props:{value:s,onChange:x,onBlur:F},meta:{error:E,touched:d,invalid:M,isDirty:b,isValidating:h,isHidden:m,isRequired:B,hasError:!!n}}}import{useCallback as U,useRef as w,useSyncExternalStore as j}from"react";function K(){let e=p(),t=w(null),a=U(()=>{let s=e.getHistoryMetadata();if(t.current&&t.current.canUndo===s.canUndo&&t.current.canRedo===s.canRedo&&t.current.historyIndex===s.historyIndex&&t.current.historySize===s.historySize)return t.current;let u={canUndo:s.canUndo,canRedo:s.canRedo,historyIndex:s.historyIndex,historySize:s.historySize};return t.current=u,u},[e]),o=j(e.subscribe.bind(e),a,a),r=U(()=>{e.undo()},[e]),i=U(()=>{e.redo()},[e]);return{...o,undo:r,redo:i}}import{useCallback as v,useRef as q,useState as A}from"react";function W(e,t,a){let o=p(),r=y(e),i=q(null),[s,u]=A(!1),m=v(async l=>{if(l){u(!0),o.setError(e,void 0);try{let n=await t(l);r.setValue(n.url),i.current=n.key,o.setError(e,void 0)}catch(n){let d=n instanceof Error?n.message:"Upload failed";o.setError(e,d)}finally{u(!1)}}},[t,r,e,o]),B=v(async()=>{let l=i.current;if(l&&a)try{await a(l)}catch(n){let d=n instanceof Error?n.message:"Delete failed";o.setError(e,d);return}r.setValue(null),i.current=null,o.setError(e,void 0)},[a,r,e,o]);return{value:r.value,setValue:r.setValue,error:r.meta?.error,isValidating:!!r.meta?.isValidating||s,upload:m,remove:B}}export{k as BitFormProvider,H as useBitArray,y as useBitField,T as useBitForm,K as useBitHistory,D as useBitPersist,I as useBitScope,z as useBitSteps,p as useBitStore,W as useBitUpload,C as useBitWatch};
1
+ import{a as k,b as p,c as T,d as g,e as H,f as I,g as z,h as C,i as D}from"../chunk-3MUULXXZ.js";import"../chunk-FEW3ABPD.js";import"../chunk-ULC4OPIQ.js";import{L as R,M as S}from"../chunk-VDWCFNA6.js";import{useMemo as V,useCallback as f}from"react";function y(e){let{fieldState:t,setValue:a,setBlur:o,store:r}=g(e),i=V(()=>r.resolveMask(e),[r.config.masks,r.config.fields,e]),s=V(()=>R(t.value,i??void 0),[t.value,i]),u=f(c=>a(S(c,i??void 0)),[i,a]),{isHidden:m,isRequired:B,value:l,error:n,touched:d,isDirty:b,isValidating:h}=t,M=!!(d&&n),E=d?n:void 0,x=f(c=>{let P=c?.target?c.target.value:c;u(P)},[u]),F=f(()=>{o()},[o]);return{value:l,displayValue:s,setValue:u,setBlur:o,onChange:x,onBlur:F,props:{value:s,onChange:x,onBlur:F},meta:{error:E,touched:d,invalid:M,isDirty:b,isValidating:h,isHidden:m,isRequired:B,hasError:!!n}}}import{useCallback as U,useRef as w,useSyncExternalStore as j}from"react";function K(){let e=p(),t=w(null),a=U(()=>{let s=e.getHistoryMetadata();if(t.current&&t.current.canUndo===s.canUndo&&t.current.canRedo===s.canRedo&&t.current.historyIndex===s.historyIndex&&t.current.historySize===s.historySize)return t.current;let u={canUndo:s.canUndo,canRedo:s.canRedo,historyIndex:s.historyIndex,historySize:s.historySize};return t.current=u,u},[e]),o=j(e.subscribe.bind(e),a,a),r=U(()=>{e.undo()},[e]),i=U(()=>{e.redo()},[e]);return{...o,undo:r,redo:i}}import{useCallback as v,useRef as q,useState as A}from"react";function W(e,t,a){let o=p(),r=y(e),i=q(null),[s,u]=A(!1),m=v(async l=>{if(l){u(!0),o.setError(e,void 0);try{let n=await t(l);r.setValue(n.url),i.current=n.key,o.setError(e,void 0)}catch(n){let d=n instanceof Error?n.message:"Upload failed";o.setError(e,d)}finally{u(!1)}}},[t,r,e,o]),B=v(async()=>{let l=i.current;if(l&&a)try{await a(l)}catch(n){let d=n instanceof Error?n.message:"Delete failed";o.setError(e,d);return}r.setValue(null),i.current=null,o.setError(e,void 0)},[a,r,e,o]);return{value:r.value,setValue:r.setValue,error:r.meta?.error,isValidating:!!r.meta?.isValidating||s,upload:m,remove:B}}export{k as BitFormProvider,H as useBitArray,y as useBitField,T as useBitForm,K as useBitHistory,D as useBitPersist,I as useBitScope,z as useBitSteps,p as useBitStore,W as useBitUpload,C as useBitWatch};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkVSWCUQAFcjs = require('../chunk-VSWCUQAF.cjs');require('../chunk-NWPA4F3B.cjs');require('../chunk-C4BYXZGB.cjs');var _chunk676WXU4Scjs = require('../chunk-676WXU4S.cjs');var _react = require('react');function E(r){let{fieldState:o,setValue:t,setBlur:s,store:i}=_chunkVSWCUQAFcjs.d.call(void 0, r),e=_react.useMemo.call(void 0, ()=>i.resolveMask(r),[i.config.masks,i.config.fields,r]),m=_react.useMemo.call(void 0, ()=>_chunk676WXU4Scjs.V.call(void 0, o.value,_nullishCoalesce(e, () => (void 0))),[o.value,e]),p=_react.useCallback.call(void 0, u=>t(_chunk676WXU4Scjs.W.call(void 0, u,_nullishCoalesce(e, () => (void 0)))),[e,t]),x=_react.useCallback.call(void 0, u=>t(_chunk676WXU4Scjs.W.call(void 0, u,_nullishCoalesce(e, () => (void 0)))),[e,t]),{isHidden:P,isRequired:v,value:y,error:a,touched:n,isDirty:h,isValidating:V}=o,T=!!(n&&a),g=n?a:void 0,B=_react.useCallback.call(void 0, ()=>{s()},[s]);return{value:y,displayValue:m,setValue:x,setBlur:s,onChangeText:p,onBlur:B,meta:{error:g,touched:n,invalid:T,isValidating:V,isDirty:h,isHidden:P,isRequired:v,hasError:!!a},props:{value:m,onChangeText:p,onBlur:B}}}exports.BitFormProvider = _chunkVSWCUQAFcjs.a; exports.useBitArray = _chunkVSWCUQAFcjs.e; exports.useBitField = E; exports.useBitForm = _chunkVSWCUQAFcjs.c; exports.useBitPersist = _chunkVSWCUQAFcjs.i; exports.useBitScope = _chunkVSWCUQAFcjs.f; exports.useBitSteps = _chunkVSWCUQAFcjs.g; exports.useBitStore = _chunkVSWCUQAFcjs.b; exports.useBitWatch = _chunkVSWCUQAFcjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkT3XN5O7Vcjs = require('../chunk-T3XN5O7V.cjs');require('../chunk-NNKZFXEK.cjs');require('../chunk-JO37BU2C.cjs');var _chunkPA6T2CBRcjs = require('../chunk-PA6T2CBR.cjs');var _react = require('react');function E(r){let{fieldState:o,setValue:t,setBlur:s,store:i}=_chunkT3XN5O7Vcjs.d.call(void 0, r),e=_react.useMemo.call(void 0, ()=>i.resolveMask(r),[i.config.masks,i.config.fields,r]),m=_react.useMemo.call(void 0, ()=>_chunkPA6T2CBRcjs.L.call(void 0, o.value,_nullishCoalesce(e, () => (void 0))),[o.value,e]),p=_react.useCallback.call(void 0, u=>t(_chunkPA6T2CBRcjs.M.call(void 0, u,_nullishCoalesce(e, () => (void 0)))),[e,t]),x=_react.useCallback.call(void 0, u=>t(_chunkPA6T2CBRcjs.M.call(void 0, u,_nullishCoalesce(e, () => (void 0)))),[e,t]),{isHidden:P,isRequired:v,value:y,error:a,touched:n,isDirty:h,isValidating:V}=o,T=!!(n&&a),g=n?a:void 0,B=_react.useCallback.call(void 0, ()=>{s()},[s]);return{value:y,displayValue:m,setValue:x,setBlur:s,onChangeText:p,onBlur:B,meta:{error:g,touched:n,invalid:T,isValidating:V,isDirty:h,isHidden:P,isRequired:v,hasError:!!a},props:{value:m,onChangeText:p,onBlur:B}}}exports.BitFormProvider = _chunkT3XN5O7Vcjs.a; exports.useBitArray = _chunkT3XN5O7Vcjs.e; exports.useBitField = E; exports.useBitForm = _chunkT3XN5O7Vcjs.c; exports.useBitPersist = _chunkT3XN5O7Vcjs.i; exports.useBitScope = _chunkT3XN5O7Vcjs.f; exports.useBitSteps = _chunkT3XN5O7Vcjs.g; exports.useBitStore = _chunkT3XN5O7Vcjs.b; exports.useBitWatch = _chunkT3XN5O7Vcjs.h;
2
2
  //# sourceMappingURL=index.cjs.map