@mailstep/design-system 0.8.0 → 0.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -20,6 +20,6 @@ var getFlagOptions = function () { return [
20
20
  ]; };
21
21
  var SelectFilter = function (props) {
22
22
  var options = useMemo(function () { return getFlagOptions(); }, []);
23
- return _jsx(GridSelect, __assign({ options: options }, props));
23
+ return _jsx(GridSelect, __assign({ options: options }, props, { isClearable: false }));
24
24
  };
25
25
  export default SelectFilter;
@@ -10,6 +10,7 @@ type Props = {
10
10
  value?: string | string[] | Option[];
11
11
  checkAllButton?: boolean;
12
12
  asyncLoadKey?: string;
13
+ isClearable?: boolean;
13
14
  };
14
15
  declare const SelectFilter: FC<Props>;
15
16
  export default SelectFilter;
@@ -52,8 +52,8 @@ import isArray from 'lodash/isArray';
52
52
  import uniqBy from 'lodash/uniqBy';
53
53
  import { isOptionArray } from './guards';
54
54
  var SelectFilter = function (_a) {
55
- var onChange = _a.onChange, isMulti = _a.isMulti, value = _a.value, options = _a.options, checkAllButton = _a.checkAllButton, asyncLoadKey = _a.asyncLoadKey, onAsyncLoadFilterOptions = _a.onAsyncLoadFilterOptions;
56
- var _b = useState([]), loadedOptions = _b[0], setLoadedOptions = _b[1];
55
+ var onChange = _a.onChange, _b = _a.isClearable, isClearable = _b === void 0 ? true : _b, isMulti = _a.isMulti, value = _a.value, options = _a.options, checkAllButton = _a.checkAllButton, asyncLoadKey = _a.asyncLoadKey, onAsyncLoadFilterOptions = _a.onAsyncLoadFilterOptions;
56
+ var _c = useState([]), loadedOptions = _c[0], setLoadedOptions = _c[1];
57
57
  var handleOnMultiChange = useCallback(function (options) {
58
58
  onChange === null || onChange === void 0 ? void 0 : onChange(!isArray(options) || !(options === null || options === void 0 ? void 0 : options.length) ? null : options);
59
59
  }, [onChange]);
@@ -79,6 +79,6 @@ var SelectFilter = function (_a) {
79
79
  if (isMulti) {
80
80
  return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true }));
81
81
  }
82
- 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: true }));
82
+ 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 }));
83
83
  };
84
84
  export default SelectFilter;
@@ -265,7 +265,7 @@ var Icon = function (_a) {
265
265
  }, [icon, style, namedIcon]);
266
266
  var flipProp = (namedIcon && Array.isArray(namedIcon) && namedIcon[1]) || undefined;
267
267
  var IconComponent = icons[icon];
268
- return (_jsx(FaIconSizing, { size: size, className: className !== null && className !== void 0 ? className : '', "$colorSecondary": colorSecondary, "$fixedWidth": fixedWidth, children: IconComponent ? _jsx(IconComponent, { fill: colorFill, stroke: colorStroke }) : (_jsx(FontAwesomeIcon, { color: colorFill, flip: flipProp, icon: iconProp, className: "faIcon ".concat(fixedWidth ? 'fa-fw' : '', " ").concat(spinning ? 'fa-spin' : '') })) }));
268
+ return (_jsx(FaIconSizing, { size: size, className: className !== null && className !== void 0 ? className : '', "$colorSecondary": colorSecondary, "$fixedWidth": fixedWidth, children: IconComponent ? _jsx(IconComponent, { fill: colorFill, stroke: colorStroke, width: size, height: size }) : (_jsx(FontAwesomeIcon, { color: colorFill, flip: flipProp, icon: iconProp, className: "faIcon ".concat(fixedWidth ? 'fa-fw' : '', " ").concat(spinning ? 'fa-spin' : '') })) }));
269
269
  };
270
270
  export default Icon;
271
271
  var templateObject_1;