trotl-filter 1.0.9 → 1.0.11
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.js +23 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -6993,7 +6993,8 @@ const MultiSelectDropdown = ({
|
|
|
6993
6993
|
closeMenuOnSelect = false,
|
|
6994
6994
|
pushUrlParamObj = false,
|
|
6995
6995
|
// pushUrlParamObj={"ids"}
|
|
6996
|
-
addItem = undefined
|
|
6996
|
+
addItem = undefined,
|
|
6997
|
+
style = {}
|
|
6997
6998
|
}) => {
|
|
6998
6999
|
const containerRef = useRef(null);
|
|
6999
7000
|
const [maxVisible, setMaxVisible] = useState(1);
|
|
@@ -7260,7 +7261,8 @@ const MultiSelectDropdown = ({
|
|
|
7260
7261
|
const showRequiredError = required && (!selected || selected.length === 0);
|
|
7261
7262
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
7262
7263
|
style: {
|
|
7263
|
-
width: "100%"
|
|
7264
|
+
width: "100%",
|
|
7265
|
+
...style
|
|
7264
7266
|
},
|
|
7265
7267
|
ref: containerRef,
|
|
7266
7268
|
className: showRequiredError ? "select-required-error" : ""
|
|
@@ -7414,26 +7416,29 @@ const DebounceSelect = ({
|
|
|
7414
7416
|
}
|
|
7415
7417
|
window.history.replaceState({}, "", url);
|
|
7416
7418
|
};
|
|
7417
|
-
const handleSelect = (value, labelValue) => {
|
|
7419
|
+
const handleSelect = (value, labelValue, el) => {
|
|
7420
|
+
// console.log(el)
|
|
7418
7421
|
if (isMulti) {
|
|
7419
7422
|
const newItem = {
|
|
7423
|
+
...el,
|
|
7420
7424
|
value,
|
|
7421
7425
|
label: labelValue
|
|
7422
7426
|
};
|
|
7423
7427
|
const updated = selectedItems.some(item => item.value === value) ? selectedItems : [...selectedItems, newItem];
|
|
7424
7428
|
setSelectedItems(updated);
|
|
7425
|
-
onSelect(
|
|
7429
|
+
onSelect(value, newItem);
|
|
7426
7430
|
setInput("");
|
|
7427
7431
|
if (pushUrlParamObj) {
|
|
7428
7432
|
setUrlParam(updated.map(item => item.value).join(","));
|
|
7429
7433
|
}
|
|
7430
7434
|
} else {
|
|
7431
7435
|
const single = {
|
|
7436
|
+
...el,
|
|
7432
7437
|
value,
|
|
7433
7438
|
label: labelValue
|
|
7434
7439
|
};
|
|
7435
7440
|
setSelectedItems([single]);
|
|
7436
|
-
onSelect(single);
|
|
7441
|
+
onSelect(value, single);
|
|
7437
7442
|
setInput(labelValue);
|
|
7438
7443
|
if (pushUrlParamObj) {
|
|
7439
7444
|
setUrlParam(value);
|
|
@@ -7461,7 +7466,7 @@ const DebounceSelect = ({
|
|
|
7461
7466
|
if (typeof addItem === 'function') {
|
|
7462
7467
|
addItem(newOption);
|
|
7463
7468
|
}
|
|
7464
|
-
handleSelect(newOption.value, newOption.label);
|
|
7469
|
+
handleSelect(newOption.value, newOption.label, newOption);
|
|
7465
7470
|
};
|
|
7466
7471
|
|
|
7467
7472
|
// Handle double-click to fetch all when fetchAll is false
|
|
@@ -7543,14 +7548,17 @@ const DebounceSelect = ({
|
|
|
7543
7548
|
className: "basic-input-dropdown-menu"
|
|
7544
7549
|
}, loading ? /*#__PURE__*/React__default.createElement("div", {
|
|
7545
7550
|
className: "loading-dropdown-item"
|
|
7546
|
-
}, "Loading...") : options?.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, options.map(
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7551
|
+
}, "Loading...") : options?.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, options.map(el => {
|
|
7552
|
+
const {
|
|
7553
|
+
label,
|
|
7554
|
+
value
|
|
7555
|
+
} = el;
|
|
7556
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
7557
|
+
key: value,
|
|
7558
|
+
className: "basic-input-dropdown-item",
|
|
7559
|
+
onMouseDown: () => handleSelect(value, label, el)
|
|
7560
|
+
}, translate(label));
|
|
7561
|
+
}), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React__default.createElement("div", {
|
|
7554
7562
|
className: "basic-input-dropdown-item",
|
|
7555
7563
|
style: {
|
|
7556
7564
|
color: '#1677ff',
|
|
@@ -10079,7 +10087,7 @@ function RangePicker({
|
|
|
10079
10087
|
background: dropdownOpen ? "#f0f8ff" : "#fff",
|
|
10080
10088
|
height: 34,
|
|
10081
10089
|
minHeight: 34,
|
|
10082
|
-
width:
|
|
10090
|
+
width: 300,
|
|
10083
10091
|
border: '1px solid #ccc',
|
|
10084
10092
|
borderRadius: 2,
|
|
10085
10093
|
display: 'flex',
|