trotl-filter 1.0.6 → 1.0.7

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.esm.js CHANGED
@@ -7309,8 +7309,21 @@ const DebounceSelect = ({
7309
7309
  isMulti = false,
7310
7310
  pushUrlParamObj = false,
7311
7311
  addItem = undefined,
7312
- fetchAll = true
7312
+ fetchAll = true,
7313
+ t
7313
7314
  }) => {
7315
+ let translate;
7316
+ if (t) {
7317
+ translate = t;
7318
+ } else {
7319
+ translate = key => {
7320
+ const translations = {
7321
+ add: "Add",
7322
+ cancel: "Cancel"
7323
+ };
7324
+ return translations[key] || key;
7325
+ };
7326
+ }
7314
7327
  const [input, setInput] = useState("");
7315
7328
  const [options, setOptions] = useState([]);
7316
7329
  const [loading, setLoading] = useState(false);
@@ -7537,21 +7550,21 @@ const DebounceSelect = ({
7537
7550
  key: value,
7538
7551
  className: "basic-input-dropdown-item",
7539
7552
  onMouseDown: () => handleSelect(value, label)
7540
- }, label)), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React__default.createElement("div", {
7553
+ }, translate(label))), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React__default.createElement("div", {
7541
7554
  className: "basic-input-dropdown-item",
7542
7555
  style: {
7543
7556
  color: '#1677ff',
7544
7557
  fontWeight: 500
7545
7558
  },
7546
7559
  onMouseDown: handleAddNew
7547
- }, "+ Add \"", input.trim(), "\"")) : input.trim() && !loading && typeof addItem === 'function' ? /*#__PURE__*/React__default.createElement("div", {
7560
+ }, "+ ", translate("add"), " \"", input.trim(), "\"")) : input.trim() && !loading && typeof addItem === 'function' ? /*#__PURE__*/React__default.createElement("div", {
7548
7561
  className: "basic-input-dropdown-item",
7549
7562
  style: {
7550
7563
  color: '#1677ff',
7551
7564
  fontWeight: 500
7552
7565
  },
7553
7566
  onMouseDown: handleAddNew
7554
- }, "+ Add \"", input.trim(), "\"") : /*#__PURE__*/React__default.createElement("div", {
7567
+ }, "+ ", translate("add"), " \"", input.trim(), "\"") : /*#__PURE__*/React__default.createElement("div", {
7555
7568
  className: "no-results-dropdown-item"
7556
7569
  }, "No results")));
7557
7570
  };