@mailstep/design-system 0.7.47 → 0.7.48-beta.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.7.47",
3
+ "version": "0.7.48-beta.2",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -25,44 +25,39 @@ var useEditReadAsColumn = function (props) {
25
25
  return onRowAction(id, field, value, rowData);
26
26
  }
27
27
  }, [onRowAction, onRowEditClick, onRowReadClick]);
28
- var _b = actionColumnDefinition || {}, canRowEdit = _b.canRowEdit, canRowRead = _b.canRowRead, addRowNumbers = _b.addRowNumbers, _c = _b.stickTo, stickTo = _c === void 0 ? 'left' : _c, _d = _b.flexBasis, flexBasis = _d === void 0 ? 88 : _d;
28
+ var _b = actionColumnDefinition || {}, canRowEdit = _b.canRowEdit, canRowRead = _b.canRowRead, addRowNumbers = _b.addRowNumbers, _c = _b.stickTo, stickTo = _c === void 0 ? 'left' : _c, _d = _b.flexBasis, flexBasis = _d === void 0 ? 16 : _d;
29
29
  var withCheckboxes = !!((_a = actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.actionOptions) === null || _a === void 0 ? void 0 : _a.length) || (actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.forceCheckboxes);
30
+ var hasActions = canRowEdit || canRowRead || withCheckboxes || addRowNumbers;
30
31
  var modifiedColumnsDefinitions = useMemo(function () {
31
32
  var _a;
32
- if (canRowEdit || canRowRead || withCheckboxes || addRowNumbers) {
33
- var editReadColumnDefinition = {
34
- name: 'actions',
35
- flexBasis: flexBasis,
36
- filtering: withCheckboxes || addRowNumbers,
37
- filteringType: 'actions',
38
- sorting: false,
39
- sticky: true,
40
- stickTo: stickTo,
41
- alwaysOn: true,
42
- cellComponent: withProps({
43
- actionColumnDefinition: actionColumnDefinition,
44
- withCheckboxes: withCheckboxes,
45
- addRowNumbers: actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.addRowNumbers,
46
- checkedRows: (_a = gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.uxState) === null || _a === void 0 ? void 0 : _a.checkedRows,
47
- onUxChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.handleUxChange
48
- })(RowActionsCell)
49
- };
50
- if (stickTo === EditReadPosition.Left) {
51
- return __spreadArray([editReadColumnDefinition], columnsDefinitions, true);
52
- }
53
- else {
54
- return __spreadArray(__spreadArray([], columnsDefinitions, true), [editReadColumnDefinition], false);
55
- }
33
+ var editReadColumnDefinition = {
34
+ name: 'actions-cell-cg',
35
+ flexBasis: flexBasis,
36
+ filtering: withCheckboxes || addRowNumbers,
37
+ filteringType: 'actions',
38
+ sorting: false,
39
+ sticky: !!hasActions,
40
+ stickTo: stickTo,
41
+ alwaysOn: true,
42
+ cellComponent: withProps({
43
+ actionColumnDefinition: actionColumnDefinition,
44
+ withCheckboxes: withCheckboxes,
45
+ addRowNumbers: actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.addRowNumbers,
46
+ checkedRows: (_a = gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.uxState) === null || _a === void 0 ? void 0 : _a.checkedRows,
47
+ onUxChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.handleUxChange
48
+ })(RowActionsCell)
49
+ };
50
+ if (stickTo === EditReadPosition.Left) {
51
+ return __spreadArray([editReadColumnDefinition], columnsDefinitions, true);
56
52
  }
57
53
  else {
58
- return columnsDefinitions;
54
+ return __spreadArray(__spreadArray([], columnsDefinitions, true), [editReadColumnDefinition], false);
59
55
  }
60
56
  }, [
61
57
  addRowNumbers,
62
58
  flexBasis,
63
59
  stickTo,
64
- canRowEdit,
65
- canRowRead,
60
+ hasActions,
66
61
  columnsDefinitions,
67
62
  withCheckboxes,
68
63
  gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.uxState,
@@ -80,12 +80,14 @@ export var checksColumnsOrder = function (colsOrder, columnsDefinitions) {
80
80
  if (stickyLeftColls.length > 1 || stickyRightColls.length > 1) {
81
81
  console.error('Grid can have only sticky column on each side.');
82
82
  }
83
- if (stickyLeftColls.length && colsOrder.indexOf(stickyLeftColls[0].name) !== 0 && stickyLeftColls[0].name !== 'actions') {
83
+ if (stickyLeftColls.length &&
84
+ colsOrder.indexOf(stickyLeftColls[0].name) !== 0 &&
85
+ stickyLeftColls[0].name !== 'actions-cell-cg') {
84
86
  console.error('The left sticky column should be the first one in a row');
85
87
  }
86
88
  if (stickyRightColls.length &&
87
89
  colsOrder.indexOf(stickyRightColls[0].name) !== colsOrder.length - 1 &&
88
- stickyRightColls[0].name !== 'actions') {
90
+ stickyRightColls[0].name !== 'actions-cell-cg') {
89
91
  console.error('The Right sticky column should be the last one in a row');
90
92
  }
91
93
  };
@@ -300,6 +300,7 @@ declare const themes: {
300
300
  headerShadow: string;
301
301
  headerShadowB: string;
302
302
  headerShadowNotifications: string;
303
+ gridShadow: string;
303
304
  cornerDialogShadow: string;
304
305
  };
305
306
  space: {
@@ -155,6 +155,7 @@ declare const defaultTheme: {
155
155
  headerShadow: string;
156
156
  headerShadowB: string;
157
157
  headerShadowNotifications: string;
158
+ gridShadow: string;
158
159
  cornerDialogShadow: string;
159
160
  };
160
161
  space: {
@@ -160,6 +160,7 @@ var defaultTheme = {
160
160
  headerShadow: '1px 2px 3px #00000029',
161
161
  headerShadowB: '1px 1px 3px #00000029',
162
162
  headerShadowNotifications: '1px 1px 2px #00000029',
163
+ gridShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.12)',
163
164
  cornerDialogShadow: '1px 1px 3px 1px #00000029'
164
165
  },
165
166
  space: {