@chekinapp/ui 0.0.70 → 0.0.71
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.cjs +3 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9753,24 +9753,11 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
9753
9753
|
var import_react76 = require("react");
|
|
9754
9754
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
9755
9755
|
var getValueArray = (value) => {
|
|
9756
|
-
if (value
|
|
9756
|
+
if (value) {
|
|
9757
9757
|
return Array.isArray(value) ? value : [value];
|
|
9758
9758
|
}
|
|
9759
9759
|
return [];
|
|
9760
9760
|
};
|
|
9761
|
-
var convertStringToValue = (stringValue, option) => {
|
|
9762
|
-
console.log(stringValue, option);
|
|
9763
|
-
if (option) {
|
|
9764
|
-
return option.value;
|
|
9765
|
-
}
|
|
9766
|
-
if (stringValue === "true") return true;
|
|
9767
|
-
if (stringValue === "false") return false;
|
|
9768
|
-
const numValue = Number(stringValue);
|
|
9769
|
-
if (!isNaN(numValue) && stringValue !== "") {
|
|
9770
|
-
return numValue;
|
|
9771
|
-
}
|
|
9772
|
-
return stringValue;
|
|
9773
|
-
};
|
|
9774
9761
|
function getToggleContent(label, disabled, readOnly, active) {
|
|
9775
9762
|
if ((0, import_react76.isValidElement)(label)) {
|
|
9776
9763
|
return (0, import_react76.cloneElement)(label, {
|
|
@@ -9807,7 +9794,7 @@ function TogglesInternal({
|
|
|
9807
9794
|
const newValueArray = Array.isArray(newValue) ? newValue : [newValue];
|
|
9808
9795
|
const typedValues = newValueArray.map((item) => {
|
|
9809
9796
|
const option2 = options.find((opt) => String(opt.value) === item);
|
|
9810
|
-
return
|
|
9797
|
+
return option2 ? option2.value : item;
|
|
9811
9798
|
});
|
|
9812
9799
|
onChange?.(
|
|
9813
9800
|
typedValues,
|
|
@@ -9817,10 +9804,7 @@ function TogglesInternal({
|
|
|
9817
9804
|
}
|
|
9818
9805
|
const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
|
|
9819
9806
|
const option = options.find((opt) => String(opt.value) === singleValue);
|
|
9820
|
-
const typedValue =
|
|
9821
|
-
{
|
|
9822
|
-
console.log("typedValues", typedValue);
|
|
9823
|
-
}
|
|
9807
|
+
const typedValue = option ? option.value : singleValue;
|
|
9824
9808
|
onChange?.(
|
|
9825
9809
|
typedValue,
|
|
9826
9810
|
{}
|