@fixefy/fixefy-ui-components 0.3.3 → 0.3.4
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.
|
@@ -20,6 +20,7 @@ export type AsyncDropdownPropsType = {
|
|
|
20
20
|
onAdd?: (value: any) => void;
|
|
21
21
|
onRemoveOne?: (value: any) => void;
|
|
22
22
|
onRemoveAll?: () => void;
|
|
23
|
+
onUnselectAll?: () => void;
|
|
23
24
|
type?: 'checkbox' | 'text';
|
|
24
25
|
renderOptions?: (option: Option, index: number) => void;
|
|
25
26
|
[x: string]: any;
|
|
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
|
|
|
120
120
|
fontSize: "small"
|
|
121
121
|
});
|
|
122
122
|
const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
123
|
-
const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, logo_placeholder, logo_folder_name, options_path, _id } = props;
|
|
123
|
+
const { onAdd, onRemoveOne, onRemoveAll, onUnselectAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, logo_placeholder, logo_folder_name, options_path, _id } = props;
|
|
124
124
|
let { defaultValue } = props;
|
|
125
125
|
const ref = (0, _react.useRef)(null);
|
|
126
126
|
const theme = (0, _material.useTheme)();
|
|
@@ -335,10 +335,12 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
335
335
|
return opts;
|
|
336
336
|
});
|
|
337
337
|
};
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
const unSelectAll = ()=>{
|
|
339
|
+
if (onUnselectAll) {
|
|
340
|
+
onUnselectAll();
|
|
341
|
+
setDisplayed([]);
|
|
342
|
+
sessionStorage.removeItem(`dropdown-${query}-${name}-${_id}`);
|
|
343
|
+
}
|
|
342
344
|
};
|
|
343
345
|
const displayListOptions = ()=>{
|
|
344
346
|
switch(type){
|
|
@@ -349,7 +351,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
349
351
|
multiple && /*#__PURE__*/ (0, _jsxruntime.jsxs)("li", {
|
|
350
352
|
onClick: ()=>{
|
|
351
353
|
if (displayed.length === options.length) {
|
|
352
|
-
|
|
354
|
+
unSelectAll();
|
|
353
355
|
} else {
|
|
354
356
|
selectAll();
|
|
355
357
|
}
|
package/package.json
CHANGED