trotl-filter 1.0.12 → 1.0.13

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
@@ -14,11 +14,25 @@ npm install trotl-filter
14
14
  yarn add trotl-filter
15
15
  ```
16
16
 
17
+
18
+ ```js
17
19
  \_(ツ)_/ Versions
18
20
 
19
- 1.0.1 => readme
21
+ 1.0.13 => ...
22
+ 1.0.12 => ...
23
+ 1.0.11 => ...
24
+ 1.0.10 => ...
25
+ 1.0.8 => ...
26
+ 1.0.8 => ...
27
+ 1.0.7 => ...
28
+ 1.0.6 => ...
29
+ 1.0.5 => ...
30
+ 1.0.4 => ...
31
+ 1.0.3 => ...
32
+ 1.0.2 => ...
33
+ 1.0.1 => ...
20
34
  1.0.0 => initial release
21
-
35
+ ```
22
36
  ⚡ Quick Start
23
37
 
24
38
  ```bash
package/dist/index.cjs.js CHANGED
@@ -7015,7 +7015,8 @@ const MultiSelectDropdown = ({
7015
7015
  // pushUrlParamObj={"ids"}
7016
7016
  addItem = undefined,
7017
7017
  style = {},
7018
- allowClear = false
7018
+ allowClear = false,
7019
+ disabled = false
7019
7020
  }) => {
7020
7021
  const containerRef = React.useRef(null);
7021
7022
  const [maxVisible, setMaxVisible] = React.useState(1);
@@ -7116,6 +7117,7 @@ const MultiSelectDropdown = ({
7116
7117
  return options;
7117
7118
  }, [options, inputValue, inputExists, addItem]);
7118
7119
  const handleAddNew = () => {
7120
+ if (disabled) return;
7119
7121
  if (!inputValue.trim()) return;
7120
7122
  const newLabel = inputValue.trim();
7121
7123
  // Prevent duplicate by value or label (case-insensitive)
@@ -7163,6 +7165,7 @@ const MultiSelectDropdown = ({
7163
7165
  return /*#__PURE__*/React.createElement(components.Option, props);
7164
7166
  };
7165
7167
  const handleChange = selectedItems => {
7168
+ if (disabled) return;
7166
7169
  if (isMulti) {
7167
7170
  const values = selectedItems ? selectedItems.map(item => item.value) : [];
7168
7171
  onChange(values);
@@ -7283,16 +7286,22 @@ const MultiSelectDropdown = ({
7283
7286
  return /*#__PURE__*/React.createElement("div", {
7284
7287
  style: {
7285
7288
  width: "100%",
7286
- ...style
7289
+ ...style,
7290
+ ...(disabled ? {
7291
+ opacity: 0.6
7292
+ } : {})
7287
7293
  },
7288
7294
  ref: containerRef,
7289
- className: showRequiredError ? "select-required-error" : ""
7295
+ className: showRequiredError ? "select-required-error" : "",
7296
+ "aria-disabled": disabled
7290
7297
  }, /*#__PURE__*/React.createElement(StateManagedSelect$1, {
7291
7298
  isMulti: isMulti,
7292
7299
  isClearable: allowClear,
7300
+ isDisabled: disabled,
7293
7301
  options: menuOptions,
7294
7302
  value: selectedOptions,
7295
7303
  onChange: (val, action) => {
7304
+ if (disabled) return;
7296
7305
  // If user selects the +Add option, handle it
7297
7306
  if (action && action.action === 'select-option' && val && val.length && val[val.length - 1]?.__isAddNew) {
7298
7307
  handleAddNew();
@@ -7311,6 +7320,7 @@ const MultiSelectDropdown = ({
7311
7320
  "aria-required": required,
7312
7321
  inputValue: inputValue,
7313
7322
  onInputChange: (val, action) => {
7323
+ if (disabled) return;
7314
7324
  if (action.action === "input-change") setInputValue(val);
7315
7325
  }
7316
7326
  }), showRequiredError && /*#__PURE__*/React.createElement("div", {