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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # trotl-table
1
+ # trotl-filter
2
2
 
3
3
  A simple, flexible **Filters UI** for React.
4
4
 
package/dist/index.cjs.js CHANGED
@@ -7329,8 +7329,21 @@ const DebounceSelect = ({
7329
7329
  isMulti = false,
7330
7330
  pushUrlParamObj = false,
7331
7331
  addItem = undefined,
7332
- fetchAll = true
7332
+ fetchAll = true,
7333
+ t
7333
7334
  }) => {
7335
+ let translate;
7336
+ if (t) {
7337
+ translate = t;
7338
+ } else {
7339
+ translate = key => {
7340
+ const translations = {
7341
+ add: "Add",
7342
+ cancel: "Cancel"
7343
+ };
7344
+ return translations[key] || key;
7345
+ };
7346
+ }
7334
7347
  const [input, setInput] = React.useState("");
7335
7348
  const [options, setOptions] = React.useState([]);
7336
7349
  const [loading, setLoading] = React.useState(false);
@@ -7557,21 +7570,21 @@ const DebounceSelect = ({
7557
7570
  key: value,
7558
7571
  className: "basic-input-dropdown-item",
7559
7572
  onMouseDown: () => handleSelect(value, label)
7560
- }, label)), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React.createElement("div", {
7573
+ }, translate(label))), input.trim() && !inputExists && typeof addItem === 'function' && /*#__PURE__*/React.createElement("div", {
7561
7574
  className: "basic-input-dropdown-item",
7562
7575
  style: {
7563
7576
  color: '#1677ff',
7564
7577
  fontWeight: 500
7565
7578
  },
7566
7579
  onMouseDown: handleAddNew
7567
- }, "+ Add \"", input.trim(), "\"")) : input.trim() && !loading && typeof addItem === 'function' ? /*#__PURE__*/React.createElement("div", {
7580
+ }, "+ ", translate("add"), " \"", input.trim(), "\"")) : input.trim() && !loading && typeof addItem === 'function' ? /*#__PURE__*/React.createElement("div", {
7568
7581
  className: "basic-input-dropdown-item",
7569
7582
  style: {
7570
7583
  color: '#1677ff',
7571
7584
  fontWeight: 500
7572
7585
  },
7573
7586
  onMouseDown: handleAddNew
7574
- }, "+ Add \"", input.trim(), "\"") : /*#__PURE__*/React.createElement("div", {
7587
+ }, "+ ", translate("add"), " \"", input.trim(), "\"") : /*#__PURE__*/React.createElement("div", {
7575
7588
  className: "no-results-dropdown-item"
7576
7589
  }, "No results")));
7577
7590
  };