@banyan_cloud/roots 1.0.51 → 1.0.53
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/cjs/index.js +18 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +18 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +18 -12
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -103476,7 +103476,14 @@ var Toggle = /*#__PURE__*/React.forwardRef(function Toggle(props, ref) {
|
|
|
103476
103476
|
color = props.color;
|
|
103477
103477
|
|
|
103478
103478
|
// for uncontrolled input
|
|
103479
|
-
var _useState = React.useState(
|
|
103479
|
+
var _useState = React.useState(function () {
|
|
103480
|
+
var _options$2;
|
|
103481
|
+
if (multi) {
|
|
103482
|
+
var _ref, _options$;
|
|
103483
|
+
return (_ref = defaultValue !== null && defaultValue !== void 0 ? defaultValue : options === null || options === void 0 ? void 0 : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value) !== null && _ref !== void 0 ? _ref : [];
|
|
103484
|
+
}
|
|
103485
|
+
return defaultValue !== null && defaultValue !== void 0 ? defaultValue : options === null || options === void 0 ? void 0 : (_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value;
|
|
103486
|
+
}),
|
|
103480
103487
|
_useState2 = _slicedToArray(_useState, 2),
|
|
103481
103488
|
uncontrolledValue = _useState2[0],
|
|
103482
103489
|
setUncontrolledValue = _useState2[1];
|
|
@@ -103519,16 +103526,18 @@ var Toggle = /*#__PURE__*/React.forwardRef(function Toggle(props, ref) {
|
|
|
103519
103526
|
} else {
|
|
103520
103527
|
// if all are selected, select only the one being clicked
|
|
103521
103528
|
if (allSelected) {
|
|
103529
|
+
var _newInputValue = [newValue];
|
|
103522
103530
|
if (isControlled) {
|
|
103523
|
-
onChange(
|
|
103531
|
+
onChange(_newInputValue);
|
|
103524
103532
|
} else {
|
|
103525
|
-
setUncontrolledValue(
|
|
103533
|
+
setUncontrolledValue(_newInputValue);
|
|
103526
103534
|
}
|
|
103527
103535
|
} else {
|
|
103536
|
+
var _newInputValue2 = [].concat(_toConsumableArray$1(inputValue), [newValue]);
|
|
103528
103537
|
if (isControlled) {
|
|
103529
|
-
onChange(
|
|
103538
|
+
onChange(_newInputValue2);
|
|
103530
103539
|
} else {
|
|
103531
|
-
setUncontrolledValue(
|
|
103540
|
+
setUncontrolledValue(_newInputValue2);
|
|
103532
103541
|
}
|
|
103533
103542
|
}
|
|
103534
103543
|
}
|
|
@@ -103596,16 +103605,13 @@ Toggle.defaultProps = {
|
|
|
103596
103605
|
};
|
|
103597
103606
|
|
|
103598
103607
|
var generateOptions = function generateOptions(optionData) {
|
|
103599
|
-
var _optionData$id, _optionData$
|
|
103608
|
+
var _optionData$id, _optionData$placehold, _optionData$value, _optionData$onChange, _optionData$selectOpt, _optionData$title, _optionData$onClick;
|
|
103600
103609
|
switch ((_optionData$id = optionData === null || optionData === void 0 ? void 0 : optionData.id) !== null && _optionData$id !== void 0 ? _optionData$id : '') {
|
|
103601
103610
|
case 'toggle':
|
|
103602
|
-
return /*#__PURE__*/jsxRuntime.jsx(Toggle, {
|
|
103611
|
+
return /*#__PURE__*/jsxRuntime.jsx(Toggle, _objectSpread2({
|
|
103603
103612
|
className: modules_6a0e74b6['toggle-body'],
|
|
103604
|
-
theme: "dark"
|
|
103605
|
-
|
|
103606
|
-
selectedToggle: (_optionData$selectedT = optionData === null || optionData === void 0 ? void 0 : optionData.selectedToggle) !== null && _optionData$selectedT !== void 0 ? _optionData$selectedT : '',
|
|
103607
|
-
setSelectedToggle: (_optionData$setSelect = optionData === null || optionData === void 0 ? void 0 : optionData.setSelectedToggle) !== null && _optionData$setSelect !== void 0 ? _optionData$setSelect : ''
|
|
103608
|
-
});
|
|
103613
|
+
theme: "dark"
|
|
103614
|
+
}, optionData));
|
|
103609
103615
|
case 'dropdown':
|
|
103610
103616
|
return /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
|
|
103611
103617
|
placeholder: (_optionData$placehold = optionData === null || optionData === void 0 ? void 0 : optionData.placeholder) !== null && _optionData$placehold !== void 0 ? _optionData$placehold : '',
|