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/dist/index.esm.js CHANGED
@@ -6995,7 +6995,8 @@ const MultiSelectDropdown = ({
6995
6995
  // pushUrlParamObj={"ids"}
6996
6996
  addItem = undefined,
6997
6997
  style = {},
6998
- allowClear = false
6998
+ allowClear = false,
6999
+ disabled = false
6999
7000
  }) => {
7000
7001
  const containerRef = useRef(null);
7001
7002
  const [maxVisible, setMaxVisible] = useState(1);
@@ -7096,6 +7097,7 @@ const MultiSelectDropdown = ({
7096
7097
  return options;
7097
7098
  }, [options, inputValue, inputExists, addItem]);
7098
7099
  const handleAddNew = () => {
7100
+ if (disabled) return;
7099
7101
  if (!inputValue.trim()) return;
7100
7102
  const newLabel = inputValue.trim();
7101
7103
  // Prevent duplicate by value or label (case-insensitive)
@@ -7143,6 +7145,7 @@ const MultiSelectDropdown = ({
7143
7145
  return /*#__PURE__*/React__default.createElement(components.Option, props);
7144
7146
  };
7145
7147
  const handleChange = selectedItems => {
7148
+ if (disabled) return;
7146
7149
  if (isMulti) {
7147
7150
  const values = selectedItems ? selectedItems.map(item => item.value) : [];
7148
7151
  onChange(values);
@@ -7263,16 +7266,22 @@ const MultiSelectDropdown = ({
7263
7266
  return /*#__PURE__*/React__default.createElement("div", {
7264
7267
  style: {
7265
7268
  width: "100%",
7266
- ...style
7269
+ ...style,
7270
+ ...(disabled ? {
7271
+ opacity: 0.6
7272
+ } : {})
7267
7273
  },
7268
7274
  ref: containerRef,
7269
- className: showRequiredError ? "select-required-error" : ""
7275
+ className: showRequiredError ? "select-required-error" : "",
7276
+ "aria-disabled": disabled
7270
7277
  }, /*#__PURE__*/React__default.createElement(StateManagedSelect$1, {
7271
7278
  isMulti: isMulti,
7272
7279
  isClearable: allowClear,
7280
+ isDisabled: disabled,
7273
7281
  options: menuOptions,
7274
7282
  value: selectedOptions,
7275
7283
  onChange: (val, action) => {
7284
+ if (disabled) return;
7276
7285
  // If user selects the +Add option, handle it
7277
7286
  if (action && action.action === 'select-option' && val && val.length && val[val.length - 1]?.__isAddNew) {
7278
7287
  handleAddNew();
@@ -7291,6 +7300,7 @@ const MultiSelectDropdown = ({
7291
7300
  "aria-required": required,
7292
7301
  inputValue: inputValue,
7293
7302
  onInputChange: (val, action) => {
7303
+ if (disabled) return;
7294
7304
  if (action.action === "input-change") setInputValue(val);
7295
7305
  }
7296
7306
  }), showRequiredError && /*#__PURE__*/React__default.createElement("div", {