@firecms/ui 3.0.0-canary.242 → 3.0.0-canary.244
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/components/Select.d.ts +1 -0
- package/dist/index.es.js +7 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Select.tsx +33 -28
package/dist/index.umd.js
CHANGED
@@ -30561,6 +30561,7 @@
|
|
30561
30561
|
endAdornment,
|
30562
30562
|
invisible,
|
30563
30563
|
children,
|
30564
|
+
dataType = "string",
|
30564
30565
|
...props
|
30565
30566
|
}, ref) => {
|
30566
30567
|
const [openInternal, setOpenInternal] = React.useState(open ?? false);
|
@@ -30569,9 +30570,12 @@
|
|
30569
30570
|
}, [open]);
|
30570
30571
|
const onValueChangeInternal = React.useCallback((newValue) => {
|
30571
30572
|
let typedValue = newValue;
|
30572
|
-
if (
|
30573
|
-
|
30574
|
-
|
30573
|
+
if (dataType === "boolean") {
|
30574
|
+
if (newValue === "true") typedValue = true;
|
30575
|
+
else if (newValue === "false") typedValue = false;
|
30576
|
+
} else if (dataType === "number") {
|
30577
|
+
if (!isNaN(Number(newValue)) && newValue.trim() !== "") typedValue = Number(newValue);
|
30578
|
+
}
|
30575
30579
|
onValueChange?.(typedValue);
|
30576
30580
|
if (onChange) {
|
30577
30581
|
const event = {
|