@fuf-stack/uniform 1.18.2 → 1.18.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.
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +1 -1
- package/dist/{FieldArray-C53ox8yB.js → FieldArray-Bs2ViU8m.js} +2 -2
- package/dist/{FieldArray-C53ox8yB.js.map → FieldArray-Bs2ViU8m.js.map} +1 -1
- package/dist/{FieldArray-BnZW6fwm.cjs → FieldArray-C6RHZcKa.cjs} +2 -2
- package/dist/{FieldArray-BnZW6fwm.cjs.map → FieldArray-C6RHZcKa.cjs.map} +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/Form/index.d.cts +1 -1
- package/dist/Grid/index.cjs +1 -1
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +1 -1
- package/dist/{Grid-CeaybCIF.js → Grid-BaqBa1ku.js} +2 -2
- package/dist/{Grid-CeaybCIF.js.map → Grid-BaqBa1ku.js.map} +1 -1
- package/dist/{Grid-CE1fZKmV.cjs → Grid-D5Yf0nD_.cjs} +2 -2
- package/dist/{Grid-CE1fZKmV.cjs.map → Grid-D5Yf0nD_.cjs.map} +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/helpers/index.d.cts +2 -224
- package/dist/helpers/index.d.ts +2 -224
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +1 -2
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +2 -2
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +23 -3
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/{index-D6strMx0.d.ts → index--KhDRPu3.d.cts} +6 -6
- package/dist/{index-C_EyZKET.d.cts.map → index--KhDRPu3.d.cts.map} +1 -1
- package/dist/{index-C6iTO4TR.d.cts → index-B0rp5NJy.d.cts} +35 -35
- package/dist/{index-C6iTO4TR.d.cts.map → index-B0rp5NJy.d.cts.map} +1 -1
- package/dist/{index-CuNl43Zr.d.ts → index-B7Xz_OY2.d.cts} +1 -1
- package/dist/{index-DuJr42nE.d.cts.map → index-B7Xz_OY2.d.cts.map} +1 -1
- package/dist/index-BBw9RSKy.d.ts +278 -0
- package/dist/{index-Ca2ovPTq.d.ts.map → index-BBw9RSKy.d.ts.map} +1 -1
- package/dist/{index-D0OJCk7N.d.ts → index-BKQc5PQn.d.cts} +34 -34
- package/dist/{index-BtX5upPu.d.cts.map → index-BKQc5PQn.d.cts.map} +1 -1
- package/dist/index-BLgXFM85.d.cts +224 -0
- package/dist/index-BLgXFM85.d.cts.map +1 -0
- package/dist/{index-BE6hzbN3.d.cts → index-BNYtqtXt.d.cts} +3 -3
- package/dist/{index-BE6hzbN3.d.cts.map → index-BNYtqtXt.d.cts.map} +1 -1
- package/dist/{index-CHACvIcy.d.ts → index-BaxXDaOZ.d.ts} +35 -35
- package/dist/{index-CHACvIcy.d.ts.map → index-BaxXDaOZ.d.ts.map} +1 -1
- package/dist/{index-C_EyZKET.d.cts → index-BgyvEfYZ.d.ts} +6 -6
- package/dist/{index-D6strMx0.d.ts.map → index-BgyvEfYZ.d.ts.map} +1 -1
- package/dist/index-BjHnNRSC.d.cts +278 -0
- package/dist/{index-CM7UugT3.d.cts.map → index-BjHnNRSC.d.cts.map} +1 -1
- package/dist/{index-QFAAtvOV.d.cts → index-Bl1Adhfx.d.ts} +6 -6
- package/dist/{index-DhayQWKz.d.ts.map → index-Bl1Adhfx.d.ts.map} +1 -1
- package/dist/{index-BvRjEXt-.d.ts → index-BlJFGN_o.d.ts} +48 -48
- package/dist/{index-BvRjEXt-.d.ts.map → index-BlJFGN_o.d.ts.map} +1 -1
- package/dist/{index-BRvTllFR.d.cts → index-BlX_mF6D.d.cts} +21 -21
- package/dist/{index-BRvTllFR.d.cts.map → index-BlX_mF6D.d.cts.map} +1 -1
- package/dist/{index-DqY28C4j.d.cts → index-BrMk3Wee.d.ts} +4 -4
- package/dist/{index-BdrSpcmR.d.ts.map → index-BrMk3Wee.d.ts.map} +1 -1
- package/dist/{index-HfbCo9ep.d.cts → index-BsCPUK2g.d.cts} +48 -48
- package/dist/{index-HfbCo9ep.d.cts.map → index-BsCPUK2g.d.cts.map} +1 -1
- package/dist/{index-B3ly1uwg.d.ts → index-ByyEP8UR.d.cts} +6 -6
- package/dist/{index-CxeYvJ7m.d.cts.map → index-ByyEP8UR.d.cts.map} +1 -1
- package/dist/{index-D_iyWuBa.d.cts → index-C1-F9Ga-.d.cts} +6 -6
- package/dist/{index-D_iyWuBa.d.cts.map → index-C1-F9Ga-.d.cts.map} +1 -1
- package/dist/{index-DuJr42nE.d.cts → index-CI0AWMsR.d.ts} +3 -3
- package/dist/{index-CuNl43Zr.d.ts.map → index-CI0AWMsR.d.ts.map} +1 -1
- package/dist/{index-DmlsX2k6.d.ts → index-CMehV9mc.d.ts} +3 -3
- package/dist/index-CMehV9mc.d.ts.map +1 -0
- package/dist/{index-DIMnCRyt.d.ts → index-CPkTYivq.d.ts} +3 -3
- package/dist/{index-DIMnCRyt.d.ts.map → index-CPkTYivq.d.ts.map} +1 -1
- package/dist/{index-Dkfbf-VN.d.ts → index-CZq5eXSP.d.ts} +34 -34
- package/dist/{index-Dkfbf-VN.d.ts.map → index-CZq5eXSP.d.ts.map} +1 -1
- package/dist/{index-_6c2OwSa.d.cts → index-CeiIXmAI.d.cts} +36 -36
- package/dist/{index-_6c2OwSa.d.cts.map → index-CeiIXmAI.d.cts.map} +1 -1
- package/dist/{index-DhayQWKz.d.ts → index-DFzyOxvt.d.cts} +6 -6
- package/dist/{index-QFAAtvOV.d.cts.map → index-DFzyOxvt.d.cts.map} +1 -1
- package/dist/{index-NykXDzr-.d.cts → index-DLR8z1lG.d.cts} +3 -3
- package/dist/{index-NykXDzr-.d.cts.map → index-DLR8z1lG.d.cts.map} +1 -1
- package/dist/{index-CxeYvJ7m.d.cts → index-DVZCz730.d.ts} +6 -6
- package/dist/{index-B3ly1uwg.d.ts.map → index-DVZCz730.d.ts.map} +1 -1
- package/dist/{index-BdrSpcmR.d.ts → index-Dr06SNZN.d.cts} +4 -4
- package/dist/{index-DqY28C4j.d.cts.map → index-Dr06SNZN.d.cts.map} +1 -1
- package/dist/{index-Bg3AbFZf.d.ts → index-Dty4h2eA.d.ts} +6 -6
- package/dist/{index-Bg3AbFZf.d.ts.map → index-Dty4h2eA.d.ts.map} +1 -1
- package/dist/{index-BtX5upPu.d.cts → index-E6etS7_8.d.ts} +34 -34
- package/dist/{index-D0OJCk7N.d.ts.map → index-E6etS7_8.d.ts.map} +1 -1
- package/dist/{index-CYbsLxVV.d.ts → index-TmijvCD0.d.ts} +21 -21
- package/dist/{index-CYbsLxVV.d.ts.map → index-TmijvCD0.d.ts.map} +1 -1
- package/dist/{index-CC2Rnywy.d.cts → index-ahxY6Q0X.d.cts} +3 -3
- package/dist/index-ahxY6Q0X.d.cts.map +1 -0
- package/dist/{index-DiFA3eG2.d.ts → index-mmk9VKYu.d.ts} +21 -21
- package/dist/{index-DiFA3eG2.d.ts.map → index-mmk9VKYu.d.ts.map} +1 -1
- package/dist/{index-DelQykFp.d.ts → index-qo0Ta_R3.d.cts} +2 -2
- package/dist/{index-CUIi5IqH.d.cts.map → index-qo0Ta_R3.d.cts.map} +1 -1
- package/dist/{index-CUIi5IqH.d.cts → index-ttNINAv3.d.ts} +3 -3
- package/dist/{index-DelQykFp.d.ts.map → index-ttNINAv3.d.ts.map} +1 -1
- package/dist/index-w8E8Koak.d.ts +224 -0
- package/dist/index-w8E8Koak.d.ts.map +1 -0
- package/dist/{index-D3L2S2b3.d.cts → index-wwmQClW-.d.cts} +21 -21
- package/dist/{index-D3L2S2b3.d.cts.map → index-wwmQClW-.d.cts.map} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +23 -23
- package/dist/index.d.ts +22 -23
- package/dist/index.js +2 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/{useClientValidation-DxFgfsEI.d.ts → useClientValidation-B4xrGBJZ.d.ts} +3 -3
- package/dist/{useClientValidation-DxFgfsEI.d.ts.map → useClientValidation-B4xrGBJZ.d.ts.map} +1 -1
- package/dist/{useClientValidation-Dw-dmynu.d.cts → useClientValidation-B_dYQB5o.d.cts} +3 -3
- package/dist/{useClientValidation-Dw-dmynu.d.cts.map → useClientValidation-B_dYQB5o.d.cts.map} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts → useController-CHOpoCoz.d.ts} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts.map → useController-CHOpoCoz.d.ts.map} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts → useController-D8MEXnmB.d.cts} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts.map → useController-D8MEXnmB.d.cts.map} +1 -1
- package/dist/{useUniformField-CqqIJtqo.d.ts → useUniformField-BDKjYBKu.d.ts} +2 -2
- package/dist/{useUniformField-CqqIJtqo.d.ts.map → useUniformField-BDKjYBKu.d.ts.map} +1 -1
- package/dist/{useUniformField-DIb__gKK.d.cts → useUniformField-Bd_oDkYE.d.cts} +2 -2
- package/dist/{useUniformField-DIb__gKK.d.cts.map → useUniformField-Bd_oDkYE.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-BChcZvc5.d.cts → useUniformFieldArray-CWiaXKO6.d.cts} +2 -2
- package/dist/{useUniformFieldArray-BChcZvc5.d.cts.map → useUniformFieldArray-CWiaXKO6.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-4MOU0xac.d.ts → useUniformFieldArray-lV3Nbum2.d.ts} +2 -2
- package/dist/{useUniformFieldArray-4MOU0xac.d.ts.map → useUniformFieldArray-lV3Nbum2.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts → useWatchUserChange-BnnrFjyq.d.ts} +1 -1
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts.map → useWatchUserChange-BnnrFjyq.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts → useWatchUserChange-DalJOKBC.d.cts} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts.map → useWatchUserChange-DalJOKBC.d.cts.map} +1 -1
- package/package.json +2 -2
- package/dist/helpers/index.d.cts.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/index-CC2Rnywy.d.cts.map +0 -1
- package/dist/index-CM7UugT3.d.cts +0 -278
- package/dist/index-Ca2ovPTq.d.ts +0 -278
- package/dist/index-D86jXpHS.d.cts +0 -1
- package/dist/index-DmlsX2k6.d.ts.map +0 -1
- package/dist/index-hIBrhvnj.d.ts +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
//#region src/helpers/createOptionValueConverter/createOptionValueConverter.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a converter function that preserves the original type (string, number, or boolean)
|
|
4
|
+
* of option values when converting from string keys back to their original type.
|
|
5
|
+
*
|
|
6
|
+
* This is useful for radio/select components where the underlying UI library
|
|
7
|
+
* uses string keys internally, but we want to preserve number/boolean values in the form state.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Array of options with a value property that can be string, number, or boolean
|
|
10
|
+
* @returns An object with:
|
|
11
|
+
* - `convertToOriginalType`: Function to convert a string key back to its original type
|
|
12
|
+
* - `numberValueKeys`: Set of string representations of number values (for internal use)
|
|
13
|
+
* - `booleanValueKeys`: Map of string representations to boolean values (for internal use)
|
|
14
|
+
*/
|
|
15
|
+
declare const createOptionValueConverter: <T extends {
|
|
16
|
+
value: string | number | boolean;
|
|
17
|
+
}>(options: T[]) => {
|
|
18
|
+
booleanValueKeys: Map<string, boolean>;
|
|
19
|
+
convertToOriginalType: (key: string | number | boolean) => string | number | boolean;
|
|
20
|
+
numberValueKeys: Set<string>;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/helpers/nullishFields/nullishFields.d.ts
|
|
24
|
+
/** Key used to wrap flat array elements when converting to form format */
|
|
25
|
+
declare const flatArrayKey = "__FLAT__";
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a value is considered "empty" for validation display purposes.
|
|
28
|
+
*
|
|
29
|
+
* Used by useUniformField to determine when to show validation errors.
|
|
30
|
+
* Empty values don't trigger immediate error display (user must interact first).
|
|
31
|
+
*
|
|
32
|
+
* Handles:
|
|
33
|
+
* - Primitives: null, undefined, ''
|
|
34
|
+
* - Marker strings: __NULL__, __FALSE__, __ZERO__ (converted via fromNullishString)
|
|
35
|
+
* - Empty arrays: []
|
|
36
|
+
* - Objects with all empty values: {a: null, b: ''}
|
|
37
|
+
* - Flat array wrappers: {__FLAT__: null} or {__FLAT__: ''}
|
|
38
|
+
*
|
|
39
|
+
* @param value - The value to check (will be converted via fromNullishString first)
|
|
40
|
+
* @returns true if the value is empty
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* isValueEmpty(null) // true
|
|
44
|
+
* isValueEmpty('') // true
|
|
45
|
+
* isValueEmpty('__NULL__') // true (marker string)
|
|
46
|
+
* isValueEmpty([]) // true (empty array)
|
|
47
|
+
* isValueEmpty({a: null}) // true (object with all empty values)
|
|
48
|
+
* isValueEmpty({__FLAT__: null}) // true (flat array wrapper with empty value)
|
|
49
|
+
* isValueEmpty({__FLAT__: ''}) // true
|
|
50
|
+
* isValueEmpty('hello') // false
|
|
51
|
+
* isValueEmpty([1, 2]) // false
|
|
52
|
+
* isValueEmpty({a: 'value'}) // false
|
|
53
|
+
* isValueEmpty({__FLAT__: 'value'}) // false
|
|
54
|
+
*/
|
|
55
|
+
declare const isValueEmpty: (value: unknown) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Converts marker strings back to their original values when processing arrays
|
|
58
|
+
*/
|
|
59
|
+
declare const fromNullishString: (value: unknown) => unknown;
|
|
60
|
+
/**
|
|
61
|
+
* Converts null/falsy values to marker strings for JSON processing
|
|
62
|
+
*/
|
|
63
|
+
declare const toNullishString: (value: unknown) => unknown;
|
|
64
|
+
/**
|
|
65
|
+
* Converts field values to a format suitable for forms by:
|
|
66
|
+
* - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`
|
|
67
|
+
* to satisfy RHF's requirement that array fields contain objects
|
|
68
|
+
* - Removing empty strings and null values from objects
|
|
69
|
+
*
|
|
70
|
+
* This conversion is required because React Hook Form does not support arrays with
|
|
71
|
+
* flat values (string, number, boolean, null). Array fields must contain objects.
|
|
72
|
+
* We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const fields = {
|
|
76
|
+
* name: 'John',
|
|
77
|
+
* scores: [0, null, 75, false],
|
|
78
|
+
* scoresDetailed: [
|
|
79
|
+
* { score: 1 },
|
|
80
|
+
* { score: null },
|
|
81
|
+
* { score: 0 },
|
|
82
|
+
* { score: false },
|
|
83
|
+
* { score: '' },
|
|
84
|
+
* ],
|
|
85
|
+
* contact: {
|
|
86
|
+
* email: '',
|
|
87
|
+
* phone: null,
|
|
88
|
+
* address: '123 Main St'
|
|
89
|
+
* }
|
|
90
|
+
* };
|
|
91
|
+
*
|
|
92
|
+
* // Result:
|
|
93
|
+
* {
|
|
94
|
+
* name: 'John',
|
|
95
|
+
* scores: [
|
|
96
|
+
* { __FLAT__: 0 },
|
|
97
|
+
* { __FLAT__: null },
|
|
98
|
+
* { __FLAT__: 75 },
|
|
99
|
+
* { __FLAT__: false }
|
|
100
|
+
* ],
|
|
101
|
+
* // Arrays of objects are left as objects; empty/null properties are removed
|
|
102
|
+
* scoresDetailed: [
|
|
103
|
+
* { score: 1 },
|
|
104
|
+
* {}, // null score removed
|
|
105
|
+
* { score: 0 },
|
|
106
|
+
* { score: false },
|
|
107
|
+
* {}, // empty string removed
|
|
108
|
+
* ],
|
|
109
|
+
* contact: {
|
|
110
|
+
* address: '123 Main St'
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
*/
|
|
114
|
+
declare const toFormFormat: (fields: Record<string, unknown>) => Record<string, unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* Converts form state to a format suitable for validation by:
|
|
117
|
+
* - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives
|
|
118
|
+
* - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values
|
|
119
|
+
* - Removing fields whose converted value is empty string or null
|
|
120
|
+
* - Removing empty arrays
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* const formState = {
|
|
124
|
+
* name: 'John',
|
|
125
|
+
* scores: [
|
|
126
|
+
* { __FLAT__: 75 },
|
|
127
|
+
* { __FLAT__: 0 },
|
|
128
|
+
* { __FLAT__: null },
|
|
129
|
+
* { __FLAT__: false }
|
|
130
|
+
* ],
|
|
131
|
+
* emptyArray: [],
|
|
132
|
+
* scoresDetailed: [
|
|
133
|
+
* { score: 1 },
|
|
134
|
+
* {},
|
|
135
|
+
* { score: 0 },
|
|
136
|
+
* { score: false },
|
|
137
|
+
* {},
|
|
138
|
+
* ],
|
|
139
|
+
* contact: {
|
|
140
|
+
* address: '123 Main St',
|
|
141
|
+
* fax: null
|
|
142
|
+
* }
|
|
143
|
+
* };
|
|
144
|
+
*
|
|
145
|
+
* // Result:
|
|
146
|
+
* {
|
|
147
|
+
* name: 'John',
|
|
148
|
+
* scores: [75, 0, null, false],
|
|
149
|
+
* // emptyArray is removed
|
|
150
|
+
* // Objects inside arrays remain objects; empty entries remain empty objects
|
|
151
|
+
* scoresDetailed: [
|
|
152
|
+
* { score: 1 },
|
|
153
|
+
* {},
|
|
154
|
+
* { score: 0 },
|
|
155
|
+
* { score: false },
|
|
156
|
+
* {},
|
|
157
|
+
* ],
|
|
158
|
+
* contact: {
|
|
159
|
+
* address: '123 Main St'
|
|
160
|
+
* }
|
|
161
|
+
* }
|
|
162
|
+
*/
|
|
163
|
+
declare const toValidationFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Converts form state to a format suitable for submission by:
|
|
166
|
+
* - Applying all transformations from toValidationFormat
|
|
167
|
+
* - Additionally removing empty objects from the result
|
|
168
|
+
* - Filtering empty objects from arrays
|
|
169
|
+
* - Recursively cleaning nested structures
|
|
170
|
+
*
|
|
171
|
+
* **Why separate from toValidationFormat?**
|
|
172
|
+
*
|
|
173
|
+
* Empty objects must be preserved during validation so that custom refinements
|
|
174
|
+
* can run. For example, a FieldCard with "at least email or phone required"
|
|
175
|
+
* validation needs the object to exist (even if empty) for the refine to execute.
|
|
176
|
+
*
|
|
177
|
+
* However, for submission, empty objects are meaningless and should be removed
|
|
178
|
+
* to produce clean data for APIs.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* const formState = {
|
|
182
|
+
* name: 'John',
|
|
183
|
+
* contact: {}, // Empty FieldCard - will be removed
|
|
184
|
+
* tags: [{}, {}, {}], // All empty - array will be removed
|
|
185
|
+
* items: [
|
|
186
|
+
* { value: 'a' },
|
|
187
|
+
* {}, // Empty entry - will be filtered out
|
|
188
|
+
* { value: 'b' }
|
|
189
|
+
* ],
|
|
190
|
+
* nested: {
|
|
191
|
+
* deep: {} // Nested empty - will be removed recursively
|
|
192
|
+
* }
|
|
193
|
+
* };
|
|
194
|
+
*
|
|
195
|
+
* // Result:
|
|
196
|
+
* {
|
|
197
|
+
* name: 'John',
|
|
198
|
+
* items: [{ value: 'a' }, { value: 'b' }]
|
|
199
|
+
* }
|
|
200
|
+
*/
|
|
201
|
+
declare const toSubmitFormat: (formState: Record<string, unknown> | null | undefined) => Record<string, unknown> | null | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Converts a field name to a testId by removing flat array key segments and slugifying.
|
|
204
|
+
* Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.
|
|
205
|
+
*
|
|
206
|
+
* This is used to generate stable testIds for form fields that don't include
|
|
207
|
+
* the internal `__FLAT__` marker used for flat arrays.
|
|
208
|
+
*
|
|
209
|
+
* @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])
|
|
210
|
+
* @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* nameToTestId('tags.0.__FLAT__') // => 'tags_0'
|
|
215
|
+
* nameToTestId('array.0.__FLAT__') // => 'array_0'
|
|
216
|
+
* nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'
|
|
217
|
+
* nameToTestId('simple.field') // => 'simple_field'
|
|
218
|
+
* nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare const nameToTestId: (name: string | readonly string[]) => string;
|
|
222
|
+
//#endregion
|
|
223
|
+
export { toFormFormat as a, toValidationFormat as c, nameToTestId as i, createOptionValueConverter as l, fromNullishString as n, toNullishString as o, isValueEmpty as r, toSubmitFormat as s, flatArrayKey as t };
|
|
224
|
+
//# sourceMappingURL=index-BLgXFM85.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BLgXFM85.d.cts","names":[],"sources":["../src/helpers/createOptionValueConverter/createOptionValueConverter.ts","../src/helpers/nullishFields/nullishFields.ts"],"mappings":";;AAeA;;;;;;;;;;;;cAAa,0BAAA;EACC,KAAA;AAAA,GAEZ,OAAA,EAAS,CAAA;;;;;;;;cCfE,YAAA;;;;;;;;;;;;;;;;;;;;;;;AAAb;;;;;AAsCA;;cAAa,YAAA,GAAgB,KAAA;;;AA0B7B;cAAa,iBAAA,GAAqB,KAAA;;;;cAsCrB,eAAA,GAAmB,KAAA;;;;;AA6EhC;;;;;;;;;AA2EA;;;;;;;;;AAyKA;;;;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;cAjRa,YAAA,GAAgB,MAAA,EAAQ,MAAA,sBAwBE,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmD1B,kBAAA,GACX,SAAA,EAAW,MAAA,yCACV,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuKU,cAAA,GACX,SAAA,EAAW,MAAA,yCACV,MAAA;;;;;;;;;;;;;;;;;;;;cA2BU,YAAA,GAAgB,IAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DebugModeSettings } from "./FormContext-RSA21aDt.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { VetoInstance } from "@fuf-stack/veto";
|
|
5
5
|
import { FieldValues, SubmitHandler } from "react-hook-form";
|
|
@@ -38,7 +38,7 @@ declare const Form: ({
|
|
|
38
38
|
testId,
|
|
39
39
|
validation,
|
|
40
40
|
validationTrigger
|
|
41
|
-
}: FormProps) =>
|
|
41
|
+
}: FormProps) => react_jsx_runtime7.JSX.Element;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { FormProps as n, Form as t };
|
|
44
|
-
//# sourceMappingURL=index-
|
|
44
|
+
//# sourceMappingURL=index-BNYtqtXt.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BNYtqtXt.d.cts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFP;EAIf,SAAA;;EAEA,KAAA,GAAQ,iBAAA;EAJc;EAMtB,aAAA,GAAgB,WAAA;EAAA;EAEhB,IAAA;EAEU;EAAV,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZA;EAcA,UAAA,GAAa,YAAA;EAdS;EAgBtB,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,KAAS,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { TVClassName, TVProps } from "@fuf-stack/pixel-utils";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
4
4
|
import "@heroui/radio";
|
|
5
|
-
import * as
|
|
5
|
+
import * as tailwind_variants223 from "tailwind-variants";
|
|
6
6
|
|
|
7
7
|
//#region src/RadioBoxes/RadioBoxes.d.ts
|
|
8
|
-
declare const radioBoxesVariants:
|
|
8
|
+
declare const radioBoxesVariants: tailwind_variants223.TVReturnType<{
|
|
9
9
|
[key: string]: {
|
|
10
|
-
[key: string]:
|
|
11
|
-
base?:
|
|
12
|
-
label?:
|
|
13
|
-
wrapper?:
|
|
14
|
-
boxBase?:
|
|
15
|
-
boxControl?:
|
|
16
|
-
boxDescription?:
|
|
17
|
-
boxLabel?:
|
|
18
|
-
boxLabelWrapper?:
|
|
10
|
+
[key: string]: tailwind_variants223.ClassValue | {
|
|
11
|
+
base?: tailwind_variants223.ClassValue;
|
|
12
|
+
label?: tailwind_variants223.ClassValue;
|
|
13
|
+
wrapper?: tailwind_variants223.ClassValue;
|
|
14
|
+
boxBase?: tailwind_variants223.ClassValue;
|
|
15
|
+
boxControl?: tailwind_variants223.ClassValue;
|
|
16
|
+
boxDescription?: tailwind_variants223.ClassValue;
|
|
17
|
+
boxLabel?: tailwind_variants223.ClassValue;
|
|
18
|
+
boxLabelWrapper?: tailwind_variants223.ClassValue;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
} | {
|
|
22
22
|
[x: string]: {
|
|
23
|
-
[x: string]:
|
|
24
|
-
base?:
|
|
25
|
-
label?:
|
|
26
|
-
wrapper?:
|
|
27
|
-
boxBase?:
|
|
28
|
-
boxControl?:
|
|
29
|
-
boxDescription?:
|
|
30
|
-
boxLabel?:
|
|
31
|
-
boxLabelWrapper?:
|
|
23
|
+
[x: string]: tailwind_variants223.ClassValue | {
|
|
24
|
+
base?: tailwind_variants223.ClassValue;
|
|
25
|
+
label?: tailwind_variants223.ClassValue;
|
|
26
|
+
wrapper?: tailwind_variants223.ClassValue;
|
|
27
|
+
boxBase?: tailwind_variants223.ClassValue;
|
|
28
|
+
boxControl?: tailwind_variants223.ClassValue;
|
|
29
|
+
boxDescription?: tailwind_variants223.ClassValue;
|
|
30
|
+
boxLabel?: tailwind_variants223.ClassValue;
|
|
31
|
+
boxLabelWrapper?: tailwind_variants223.ClassValue;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
} | {}, {
|
|
@@ -42,15 +42,15 @@ declare const radioBoxesVariants: tailwind_variants117.TVReturnType<{
|
|
|
42
42
|
wrapper: string;
|
|
43
43
|
}, undefined, {
|
|
44
44
|
[key: string]: {
|
|
45
|
-
[key: string]:
|
|
46
|
-
base?:
|
|
47
|
-
label?:
|
|
48
|
-
wrapper?:
|
|
49
|
-
boxBase?:
|
|
50
|
-
boxControl?:
|
|
51
|
-
boxDescription?:
|
|
52
|
-
boxLabel?:
|
|
53
|
-
boxLabelWrapper?:
|
|
45
|
+
[key: string]: tailwind_variants223.ClassValue | {
|
|
46
|
+
base?: tailwind_variants223.ClassValue;
|
|
47
|
+
label?: tailwind_variants223.ClassValue;
|
|
48
|
+
wrapper?: tailwind_variants223.ClassValue;
|
|
49
|
+
boxBase?: tailwind_variants223.ClassValue;
|
|
50
|
+
boxControl?: tailwind_variants223.ClassValue;
|
|
51
|
+
boxDescription?: tailwind_variants223.ClassValue;
|
|
52
|
+
boxLabel?: tailwind_variants223.ClassValue;
|
|
53
|
+
boxLabelWrapper?: tailwind_variants223.ClassValue;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
} | {}, {
|
|
@@ -62,7 +62,7 @@ declare const radioBoxesVariants: tailwind_variants117.TVReturnType<{
|
|
|
62
62
|
boxLabelWrapper: string;
|
|
63
63
|
label: string;
|
|
64
64
|
wrapper: string;
|
|
65
|
-
},
|
|
65
|
+
}, tailwind_variants223.TVReturnType<unknown, {
|
|
66
66
|
base: string;
|
|
67
67
|
boxBase: string;
|
|
68
68
|
boxControl: string;
|
|
@@ -115,10 +115,10 @@ declare const RadioBoxes: ({
|
|
|
115
115
|
name,
|
|
116
116
|
options,
|
|
117
117
|
...uniformFieldProps
|
|
118
|
-
}: RadioBoxesProps) =>
|
|
118
|
+
}: RadioBoxesProps) => react_jsx_runtime8.JSX.Element;
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/RadioBoxes/RadioBox.d.ts
|
|
121
|
-
declare const radioBoxVariants:
|
|
121
|
+
declare const radioBoxVariants: tailwind_variants223.TVReturnType<{
|
|
122
122
|
isDisabled: {
|
|
123
123
|
true: {
|
|
124
124
|
base: string;
|
|
@@ -154,7 +154,7 @@ declare const radioBoxVariants: tailwind_variants117.TVReturnType<{
|
|
|
154
154
|
icon: string;
|
|
155
155
|
label: string;
|
|
156
156
|
labelWrapper: string;
|
|
157
|
-
},
|
|
157
|
+
}, tailwind_variants223.TVReturnType<{
|
|
158
158
|
isDisabled: {
|
|
159
159
|
true: {
|
|
160
160
|
base: string;
|
|
@@ -175,4 +175,4 @@ declare const radioBoxVariants: tailwind_variants117.TVReturnType<{
|
|
|
175
175
|
}, undefined, unknown, unknown, undefined>>;
|
|
176
176
|
//#endregion
|
|
177
177
|
export { RadioBoxes as n, RadioBoxesProps as r, radioBoxVariants as t };
|
|
178
|
-
//# sourceMappingURL=index-
|
|
178
|
+
//# sourceMappingURL=index-BaxXDaOZ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BaxXDaOZ.d.ts","names":[],"sources":["../src/RadioBoxes/RadioBoxes.tsx","../src/RadioBoxes/RadioBox.tsx"],"mappings":";;;;;;;cAaa,kBAAA,uBAAkB,YAAA;EAAA;mBAc7B,oBAAA,CAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEG,YAAA,GAAe,OAAA,QAAe,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAA,QAAmB,kBAAA;AAAA,UAEnB,gBAAA;;EAEf,WAAA,GAAc,SAAA;;EAEd,QAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,IAAA,GAAO,SAAA;;EAEP,MAAA;;EAEA,KAAA;AAAA;AAAA,UAGe,eAAA,SAAwB,YAAA;;EAEvC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,MAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,IAAA;;EAEA,OAAA,EAAS,gBAAA;;EAET,MAAA;AAAA;;;;cAMI,UAAA;EAAc,SAAA;EAAA,MAAA;EAAA,IAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GAMjB,eAAA,KAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;;cClEL,gBAAA,EAqBX,oBAAA,CArB2B,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqB3B,oBAAA,CAAA,YAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as tailwind_variants166 from "tailwind-variants";
|
|
2
|
-
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
1
|
import { TVClassName } from "@fuf-stack/pixel-utils";
|
|
4
2
|
import { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
5
4
|
import { SwitchProps } from "@heroui/switch";
|
|
5
|
+
import * as tailwind_variants258 from "tailwind-variants";
|
|
6
6
|
|
|
7
7
|
//#region src/SwitchBox/SwitchBox.d.ts
|
|
8
|
-
declare const switchBoxVariants:
|
|
8
|
+
declare const switchBoxVariants: tailwind_variants258.TVReturnType<{
|
|
9
9
|
isDisabled: {
|
|
10
10
|
true: {
|
|
11
11
|
box: string;
|
|
@@ -79,7 +79,7 @@ declare const switchBoxVariants: tailwind_variants166.TVReturnType<{
|
|
|
79
79
|
wrapper: string;
|
|
80
80
|
thumb: string;
|
|
81
81
|
thumbIcon: string;
|
|
82
|
-
},
|
|
82
|
+
}, tailwind_variants258.TVReturnType<{
|
|
83
83
|
isDisabled: {
|
|
84
84
|
true: {
|
|
85
85
|
box: string;
|
|
@@ -150,7 +150,7 @@ declare const SwitchBox: ({
|
|
|
150
150
|
size,
|
|
151
151
|
thumbIcon,
|
|
152
152
|
...uniformFieldProps
|
|
153
|
-
}: SwitchBoxProps) =>
|
|
153
|
+
}: SwitchBoxProps) => react_jsx_runtime13.JSX.Element;
|
|
154
154
|
//#endregion
|
|
155
155
|
export { SwitchBoxProps as n, switchBoxVariants as r, SwitchBox as t };
|
|
156
|
-
//# sourceMappingURL=index-
|
|
156
|
+
//# sourceMappingURL=index-BgyvEfYZ.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-BgyvEfYZ.d.ts","names":[],"sources":["../src/SwitchBox/SwitchBox.tsx"],"mappings":";;;;;;;cAaa,iBAAA,EA4CX,oBAAA,CA5C4B,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4C5B,oBAAA,CAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEG,SAAA,GAAY,WAAA,QAAmB,iBAAA;AAAA,UAEnB,cAAA;EAQR;EANP,SAAA,GAAY,SAAA;EAQJ;EANR,WAAA,GAAc,SAAA;EAUd;EARA,QAAA;EAYA;EAVA,IAAA,GAAO,SAAA;EAYK;EAVZ,KAAA,GAAQ,SAAA;EAUmB;EAR3B,IAAA;EAuKD;EArKC,QAAA;EAEA,IAAA;EAUiB;EARjB,MAAA;EAQiB;EANjB,SAAA,GAAY,WAAA;AAAA;;;;cAMR,SAAA;EAAa,SAAA;EAAA,WAAA;EAAA,IAAA;EAAA,IAAA;EAAA,IAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAQhB,cAAA,KAAc,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|