@lehnihon/bit-form 2.1.2 → 2.2.1

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 (67) hide show
  1. package/README.md +6 -0
  2. package/dist/angular/index.cjs +1 -1
  3. package/dist/angular/index.cjs.map +1 -1
  4. package/dist/angular/index.d.cts +29 -17
  5. package/dist/angular/index.d.ts +29 -17
  6. package/dist/angular/index.js +1 -1
  7. package/dist/angular/index.js.map +1 -1
  8. package/dist/bus-B3pGaiFZ.d.cts +255 -0
  9. package/dist/bus-B3pGaiFZ.d.ts +255 -0
  10. package/dist/chunk-442A4FTZ.cjs +2 -0
  11. package/dist/chunk-442A4FTZ.cjs.map +1 -0
  12. package/dist/chunk-6FJEE6O3.js +133 -0
  13. package/dist/chunk-6FJEE6O3.js.map +1 -0
  14. package/dist/chunk-FOV24ACZ.js +2 -0
  15. package/dist/chunk-FOV24ACZ.js.map +1 -0
  16. package/dist/chunk-YWXX6XRV.cjs +133 -0
  17. package/dist/chunk-YWXX6XRV.cjs.map +1 -0
  18. package/dist/devtools/bridge.cjs +1 -1
  19. package/dist/devtools/bridge.js +1 -1
  20. package/dist/devtools/index.cjs +1 -1
  21. package/dist/devtools/index.js +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +7 -6
  25. package/dist/index.d.ts +7 -6
  26. package/dist/index.js +1 -1
  27. package/dist/public-types-CtYuIAMP.d.cts +99 -0
  28. package/dist/public-types-Lq3eLstW.d.ts +99 -0
  29. package/dist/react/index.cjs +1 -1
  30. package/dist/react/index.cjs.map +1 -1
  31. package/dist/react/index.d.cts +5 -5
  32. package/dist/react/index.d.ts +5 -5
  33. package/dist/react/index.js +1 -1
  34. package/dist/react/index.js.map +1 -1
  35. package/dist/react-native/index.cjs +1 -1
  36. package/dist/react-native/index.cjs.map +1 -1
  37. package/dist/react-native/index.d.cts +10 -12
  38. package/dist/react-native/index.d.ts +10 -12
  39. package/dist/react-native/index.js +1 -1
  40. package/dist/react-native/index.js.map +1 -1
  41. package/dist/resolvers/joi.d.cts +1 -1
  42. package/dist/resolvers/joi.d.ts +1 -1
  43. package/dist/resolvers/yup.d.cts +1 -1
  44. package/dist/resolvers/yup.d.ts +1 -1
  45. package/dist/resolvers/zod.d.cts +1 -1
  46. package/dist/resolvers/zod.d.ts +1 -1
  47. package/dist/{use-bit-watch-hA0AqCkC.d.ts → use-bit-persist-CWzGfovL.d.cts} +27 -19
  48. package/dist/{use-bit-watch-BRekIj2W.d.cts → use-bit-persist-hxJaKG2S.d.ts} +27 -19
  49. package/dist/vue/index.cjs +1 -1
  50. package/dist/vue/index.cjs.map +1 -1
  51. package/dist/vue/index.d.cts +45 -33
  52. package/dist/vue/index.d.ts +45 -33
  53. package/dist/vue/index.js +1 -1
  54. package/dist/vue/index.js.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/bus-vCbulIYH.d.cts +0 -141
  57. package/dist/bus-vCbulIYH.d.ts +0 -141
  58. package/dist/chunk-2QNUW6ZN.cjs +0 -133
  59. package/dist/chunk-2QNUW6ZN.cjs.map +0 -1
  60. package/dist/chunk-F6LJWWEW.js +0 -2
  61. package/dist/chunk-F6LJWWEW.js.map +0 -1
  62. package/dist/chunk-LPRLSFPT.cjs +0 -2
  63. package/dist/chunk-LPRLSFPT.cjs.map +0 -1
  64. package/dist/chunk-N6IA7HQL.js +0 -133
  65. package/dist/chunk-N6IA7HQL.js.map +0 -1
  66. package/dist/public-types-ChP5j3xc.d.ts +0 -69
  67. package/dist/public-types-Nv__uZTR.d.cts +0 -69
