@mailstep/design-system 0.8.11-beta.1 → 0.8.12

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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/ui/Blocks/CommonGrid/CommonGridContainer.js +10 -3
  3. package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +1 -0
  4. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +3 -1
  5. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +14 -7
  6. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +1 -0
  7. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +27 -7
  8. package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.d.ts +1 -0
  9. package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +17 -5
  10. package/ui/Blocks/CommonGrid/components/GridInfo/index.js +2 -0
  11. package/ui/Blocks/CommonGrid/components/MobileFilterDropdown.d.ts +4 -0
  12. package/ui/Blocks/CommonGrid/components/MobileFilterDropdown.js +13 -0
  13. package/ui/Blocks/CommonGrid/components/MobileFilterModal.d.ts +20 -0
  14. package/ui/Blocks/CommonGrid/components/MobileFilterModal.js +69 -0
  15. package/ui/Blocks/CommonGrid/components/MobileSortModal.d.ts +13 -0
  16. package/ui/Blocks/CommonGrid/components/MobileSortModal.js +34 -0
  17. package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.d.ts +1 -1
  18. package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.js +2 -2
  19. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
  20. package/ui/Blocks/CommonGrid/hooks/useQuickFilter.d.ts +2 -2
  21. package/ui/Blocks/CommonGrid/hooks/useQuickFilter.js +2 -2
  22. package/ui/Blocks/CommonGrid/store/index.d.ts +4 -6
  23. package/ui/Blocks/CommonGrid/store/index.js +9 -2
  24. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +18 -0
  25. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +37 -9
  26. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +2 -0
  27. package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +18 -14
  28. package/ui/Blocks/CommonGrid/styles.d.ts +1 -0
  29. package/ui/Blocks/CommonGrid/styles.js +6 -3
  30. package/ui/Blocks/CommonGrid/types.d.ts +1 -1
  31. package/ui/Blocks/CommonGrid/utils/index.d.ts +2 -0
  32. package/ui/Blocks/CommonGrid/utils/index.js +10 -2
  33. package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -1
  34. package/ui/Elements/Icon/icons/Filter.d.ts +4 -0
  35. package/ui/Elements/Icon/icons/Filter.js +13 -0
  36. package/ui/Elements/Icon/icons/Sort.d.ts +4 -0
  37. package/ui/Elements/Icon/icons/Sort.js +13 -0
  38. package/ui/Elements/Icon/icons/index.d.ts +2 -0
  39. package/ui/Elements/Icon/icons/index.js +2 -0
  40. package/ui/index.es.js +16884 -16062
  41. package/ui/index.umd.js +494 -454
  42. package/ui/utils/translations.js +1 -1
@@ -9,3 +9,21 @@ export declare const ComplexWithPaginationAndRedux: {
9
9
  name: string;
10
10
  };
11
11
  };
12
+ export declare const ComplexWithCheckbox: {
13
+ (): import("react/jsx-runtime").JSX.Element;
14
+ story: {
15
+ name: string;
16
+ };
17
+ };
18
+ export declare const ComplexWithEditButton: {
19
+ (): import("react/jsx-runtime").JSX.Element;
20
+ story: {
21
+ name: string;
22
+ };
23
+ };
24
+ export declare const ComplexWithStickyColumn: {
25
+ (): import("react/jsx-runtime").JSX.Element;
26
+ story: {
27
+ name: string;
28
+ };
29
+ };
@@ -5,16 +5,9 @@ import withReduxActions from '../../HoC/withReduxActions';
5
5
  import { useAddFilter } from '../../hooks/useAddFilter';
6
6
  import { ExtraControlButtonPosition } from '../../types';
7
7
  import { onRowEditClick, onRowReadClick, onRowAction, onRowClick, onBatchAction } from '../utils/actions';
8
- import { columnDefinitions, enumColumn } from '../utils/columnDefinition';
8
+ import { columnDefinitions, enumColumn, columnDefinitionsWithSticky } from '../utils/columnDefinition';
9
9
  import { ReduxGrid, createRandomData, enumValues, gridDummyActions, onAsyncLoadFilterOptions } from '../utils/utils';
