@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.js
CHANGED
|
@@ -9400,24 +9400,11 @@ import {
|
|
|
9400
9400
|
} from "react";
|
|
9401
9401
|
import { jsx as jsx125, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
9402
9402
|
var getValueArray = (value) => {
|
|
9403
|
-
if (value
|
|
9403
|
+
if (value) {
|
|
9404
9404
|
return Array.isArray(value) ? value : [value];
|
|
9405
9405
|
}
|
|
9406
9406
|
return [];
|
|
9407
9407
|
};
|
|
9408
|
-
var convertStringToValue = (stringValue, option) => {
|
|
9409
|
-
console.log(stringValue, option);
|
|
9410
|
-
if (option) {
|
|
9411
|
-
return option.value;
|
|
9412
|
-
}
|
|
9413
|
-
if (stringValue === "true") return true;
|
|
9414
|
-
if (stringValue === "false") return false;
|
|
9415
|
-
const numValue = Number(stringValue);
|
|
9416
|
-
if (!isNaN(numValue) && stringValue !== "") {
|
|
9417
|
-
return numValue;
|
|
9418
|
-
}
|
|
9419
|
-
return stringValue;
|
|
9420
|
-
};
|
|
9421
9408
|
function getToggleContent(label, disabled, readOnly, active) {
|
|
9422
9409
|
if (isValidElement2(label)) {
|
|
9423
9410
|
return cloneElement2(label, {
|
|
@@ -9454,7 +9441,7 @@ function TogglesInternal({
|
|
|
9454
9441
|
const newValueArray = Array.isArray(newValue) ? newValue : [newValue];
|
|
9455
9442
|
const typedValues = newValueArray.map((item) => {
|
|
9456
9443
|
const option2 = options.find((opt) => String(opt.value) === item);
|
|
9457
|
-
return
|
|
9444
|
+
return option2 ? option2.value : item;
|
|
9458
9445
|
});
|
|
9459
9446
|
onChange?.(
|
|
9460
9447
|
typedValues,
|
|
@@ -9464,10 +9451,7 @@ function TogglesInternal({
|
|
|
9464
9451
|
}
|
|
9465
9452
|
const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
|
|
9466
9453
|
const option = options.find((opt) => String(opt.value) === singleValue);
|
|
9467
|
-
const typedValue =
|
|
9468
|
-
{
|
|
9469
|
-
console.log("typedValues", typedValue);
|
|
9470
|
-
}
|
|
9454
|
+
const typedValue = option ? option.value : singleValue;
|
|
9471
9455
|
onChange?.(
|
|
9472
9456
|
typedValue,
|
|
9473
9457
|
{}
|