@mailstep/design-system 0.7.30-beta.4 → 0.7.30-beta.5
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/ColumnFilterCell.d.ts +2 -1
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +2 -2
- package/ui/Blocks/CommonGrid/components/FilterRow.js +1 -1
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +2 -2
- package/ui/index.es.js +4158 -4156
- package/ui/index.umd.js +158 -158
package/package.json
CHANGED
|
@@ -2,11 +2,12 @@ import type { ColumnDefinition, GridActionsType, FiltersConfig, CustomComparator
|
|
|
2
2
|
type Props = {
|
|
3
3
|
onChange: Required<GridActionsType>['addFilter'];
|
|
4
4
|
value?: any;
|
|
5
|
+
others?: any;
|
|
5
6
|
column: ColumnDefinition;
|
|
6
7
|
displayColumnWidth: number;
|
|
7
8
|
filters?: FiltersConfig;
|
|
8
9
|
group?: Group;
|
|
9
10
|
comparators?: CustomComparators;
|
|
10
11
|
};
|
|
11
|
-
declare const ColumnFilterCell: ({ onChange, value, displayColumnWidth, filters, column: columnDefinition, group, comparators }: Props) => JSX.Element;
|
|
12
|
+
declare const ColumnFilterCell: ({ onChange, value, others, displayColumnWidth, filters, column: columnDefinition, group, comparators }: Props) => JSX.Element;
|
|
12
13
|
export default ColumnFilterCell;
|
|
@@ -17,7 +17,7 @@ import { x } from '@xstyled/styled-components';
|
|
|
17
17
|
import OverlayComponent from './FilterDropdown';
|
|
18
18
|
import { Cell } from './Table';
|
|
19
19
|
var ColumnFilterCell = function (_a) {
|
|
20
|
-
var onChange = _a.onChange, value = _a.value, displayColumnWidth = _a.displayColumnWidth, filters = _a.filters, columnDefinition = _a.column, group = _a.group, comparators = _a.comparators;
|
|
20
|
+
var onChange = _a.onChange, value = _a.value, others = _a.others, displayColumnWidth = _a.displayColumnWidth, filters = _a.filters, columnDefinition = _a.column, group = _a.group, comparators = _a.comparators;
|
|
21
21
|
var cellSizeProps = getCellSizeProps(columnDefinition, displayColumnWidth);
|
|
22
22
|
var handleAddFilter = useAddFilter(onChange);
|
|
23
23
|
var handleChange = React.useCallback(function (event, others) {
|
|
@@ -35,6 +35,6 @@ var ColumnFilterCell = function (_a) {
|
|
|
35
35
|
console.error("ERROR, using unknown filter type ".concat(filterType));
|
|
36
36
|
return (_jsx(x.div, { children: _jsx("span", { children: "".concat(filterType, " filter") }) }));
|
|
37
37
|
}
|
|
38
|
-
return (_jsx(Cell, __assign({ className: cellClassName }, cellSizeProps, { children: _jsx(x.div, { children: _jsx(RenderComponent, __assign({ "data-test": columnDefinition.name, name: columnDefinition.name, onChange: handleChange, value: value, OverlayComponent: OverlayComponent, comparators: defaultComparators }, filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.defaultExtraProps, columnDefinition.filterExtraProps, (filterType == 'options' && { options: columnDefinition.filterOptions }))) }) })));
|
|
38
|
+
return (_jsx(Cell, __assign({ className: cellClassName }, cellSizeProps, { children: _jsx(x.div, { children: _jsx(RenderComponent, __assign({ "data-test": columnDefinition.name, name: columnDefinition.name, onChange: handleChange, value: value, others: others, OverlayComponent: OverlayComponent, comparators: defaultComparators }, filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.defaultExtraProps, columnDefinition.filterExtraProps, (filterType == 'options' && { options: columnDefinition.filterOptions }))) }) })));
|
|
39
39
|
};
|
|
40
40
|
export default ColumnFilterCell;
|
|
@@ -29,6 +29,6 @@ var FilterRow = function (_a) {
|
|
|
29
29
|
var displayCheckbox = (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.checkAllPosition) === 'top' && (((_b = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _b === void 0 ? void 0 : _b.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes));
|
|
30
30
|
var displayRowNumberLabel = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers;
|
|
31
31
|
var rowsNumberLabel = (_c = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbersLabel) !== null && _c !== void 0 ? _c : '#';
|
|
32
|
-
return (_jsxs(Row, { className: "filterRow", children: [displayCheckbox && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx(Checkbox, { checked: allChecked, onChange: toggleCheckbox, label: "" }, "check-all") })), displayRowNumberLabel && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx("div", { children: rowsNumberLabel }) })), !!(!displayCheckbox && !displayRowNumberLabel && actionColumn) && (_jsx(Cell, { className: "cell", style: actionColumnStyle }, 'actions')), columns.map(function (column, index) { return (_jsx(ColumnFilterCell, { column: column, onChange: handleOnChange, value: get([getFilterName(column), 'value'], filterValues), displayColumnWidth: displayColumnsWidth[column.name], filters: filters, comparators: comparators, group: groups === null || groups === void 0 ? void 0 : groups[index] }, index)); })] }));
|
|
32
|
+
return (_jsxs(Row, { className: "filterRow", children: [displayCheckbox && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx(Checkbox, { checked: allChecked, onChange: toggleCheckbox, label: "" }, "check-all") })), displayRowNumberLabel && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx("div", { children: rowsNumberLabel }) })), !!(!displayCheckbox && !displayRowNumberLabel && actionColumn) && (_jsx(Cell, { className: "cell", style: actionColumnStyle }, 'actions')), columns.map(function (column, index) { return (_jsx(ColumnFilterCell, { column: column, onChange: handleOnChange, value: get([getFilterName(column), 'value'], filterValues), others: get([getFilterName(column), 'others'], filterValues), displayColumnWidth: displayColumnsWidth[column.name], filters: filters, comparators: comparators, group: groups === null || groups === void 0 ? void 0 : groups[index] }, index)); })] }));
|
|
33
33
|
};
|
|
34
34
|
export default FilterRow;
|
|
@@ -41,10 +41,10 @@ var OverlayComponentDefault = function (_a) {
|
|
|
41
41
|
};
|
|
42
42
|
var DatePickerRange = function (props) {
|
|
43
43
|
var _a, _b, _c;
|
|
44
|
-
var onChange = props.onChange, error = props.error, label = props.label, value = props.value, filterTime = props.filterTime, initialView = props.initialView, _d = props.OverlayComponent, OverlayComponent = _d === void 0 ? OverlayComponentDefault : _d, rest = __rest(props, ["onChange", "error", "label", "value", "filterTime", "initialView", "OverlayComponent"]);
|
|
44
|
+
var onChange = props.onChange, error = props.error, label = props.label, value = props.value, initialOthers = props.others, filterTime = props.filterTime, initialView = props.initialView, _d = props.OverlayComponent, OverlayComponent = _d === void 0 ? OverlayComponentDefault : _d, rest = __rest(props, ["onChange", "error", "label", "value", "others", "filterTime", "initialView", "OverlayComponent"]);
|
|
45
45
|
var _e = useState((_a = value === null || value === void 0 ? void 0 : value[0]) !== null && _a !== void 0 ? _a : undefined), startRangeValue = _e[0], setStartRangeValue = _e[1];
|
|
46
46
|
var _f = useState((_b = value === null || value === void 0 ? void 0 : value[1]) !== null && _b !== void 0 ? _b : undefined), endRangeValue = _f[0], setEndRangeValue = _f[1];
|
|
47
|
-
var _g = useState(
|
|
47
|
+
var _g = useState(initialOthers), others = _g[0], setOthersValues = _g[1];
|
|
48
48
|
var timeFormat = filterTime ? 'HH:mm' : false;
|
|
49
49
|
var placeholder = i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' });
|
|
50
50
|
var cleanValue = React.useMemo(function () { return getCleanValues(value); }, [value]);
|