10
10
  import withRedux from '../utils/withRedux';
11
- var ActionColumnButtons = {
12
- flexBasis: 80,
13
- forceCheckboxes: true,
14
- addRowNumbers: false,
15
- canRowEdit: true,
16
- canRowRead: false
17
- };
18
11
  var FilterSetter = function (_a) {
19
12
  var gridActions = _a.gridActions;
20
13
  var handleAddFilter = useAddFilter(gridActions === null || gridActions === void 0 ? void 0 : gridActions.addFilter);
@@ -30,6 +23,17 @@ var extraControlButtons = [
30
23
  position: ExtraControlButtonPosition.TopRight,
31
24
  label: 'Create',
32
25
  onClick: alert
26
+ },
27
+ {
28
+ position: ExtraControlButtonPosition.TopRight,
29
+ label: 'Select',
30
+ onSelect: function (value) {
31
+ console.log(value);
32
+ },
33
+ options: [
34
+ { label: 'Option 1', value: 'option1' },
35
+ { label: 'Option 2', value: 'option2' }
36
+ ]
33
37
  }
34
38
  ];
35
39
  var comparators = {
@@ -47,7 +51,31 @@ export default {
47
51
  title: 'Blocks/CommonGrid',
48
52
  decorators: [withRedux]
49
53
  };
50
- export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnButtons, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "alwaysOffColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName" })] })); };
54
+ export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName" })] })); };
51
55
  ComplexWithPaginationAndRedux.story = {
52
56
  name: 'Complex, with pagination and redux'
53
57
  };
58
+ export var ComplexWithCheckbox = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", actionColumnDefinition: {
59
+ flexBasis: 40,
60
+ forceCheckboxes: true,
61
+ addRowNumbers: false,
62
+ canRowEdit: false,
63
+ canRowRead: false
64
+ } })] })); };
65
+ ComplexWithCheckbox.story = {
66
+ name: 'Complex, with checkbox'
67
+ };
68
+ export var ComplexWithEditButton = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", actionColumnDefinition: {
69
+ flexBasis: 70,
70
+ forceCheckboxes: true,
71
+ addRowNumbers: false,
72
+ canRowEdit: true,
73
+ canRowRead: false
74
+ } })] })); };
75
+ ComplexWithEditButton.story = {
76
+ name: 'Complex, with edit button'
77
+ };
78
+ export var ComplexWithStickyColumn = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitionsWithSticky, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridNameSticky" })] })); };
79
+ ComplexWithStickyColumn.story = {
80
+ name: 'Complex, with sticky column'
81
+ };
@@ -8,3 +8,5 @@ export declare const oversizedColumnDefinition: {
8
8
  }[];
9
9
  export declare const enumColumn: ColumnDefinition;
10
10
  export declare const columnDefinitions: ColumnDefinition[];
11
+ export declare const stickyColumn: ColumnDefinition;
12
+ export declare const columnDefinitionsWithSticky: ColumnDefinition[];
@@ -1,3 +1,12 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
1
10
  import { ComplexCell } from '../components/ComplexCell';
2
11
  import { EnumCellExample } from '../components/EnumCellExample';
3
12
  import { enumValues } from './utils';
@@ -100,19 +109,14 @@ export var columnDefinitions = [
100
109
  title: 'Complex Column',
101
110
  flexBasis: 350,
102
111
  cellComponent: ComplexCell
103
- },
104
- {
105
- name: 'stickyColumn',
106
- title: 'Sticky Column',
107
- flexBasis: 160,
108
- alwaysOn: true,
109
- sticky: true,
110
- stickTo: 'right'
111
- },
112
- {
113
- name: 'alwaysOffColumn',
114
- title: 'Always Off Column',
115
- flexBasis: 0,
116
- alwaysOff: true,
117
112
  }
118
113
  ];
