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