@@ -1,69 +0,0 @@
1
- import { B as BitConfig, q as ValidatorFn, a as BitMask, g as BitFieldDefinition, s as DevToolsOptions, l as BitState, j as BitPath, k as BitPathValue, e as BitErrors, S as ScopeStatus } from './bus-vCbulIYH.js';
2
-
3
- interface BitFrameworkConfig<T extends object = any> extends BitConfig<T> {
4
- initialValues: T;
5
- resolver?: ValidatorFn<T>;
6
- validationDelay: number;
7
- enableHistory: boolean;
8
- historyLimit: number;
9
- masks?: Record<string, BitMask>;
10
- fields?: Record<string, BitFieldDefinition<T>>;
11
- devTools?: boolean | DevToolsOptions;
12
- }
13
- interface BitPublicStore<T extends object = any> {
14
- getConfig(): Readonly<BitFrameworkConfig<T>>;
15
- getState(): Readonly<BitState<T>>;
16
- subscribe(listener: () => void): () => void;
17
- setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
18
- blurField<P extends BitPath<T>>(path: P): void;
19
- setValues(values: T): void;
20
- setError(path: string, message: string | undefined): void;
21
- setErrors(errors: BitErrors<T>): void;
22
- setServerErrors(serverErrors: Record<string, string[] | string>): void;
23
- validate(options?: {
24
- scope?: string;
25
- scopeFields?: string[];
26
- }): Promise<boolean>;
27
- reset(): void;
28
- submit(onSuccess: (values: T, dirtyValues?: Partial<T>) => void | Promise<void>): Promise<void>;
29
- registerMask(name: string, mask: BitMask): void;
30
- getDirtyValues(): Partial<T>;
31
- cleanup(): void;
32
- }
33
- interface BitFrameworkStore<T extends object = any> extends BitPublicStore<T> {
34
- config: BitFrameworkConfig<T>;
35
- registerField(path: string, config: BitFieldDefinition<T>): void;
36
- unregisterField(path: string): void;
37
- unregisterPrefix?(prefix: string): void;
38
- isHidden(path: any): boolean;
39
- isRequired(path: any): boolean;
40
- isFieldDirty(path: string): boolean;
41
- isFieldValidating(path: string): boolean;
42
- watch(path: any, callback: (value: any) => void): () => void;
43
- pushItem(path: any, value: any): void;
44
- prependItem(path: any, value: any): void;
45
- insertItem(path: any, index: number, value: any): void;
46
- removeItem(path: any, index: number): void;
47
- moveItem(path: any, from: number, to: number): void;
48
- swapItems(path: any, indexA: number, indexB: number): void;
49
- getHistoryMetadata(): {
50
- canUndo: boolean;
51
- canRedo: boolean;
52
- historyIndex: number;
53
- historySize: number;
54
- };
55
- undo(): void;
56
- redo(): void;
57
- getStepStatus(scopeName: string): ScopeStatus;
58
- getStepErrors(scopeName: string): Record<string, string>;
59
- markFieldsTouched(paths: string[]): void;
60
- hasValidationsInProgress(scopeFields?: string[]): boolean;
61
- beginFieldValidation(path: string): void;
62
- endFieldValidation(path: string): void;
63
- setFieldAsyncError(path: string, message: string): Promise<void>;
64
- clearFieldAsyncError(path: string): Promise<void>;
65
- resolveMask(path: string): BitMask | undefined;
66
- getScopeFields(scopeName: string): string[];
67
- }
68
-
69
- export type { BitPublicStore as B, BitFrameworkConfig as a, BitFrameworkStore as b };
@@ -1,69 +0,0 @@
1
- import { B as BitConfig, q as ValidatorFn, a as BitMask, g as BitFieldDefinition, s as DevToolsOptions, l as BitState, j as BitPath, k as BitPathValue, e as BitErrors, S as ScopeStatus } from './bus-vCbulIYH.cjs';
2
-
3
- interface BitFrameworkConfig<T extends object = any> extends BitConfig<T> {
4
- initialValues: T;
5
- resolver?: ValidatorFn<T>;
6
- validationDelay: number;
7
- enableHistory: boolean;
8
- historyLimit: number;
9
- masks?: Record<string, BitMask>;
10
- fields?: Record<string, BitFieldDefinition<T>>;
11
- devTools?: boolean | DevToolsOptions;
12
- }
13
- interface BitPublicStore<T extends object = any> {
14
- getConfig(): Readonly<BitFrameworkConfig<T>>;
15
- getState(): Readonly<BitState<T>>;
16
- subscribe(listener: () => void): () => void;
17
- setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
18
- blurField<P extends BitPath<T>>(path: P): void;
19
- setValues(values: T): void;
20
- setError(path: string, message: string | undefined): void;
21
- setErrors(errors: BitErrors<T>): void;
22
- setServerErrors(serverErrors: Record<string, string[] | string>): void;
23
- validate(options?: {
24
- scope?: string;
25
- scopeFields?: string[];
26
- }): Promise<boolean>;
27
- reset(): void;
28
- submit(onSuccess: (values: T, dirtyValues?: Partial<T>) => void | Promise<void>): Promise<void>;
29
- registerMask(name: string, mask: BitMask): void;
30
- getDirtyValues(): Partial<T>;
31
- cleanup(): void;
32
- }
33
- interface BitFrameworkStore<T extends object = any> extends BitPublicStore<T> {
34
- config: BitFrameworkConfig<T>;
35
- registerField(path: string, config: BitFieldDefinition<T>): void;
36
- unregisterField(path: string): void;
37
- unregisterPrefix?(prefix: string): void;
38
- isHidden(path: any): boolean;
39
- isRequired(path: any): boolean;
40
- isFieldDirty(path: string): boolean;
41
- isFieldValidating(path: string): boolean;
42
- watch(path: any, callback: (value: any) => void): () => void;
43
- pushItem(path: any, value: any): void;
44
- prependItem(path: any, value: any): void;
45
- insertItem(path: any, index: number, value: any): void;
46
- removeItem(path: any, index: number): void;
47
- moveItem(path: any, from: number, to: number): void;
48
- swapItems(path: any, indexA: number, indexB: number): void;
49
- getHistoryMetadata(): {
50
- canUndo: boolean;
51
- canRedo: boolean;
52
- historyIndex: number;
53
- historySize: number;
54
- };
55
- undo(): void;
56
- redo(): void;
57
- getStepStatus(scopeName: string): ScopeStatus;
58
- getStepErrors(scopeName: string): Record<string, string>;
59
- markFieldsTouched(paths: string[]): void;
60
- hasValidationsInProgress(scopeFields?: string[]): boolean;
61
- beginFieldValidation(path: string): void;
62
- endFieldValidation(path: string): void;
63
- setFieldAsyncError(path: string, message: string): Promise<void>;
64
- clearFieldAsyncError(path: string): Promise<void>;
65
- resolveMask(path: string): BitMask | undefined;
66
- getScopeFields(scopeName: string): string[];
67
- }
68
-
69
- export type { BitPublicStore as B, BitFrameworkConfig as a, BitFrameworkStore as b };