114
+ export var stickyColumn = {
115
+ name: 'stickyColumn',
116
+ title: 'Sticky Column',
117
+ flexBasis: 160,
118
+ alwaysOn: true,
119
+ sticky: true,
120
+ stickTo: 'right'
121
+ };
122
+ export var columnDefinitionsWithSticky = __spreadArray(__spreadArray([], columnDefinitions, true), [stickyColumn], false);
@@ -15,4 +15,5 @@ export declare const CommonGridWithStyles: import('styled-components').StyledCom
15
15
  }>, import('@xstyled/system').Theme, {
16
16
  withButtonStrip: boolean;
17
17
  hasGroupsOrFilters: boolean;
18
+ hasGroups: boolean;
18
19
  }, never>;
@@ -21,14 +21,17 @@ export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3
21
21
  var withPagination = _a.withPagination;
22
22
  return (withPagination ? gridFooterHeight : 0);
23
23
  });
24
- export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: ", "px;\n flex-wrap: wrap;\n z-index: 3;\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: ", "px;\n flex-wrap: wrap;\n z-index: 3;\n"])), gridButtonStripHeight);
25
- export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
24
+ export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: ", "px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (max-width: 768px) {\n min-height: auto;\n padding: 10px;\n }\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: ", "px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (max-width: 768px) {\n min-height: auto;\n padding: 10px;\n }\n"])), gridButtonStripHeight);
25
+ export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n @media (max-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: none;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n @media (max-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: none;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
26
26
  var withButtonStrip = _a.withButtonStrip;
27
27
  return (withButtonStrip ? gridButtonStripHeight : 0);
28
28
  }, th('fonts.primary'), gridRowHeight, function (_a) {
29
29
  var hasGroupsOrFilters = _a.hasGroupsOrFilters;
30
30
  return gridHeadHeight + (hasGroupsOrFilters ? gridFilterHeight : 0);
31
- }, th('colors.lightGray6'), th('fonts.primary'), function (_a) {
31
+ }, th('colors.lightGray6'), function (_a) {
32
+ var hasGroups = _a.hasGroups;
33
+ return gridHeadHeight + (hasGroups ? gridFilterHeight : 0);
34
+ }, th('fonts.primary'), function (_a) {
32
35
  var theme = _a.theme;
33
36
  return theme.colors.white;
34
37
  });
@@ -128,7 +128,6 @@ export type ColumnDefinition<ColumnName extends string = string> = ColumnBasePro
128
128
  flexShrink?: number;
129
129
  fixedSize?: boolean;
130
130
  alwaysOn?: boolean;
131
- alwaysOff?: boolean;
132
131
  defaultHidden?: boolean;
133
132
  sticky?: boolean;
134
133
  stickTo?: StickTo;
@@ -229,6 +228,7 @@ export type GridActionsType = {
229
228
  setFilters?: (filters: Filtering) => void;
230
229
  resetFilters?: () => void;
231
230
  addSorting?: (column: string, direction: SortingValueType) => void;
231
+ resetSorting?: () => void;
232
232
  openConfigForm?: () => void;
233
233
  closeConfigForm?: () => void;
234
234
  clearSettings?: () => void;
@@ -19,5 +19,7 @@ export declare const getGroups: (columns: ColumnDefinition[]) => Group[];
19
19
  export declare const getGroupClassNames: (group?: Group) => string;
20
20
  export declare const getStickyCollClassNames: (sticky: boolean, stickTo?: StickTo) => string;
21
21
  export declare const getFilters: (optimizeFilters: boolean) => FiltersConfig;
22
+ /** Returns true when a filter value should be counted / applied */
23
+ export declare const isFilterActive: (value: any) => boolean;
22
24
  export declare const checksColumnsOrder: (colsOrder: string[], columnsDefinitions: ColumnDefinition[]) => void;
23
25
  export {};
@@ -26,8 +26,6 @@ export var isColumnOn = function (column, columnConfig) {
26
26
  var _a;
27
27
  if (column.alwaysOn)
28
28
  return true;
29
- if (column.alwaysOff)
30
- return false;
31
29
  var isHidden = (_a = columnConfig === null || columnConfig === void 0 ? void 0 : columnConfig[column.name]) === null || _a === void 0 ? void 0 : _a.isHidden;
32
30
  if (typeof isHidden === 'boolean')
33
31
  return !isHidden; // isHidden is defined/stored => use user value
@@ -76,6 +74,16 @@ export var getFilters = function (optimizeFilters) {
76
74
  }
77
75
  return filters;
78
76
  };
77
+ /** Returns true when a filter value should be counted / applied */
78
+ export var isFilterActive = function (value) {
79
+ if (value == null)
80
+ return false;
81
+ if (Array.isArray(value))
82
+ return !!value.length;
83
+ if (typeof value === 'object')
84
+ return value.value != null && value.value !== '';
85
+ return value !== '';
86
+ };
79
87
  export var checksColumnsOrder = function (colsOrder, columnsDefinitions) {
80
88
  var stickyRightColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo === 'right'; });
