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 CHANGED
@@ -7434,26 +7434,29 @@ const DebounceSelect = ({
7434
7434
  }
7435
7435
  window.history.replaceState({}, "", url);
7436
7436
  };
7437
- const handleSelect = (value, labelValue) => {
7437
+ const handleSelect = (value, labelValue, el) => {
7438
+ // console.log(el)
7438
7439
  if (isMulti) {
7439
7440
  const newItem = {
7441
+ ...el,
7440
7442
  value,
7441
7443
  label: labelValue
7442
7444
  };
7443
7445
  const updated = selectedItems.some(item => item.value === value) ? selectedItems : [...selectedItems, newItem];
7444
7446
  setSelectedItems(updated);
7445
- onSelect(updated);
7447
+ onSelect(value, newItem);
7446
7448
  setInput("");
7447
7449
  if (pushUrlParamObj) {
7448
7450
  setUrlParam(updated.map(item => item.value).join(","));
7449
7451
  }
7450
7452
  } else {
7451
7453
  const single = {
7454
+ ...el,
7452
7455
  value,
7453
7456
  label: labelValue
7454
7457
  };
7455
7458
  setSelectedItems([single]);
7456
- onSelect(single);
7459
+ onSelect(value, single);
7457
7460
  setInput(labelValue);
7458
7461
  if (pushUrlParamObj) {
7459
7462
  setUrlParam(value);
@@ -7481,7 +7484,7 @@ const DebounceSelect = ({
7481
7484
  if (typeof addItem === 'function') {
7482
7485
  addItem(newOption);
7483
7486
  }
7484
- handleSelect(newOption.value, newOption.label);
7487
+ handleSelect(newOption.value, newOption.label, newOption);
7485
7488
  };
7486
7489
 
7487
7490
  // Handle double-click to fetch all when fetchAll is false
@@ -7563,14 +7566,17 @@ const DebounceSelect = ({
7563
7566
  className: "basic-input-dropdown-menu"
7564
7567
  }, loading ? /*#__PURE__*/React.createElement("div", {
7565
7568
  className: "loading-dropdown-item"
7566
- }, "Loading...") : options?.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map(({
7567
- label,
7568
- value
7569
- }) => /*#__PURE__*/React.createElement("div", {
7570
- key: value,
7571
- className: "basic-input-dropdown-item",
7572
- onMouseDown: () => handleSelect(value, label)
7573
- }, translate(label))), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React.createElement("div", {
7569
+ }, "Loading...") : options?.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map(el => {
7570
+ const {
7571
+ label,
7572
+ value
7573
+ } = el;
7574
+ return /*#__PURE__*/React.createElement("div", {
7575
+ key: value,
7576
+ className: "basic-input-dropdown-item",
7577
+ onMouseDown: () => handleSelect(value, label, el)
7578
+ }, translate(label));
7579
+ }), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React.createElement("div", {
7574
7580
  className: "basic-input-dropdown-item",
7575
7581
  style: {
7576
7582
  color: '#1677ff',
@@ -10099,7 +10105,7 @@ function RangePicker({
10099
10105
  background: dropdownOpen ? "#f0f8ff" : "#fff",
10100
10106
  height: 34,
10101
10107
  minHeight: 34,
10102
- width: 280,
10108
+ width: 300,
10103
10109
  border: '1px solid #ccc',
10104
10110
  borderRadius: 2,
10105
10111
  display: 'flex',