@mailstep/design-system 0.8.8-beta.1 → 0.8.8-beta.2
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/package.json +1 -1
- package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.js +5 -4
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +1 -0
- package/ui/Blocks/CommonGrid/types.d.ts +1 -0
- package/ui/index.es.js +13444 -14069
- package/ui/index.umd.js +438 -438
package/package.json
CHANGED
|
@@ -63,9 +63,9 @@ import isArray from 'lodash/isArray';
|
|
|
63
63
|
import uniqBy from 'lodash/uniqBy';
|
|
64
64
|
import { isOptionArray } from './guards';
|
|
65
65
|
var SelectFilter = function (_a) {
|
|
66
|
-
var onChange = _a.onChange, _b = _a.isClearable, isClearable = _b === void 0 ? true : _b, disabled = _a.disabled, placeholder = _a.placeholder, isMulti = _a.isMulti, value = _a.value, options = _a.options, checkAllButton = _a.checkAllButton, asyncLoadKey = _a.asyncLoadKey, onAsyncLoadFilterOptions = _a.onAsyncLoadFilterOptions,
|
|
67
|
-
var
|
|
68
|
-
var
|
|
66
|
+
var onChange = _a.onChange, _b = _a.isClearable, isClearable = _b === void 0 ? true : _b, disabled = _a.disabled, placeholder = _a.placeholder, _c = _a.showValue, showValue = _c === void 0 ? true : _c, isMulti = _a.isMulti, value = _a.value, options = _a.options, checkAllButton = _a.checkAllButton, asyncLoadKey = _a.asyncLoadKey, onAsyncLoadFilterOptions = _a.onAsyncLoadFilterOptions, _d = _a.onlyInComparator, onlyInComparator = _d === void 0 ? false : _d;
|
|
67
|
+
var _e = useState([]), loadedOptions = _e[0], setLoadedOptions = _e[1];
|
|
68
|
+
var _f = useState(false), isNotEqNoValue = _f[0], setIsNotEqNoValue = _f[1];
|
|
69
69
|
var isAsync = !!asyncLoadKey;
|
|
70
70
|
var isNotEq = useMemo(function () { return (isOptionArray(value) ? value.some(function (option) { return option.isNotEq; }) : isNotEqNoValue); }, [value, isNotEqNoValue]);
|
|
71
71
|
var handleOnMultiChange = useCallback(function (options) {
|
|
@@ -101,7 +101,8 @@ var SelectFilter = function (_a) {
|
|
|
101
101
|
var defaultOptions = useMemo(function () { return (isMulti && isAsync && isOptionArray(value) ? uniqBy(__spreadArray(__spreadArray([], loadedOptions, true), value, true), 'value') : undefined); }, [isAsync, value, loadedOptions]);
|
|
102
102
|
if (isMulti) {
|
|
103
103
|
var placerholderValue = placeholder || (isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined);
|
|
104
|
-
|
|
104
|
+
var selectValue = showValue ? (isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value) : undefined;
|
|
105
|
+
return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: selectValue, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: placerholderValue, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, placeholderIcon: isNotEq ? 'notEqual' : 'equals', onIconClick: !onlyInComparator ? handleIconClick : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true, disabled: disabled }));
|
|
105
106
|
}
|
|
106
107
|
return (_jsx(SingleSelect, { maxMenuHeight: 250, onChange: onChange, value: value, options: options, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, placeholder: isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined, isClearable: isClearable }));
|
|
107
108
|
};
|
|
@@ -108,6 +108,7 @@ export type ColumnDefinition<ColumnName extends string = string> = ColumnBasePro
|
|
|
108
108
|
isMulti?: boolean;
|
|
109
109
|
disabled?: boolean;
|
|
110
110
|
placeholder?: string;
|
|
111
|
+
showValue?: boolean;
|
|
111
112
|
comparators?: Comparator[];
|
|
112
113
|
filterTime?: boolean;
|
|
113
114
|
decimals?: number;
|