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