@juantroconisf/lib 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -188,7 +188,7 @@ function useFormChange({
|
|
|
188
188
|
handleNestedChange({
|
|
189
189
|
state,
|
|
190
190
|
id,
|
|
191
|
-
value: typeof value === "string" ? value : Array.from(value)
|
|
191
|
+
value: typeof value === "string" || value === null ? value : Array.from(value)
|
|
192
192
|
})
|
|
193
193
|
);
|
|
194
194
|
const registerHandle = (0, import_react.useCallback)(
|
|
@@ -245,12 +245,12 @@ function useFormChange({
|
|
|
245
245
|
value: state[id]
|
|
246
246
|
}),
|
|
247
247
|
select: (id) => {
|
|
248
|
-
const isString = typeof state[id] === "string";
|
|
248
|
+
const isString = typeof state[id] === "string" || state[id] === null;
|
|
249
249
|
return {
|
|
250
250
|
...registerHandle(id),
|
|
251
251
|
onSelectionChange: (v) => onSelectionChange(
|
|
252
252
|
id,
|
|
253
|
-
|
|
253
|
+
!isString ? v : Array.from(v)[0] || null
|
|
254
254
|
),
|
|
255
255
|
selectedKeys: state[id] === null ? [] : isString ? [state[id]] : state[id]
|
|
256
256
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -169,7 +169,7 @@ function useFormChange({
|
|
|
169
169
|
handleNestedChange({
|
|
170
170
|
state,
|
|
171
171
|
id,
|
|
172
|
-
value: typeof value === "string" ? value : Array.from(value)
|
|
172
|
+
value: typeof value === "string" || value === null ? value : Array.from(value)
|
|
173
173
|
})
|
|
174
174
|
);
|
|
175
175
|
const registerHandle = useCallback(
|
|
@@ -226,12 +226,12 @@ function useFormChange({
|
|
|
226
226
|
value: state[id]
|
|
227
227
|
}),
|
|
228
228
|
select: (id) => {
|
|
229
|
-
const isString = typeof state[id] === "string";
|
|
229
|
+
const isString = typeof state[id] === "string" || state[id] === null;
|
|
230
230
|
return {
|
|
231
231
|
...registerHandle(id),
|
|
232
232
|
onSelectionChange: (v) => onSelectionChange(
|
|
233
233
|
id,
|
|
234
|
-
|
|
234
|
+
!isString ? v : Array.from(v)[0] || null
|
|
235
235
|
),
|
|
236
236
|
selectedKeys: state[id] === null ? [] : isString ? [state[id]] : state[id]
|
|
237
237
|
};
|