@mailstep/design-system 0.7.47-beta.9 → 0.7.47
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/CommonGrid.d.ts +2 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +2 -3
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.d.ts +6 -2
- package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +2 -2
- package/ui/Blocks/CommonGrid/components/DataCell.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/DataCell.js +2 -2
- package/ui/Blocks/CommonGrid/components/DataRow.d.ts +2 -3
- package/ui/Blocks/CommonGrid/components/DataRow.js +4 -21
- package/ui/Blocks/CommonGrid/components/FilterRow.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/FilterRow.js +5 -29
- package/ui/Blocks/CommonGrid/components/Filters/ActionsFilter/ActionsFilter.d.ts +10 -0
- package/ui/Blocks/CommonGrid/components/Filters/ActionsFilter/ActionsFilter.js +14 -0
- package/ui/Blocks/CommonGrid/components/Filters/ActionsFilter/index.d.ts +2 -0
- package/ui/Blocks/CommonGrid/components/Filters/ActionsFilter/index.js +2 -0
- package/ui/Blocks/CommonGrid/components/GroupRow.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/GroupRow.js +2 -4
- package/ui/Blocks/CommonGrid/components/HeadRow.js +3 -3
- package/ui/Blocks/CommonGrid/components/gridCells/Date.js +1 -1
- package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +1 -1
- package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +1 -1
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +3 -1
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +2 -5
- package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +1 -1
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +0 -1
- package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +9 -26
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +2 -2
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +3 -3
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -1
- package/ui/Blocks/CommonGrid/styles.d.ts +1 -1
- package/ui/Blocks/CommonGrid/styles.js +2 -2
- package/ui/Blocks/CommonGrid/types.d.ts +2 -1
- package/ui/Blocks/CommonGrid/utils/index.d.ts +1 -2
- package/ui/Blocks/CommonGrid/utils/index.js +12 -15
- package/ui/index.es.js +21571 -21582
- package/ui/index.umd.js +708 -702
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ColumnDefinition,
|
|
2
|
-
export declare const getActionCellSizeProps: (column: ActionColumn) => object;
|
|
1
|
+
import type { ColumnDefinition, ColumnConfig, FilterProps, Group, StickTo, FiltersConfig } from '../types';
|
|
3
2
|
export declare const getCellSizeProps: (column: ColumnDefinition, columnWidth: number) => object;
|
|
4
3
|
export declare const getSortName: (column: ColumnDefinition) => string;
|
|
5
4
|
export declare const getFilterName: (column: ColumnDefinition) => string;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import TextRange from '../components/Filters/TextRange';
|
|
3
|
-
import DatePickerRange from '../components/Filters/DatePickerRange';
|
|
1
|
+
import ActionsFilter from '../components/Filters/ActionsFilter';
|
|
4
2
|
import BooleanSelect from '../components/Filters/BooleanSelect';
|
|
3
|
+
import DatePickerRange from '../components/Filters/DatePickerRange';
|
|
5
4
|
import GridSelect from '../components/Filters/GridSelect';
|
|
5
|
+
import NumberRange from '../components/Filters/NumberRange';
|
|
6
|
+
import TextRange from '../components/Filters/TextRange';
|
|
6
7
|
var isDefined = function (val) { return typeof val !== 'undefined'; };
|
|
7
|
-
export var getActionCellSizeProps = function (column) {
|
|
8
|
-
return {
|
|
9
|
-
flexBasis: column.flexBasis,
|
|
10
|
-
flexGrow: 0,
|
|
11
|
-
flexShrink: 0,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
8
|
export var getCellSizeProps = function (column, columnWidth) {
|
|
15
9
|
if (!column)
|
|
16
10
|
return {};
|
|
@@ -19,7 +13,7 @@ export var getCellSizeProps = function (column, columnWidth) {
|
|
|
19
13
|
flexBasis: columnWidth,
|
|
20
14
|
flexGrow: fixedSize ? 0 : isDefined(flexGrow) ? flexGrow : 1,
|
|
21
15
|
flexShrink: isDefined(flexShrink) ? flexShrink : 1,
|
|
22
|
-
maxWidth: sticky ? columnWidth : 'auto'
|
|
16
|
+
maxWidth: sticky ? columnWidth : 'auto'
|
|
23
17
|
};
|
|
24
18
|
};
|
|
25
19
|
export var getSortName = function (column) {
|
|
@@ -42,7 +36,7 @@ export var isColumnOn = function (column, columnConfig) {
|
|
|
42
36
|
};
|
|
43
37
|
export var calculatePaginator = function (page, rowsPerPage) { return ({
|
|
44
38
|
offset: rowsPerPage ? rowsPerPage * (page - 1) : rowsPerPage,
|
|
45
|
-
limit: rowsPerPage
|
|
39
|
+
limit: rowsPerPage
|
|
46
40
|
}); };
|
|
47
41
|
export var createFilterType = function (columnDefinition) {
|
|
48
42
|
if (columnDefinition.filterOptions)
|
|
@@ -56,7 +50,7 @@ export var getGroups = function (columns) {
|
|
|
56
50
|
return {
|
|
57
51
|
name: column.group,
|
|
58
52
|
start: !!(column.group && (!previousGroup || (previousGroup && previousGroup !== column.group))),
|
|
59
|
-
end: !!(column.group && (!columns[key + 1] || columns[key + 1].group !== column.group))
|
|
53
|
+
end: !!(column.group && (!columns[key + 1] || columns[key + 1].group !== column.group))
|
|
60
54
|
};
|
|
61
55
|
});
|
|
62
56
|
};
|
|
@@ -73,6 +67,7 @@ export var getFilters = function (optimizeFilters) {
|
|
|
73
67
|
date: { CellComponent: DatePickerRange },
|
|
74
68
|
flag: { CellComponent: BooleanSelect },
|
|
75
69
|
options: { CellComponent: GridSelect },
|
|
70
|
+
actions: { CellComponent: ActionsFilter }
|
|
76
71
|
};
|
|
77
72
|
if (optimizeFilters) {
|
|
78
73
|
filters.text.defaultExtraProps = { defaultComparator: 'eq' };
|
|
@@ -85,10 +80,12 @@ export var checksColumnsOrder = function (colsOrder, columnsDefinitions) {
|
|
|
85
80
|
if (stickyLeftColls.length > 1 || stickyRightColls.length > 1) {
|
|
86
81
|
console.error('Grid can have only sticky column on each side.');
|
|
87
82
|
}
|
|
88
|
-
if (stickyLeftColls.length && colsOrder.indexOf(stickyLeftColls[0].name) !== 0) {
|
|
83
|
+
if (stickyLeftColls.length && colsOrder.indexOf(stickyLeftColls[0].name) !== 0 && stickyLeftColls[0].name !== 'actions') {
|
|
89
84
|
console.error('The left sticky column should be the first one in a row');
|
|
90
85
|
}
|
|
91
|
-
if (stickyRightColls.length &&
|
|
86
|
+
if (stickyRightColls.length &&
|
|
87
|
+
colsOrder.indexOf(stickyRightColls[0].name) !== colsOrder.length - 1 &&
|
|
88
|
+
stickyRightColls[0].name !== 'actions') {
|
|
92
89
|
console.error('The Right sticky column should be the last one in a row');
|
|
93
90
|
}
|
|
94
91
|
};
|