@mailstep/design-system 0.8.9 → 0.8.10

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.9",
3
+ "version": "0.8.10",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -11,7 +11,7 @@ type Props = {
11
11
  checkAllButton?: boolean;
12
12
  asyncLoadKey?: string;
13
13
  isClearable?: boolean;
14
- onlyInComparator?: boolean;
14
+ withNotEqComparator?: boolean;
15
15
  disabled?: boolean;
16
16
  placeholder?: string;
17
17
  showValue?: boolean;
@@ -64,7 +64,7 @@ import uniqBy from 'lodash/uniqBy';
64
64
  import { isOptionArray } from './guards';
65
65
  var minColumnWidth = 120;
66
66
  var SelectFilter = function (_a) {
67
- 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, columnWidth = _a.columnWidth, 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 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, columnWidth = _a.columnWidth, isMulti = _a.isMulti, value = _a.value, options = _a.options, checkAllButton = _a.checkAllButton, asyncLoadKey = _a.asyncLoadKey, onAsyncLoadFilterOptions = _a.onAsyncLoadFilterOptions, _d = _a.withNotEqComparator, withNotEqComparator = _d === void 0 ? true : _d;
68
68
  var _e = useState([]), loadedOptions = _e[0], setLoadedOptions = _e[1];
69
69
  var _f = useState(false), isNotEqNoValue = _f[0], setIsNotEqNoValue = _f[1];
70
70
  var isAsync = !!asyncLoadKey;
@@ -104,9 +104,9 @@ var SelectFilter = function (_a) {
104
104
  var isSelectClearable = isWide ? isClearable : false;
105
105
  var placeholderValue = placeholder || (isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined);
106
106
  if (isMulti) {
107
- var placeholderIcon = isWide ? (isNotEq ? 'notEqual' : 'equals') : null;
107
+ var placeholderIcon = isWide && isAsync ? (isNotEq ? 'notEqual' : 'equals') : null;
108
108
  var selectValue = showValue ? (isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value) : undefined;
109
- return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: selectValue, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: placeholderValue, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, placeholderIcon: placeholderIcon, onIconClick: !onlyInComparator ? handleIconClick : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true, disabled: disabled, isClearable: isSelectClearable }));
109
+ return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: selectValue, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: placeholderValue, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, placeholderIcon: placeholderIcon, onIconClick: withNotEqComparator ? handleIconClick : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true, disabled: disabled, isClearable: isSelectClearable }));
110
110
  }
111
111
  return (_jsx(SingleSelect, { maxMenuHeight: 250, onChange: onChange, value: showValue ? value : undefined, options: options, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, placeholder: placeholderValue, placeholderIcon: isWide ? undefined : null, isClearable: isSelectClearable, disabled: disabled }));
112
112
  };
@@ -117,7 +117,7 @@ export type ColumnDefinition<ColumnName extends string = string> = ColumnBasePro
117
117
  isUuid?: boolean;
118
118
  defaultComparator?: string;
119
119
  checkAllButton?: boolean;
120
- onlyInComparator?: boolean;
120
+ withNotEqComparator?: boolean;
121
121
  };
122
122
  getFilterCriteria?: (value: string) => Record<string, any> | null;
123
123
  filterOptions?: Option[];