trotl-filter 1.0.11 → 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 +16 -2
- package/dist/index.cjs.js +15 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +15 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
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.
|
|
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
|
@@ -7014,7 +7014,9 @@ const MultiSelectDropdown = ({
|
|
|
7014
7014
|
pushUrlParamObj = false,
|
|
7015
7015
|
// pushUrlParamObj={"ids"}
|
|
7016
7016
|
addItem = undefined,
|
|
7017
|
-
style = {}
|
|
7017
|
+
style = {},
|
|
7018
|
+
allowClear = false,
|
|
7019
|
+
disabled = false
|
|
7018
7020
|
}) => {
|
|
7019
7021
|
const containerRef = React.useRef(null);
|
|
7020
7022
|
const [maxVisible, setMaxVisible] = React.useState(1);
|
|
@@ -7115,6 +7117,7 @@ const MultiSelectDropdown = ({
|
|
|
7115
7117
|
return options;
|
|
7116
7118
|
}, [options, inputValue, inputExists, addItem]);
|
|
7117
7119
|
const handleAddNew = () => {
|
|
7120
|
+
if (disabled) return;
|
|
7118
7121
|
if (!inputValue.trim()) return;
|
|
7119
7122
|
const newLabel = inputValue.trim();
|
|
7120
7123
|
// Prevent duplicate by value or label (case-insensitive)
|
|
@@ -7162,6 +7165,7 @@ const MultiSelectDropdown = ({
|
|
|
7162
7165
|
return /*#__PURE__*/React.createElement(components.Option, props);
|
|
7163
7166
|
};
|
|
7164
7167
|
const handleChange = selectedItems => {
|
|
7168
|
+
if (disabled) return;
|
|
7165
7169
|
if (isMulti) {
|
|
7166
7170
|
const values = selectedItems ? selectedItems.map(item => item.value) : [];
|
|
7167
7171
|
onChange(values);
|
|
@@ -7282,15 +7286,22 @@ const MultiSelectDropdown = ({
|
|
|
7282
7286
|
return /*#__PURE__*/React.createElement("div", {
|
|
7283
7287
|
style: {
|
|
7284
7288
|
width: "100%",
|
|
7285
|
-
...style
|
|
7289
|
+
...style,
|
|
7290
|
+
...(disabled ? {
|
|
7291
|
+
opacity: 0.6
|
|
7292
|
+
} : {})
|
|
7286
7293
|
},
|
|
7287
7294
|
ref: containerRef,
|
|
7288
|
-
className: showRequiredError ? "select-required-error" : ""
|
|
7295
|
+
className: showRequiredError ? "select-required-error" : "",
|
|
7296
|
+
"aria-disabled": disabled
|
|
7289
7297
|
}, /*#__PURE__*/React.createElement(StateManagedSelect$1, {
|
|
7290
7298
|
isMulti: isMulti,
|
|
7299
|
+
isClearable: allowClear,
|
|
7300
|
+
isDisabled: disabled,
|
|
7291
7301
|
options: menuOptions,
|
|
7292
7302
|
value: selectedOptions,
|
|
7293
7303
|
onChange: (val, action) => {
|
|
7304
|
+
if (disabled) return;
|
|
7294
7305
|
// If user selects the +Add option, handle it
|
|
7295
7306
|
if (action && action.action === 'select-option' && val && val.length && val[val.length - 1]?.__isAddNew) {
|
|
7296
7307
|
handleAddNew();
|
|
@@ -7309,6 +7320,7 @@ const MultiSelectDropdown = ({
|
|
|
7309
7320
|
"aria-required": required,
|
|
7310
7321
|
inputValue: inputValue,
|
|
7311
7322
|
onInputChange: (val, action) => {
|
|
7323
|
+
if (disabled) return;
|
|
7312
7324
|
if (action.action === "input-change") setInputValue(val);
|
|
7313
7325
|
}
|
|
7314
7326
|
}), showRequiredError && /*#__PURE__*/React.createElement("div", {
|