81
89
  var stickyLeftColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo !== 'right'; });
@@ -18,7 +18,7 @@ import { useCallback } from 'react';
18
18
  import { useLocation } from 'react-router';
19
19
  import Link from '../../Link/Link';
20
20
  import styled, { css } from '@xstyled/styled-components';
21
- var StyledLink = styled(Link)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n border-top: ", ";\n padding-top: ", ";\n color: typoPrimary;\n\n :hover > * {\n color: typoPrimary;\n background-color: bgLightGray1;\n border-radius: 6px;\n }\n ", "\n"], ["\n display: block;\n border-top: ", ";\n padding-top: ", ";\n color: typoPrimary;\n\n :hover > * {\n color: typoPrimary;\n background-color: bgLightGray1;\n border-radius: 6px;\n }\n ", "\n"])), function (_a) {
21
+ var StyledLink = styled(Link)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n border-top: ", ";\n padding-top: ", ";\n color: typoPrimary;\n text-decoration: none;\n\n :hover > * {\n color: typoPrimary;\n background-color: bgLightGray1;\n border-radius: 6px;\n }\n ", "\n"], ["\n display: block;\n border-top: ", ";\n padding-top: ", ";\n color: typoPrimary;\n text-decoration: none;\n\n :hover > * {\n color: typoPrimary;\n background-color: bgLightGray1;\n border-radius: 6px;\n }\n ", "\n"])), function (_a) {
22
22
  var $hasSeparator = _a.$hasSeparator;
23
23
  return ($hasSeparator ? '1px solid #D2D8DF' : 'none');
24
24
  }, function (_a) {
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { SvgProps } from '../types';
3
+
4
+ export declare const Filter: FC<SvgProps>;
@@ -0,0 +1,13 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ export var Filter = function (props) { return (_jsx("svg", __assign({ width: "14", height: "9", viewBox: "0 0 14 9", fill: "#DB2B19", xmlns: "http://www.w3.org/2000/svg" }, props, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 0V1.5H13.5V0H0ZM5.25 9H8.25V7.5H5.25V9ZM11.25 5.25H2.25V3.75H11.25V5.25Z" }) }))); };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { SvgProps } from '../types';
3
+
4
+ export declare const Sort: FC<SvgProps>;
@@ -0,0 +1,13 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ export var Sort = function (props) { return (_jsxs("svg", __assign({ width: "14", height: "14", viewBox: "0 0 14 14", stroke: "#DB2B19", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M3.5 1.5V12.5M3.5 12.5L1.5 10.5M3.5 12.5L5.5 10.5", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.5 12.5V1.5M10.5 1.5L8.5 3.5M10.5 1.5L12.5 3.5", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }))); };
@@ -83,3 +83,5 @@ export { Moon } from './Moon';
83
83
  export { CircleHalfStroke } from './CircleHalfStroke';
84
84
  export { ShieldUser } from './ShieldUser';
85
85
  export { UserCowboy } from './UserCowboy';
86
+ export { Filter } from './Filter';
87
+ export { Sort } from './Sort';
@@ -83,3 +83,5 @@ export { Moon } from './Moon';
83
83
  export { CircleHalfStroke } from './CircleHalfStroke';
84
84
  export { ShieldUser } from './ShieldUser';
85
85
  export { UserCowboy } from './UserCowboy';
86
+ export { Filter } from './Filter';
87
+ export { Sort } from './Sort';