@mailstep/design-system 0.7.47-beta.6 → 0.7.47-beta.7

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-beta.6",
3
+ "version": "0.7.47-beta.7",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -6,6 +6,7 @@ type Props = DataCellProps<{
6
6
  actionColumnDefinition?: ActionColumn;
7
7
  uxState?: UxState;
8
8
  onUxChange?: GridActionsType['handleUxChange'];
9
+ withCheckboxes?: boolean;
9
10
  };
10
11
  export declare const RowActionsCell: FC<Props>;
11
12
  export {};
@@ -16,8 +16,7 @@ import { x } from '@xstyled/styled-components';
16
16
  import { isFunction } from 'lodash/fp';
17
17
  import { IconButtonInCell } from './IconButtonInCell';
18
18
  export var RowActionsCell = function (_a) {
19
- var _b;
20
- var actionColumnDefinition = _a.actionColumnDefinition, rowData = _a.rowData, uxState = _a.uxState, onUxChange = _a.onUxChange, onRowAction = _a.onRowAction;
19
+ var actionColumnDefinition = _a.actionColumnDefinition, rowData = _a.rowData, uxState = _a.uxState, withCheckboxes = _a.withCheckboxes, onUxChange = _a.onUxChange, onRowAction = _a.onRowAction;
21
20
  var rowDataId = rowData === null || rowData === void 0 ? void 0 : rowData.id;
22
21
  // @TODO this should be in parent component
23
22
  var checkedRows = uxState === null || uxState === void 0 ? void 0 : uxState.checkedRows;
@@ -27,7 +26,6 @@ export var RowActionsCell = function (_a) {
27
26
  var canRead = isFunction(actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.canRowRead)
28
27
  ? actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.canRowRead(rowData)
29
28
  : actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.canRowRead;
30
- var withCheckboxes = !!((_b = actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.actionOptions) === null || _b === void 0 ? void 0 : _b.length) || (actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.forceCheckboxes);
31
29
  // if canEdit and canRead are both true, canEdit supersedes canRead
32
30
  var onClick = useCallback(function () {
33
31
  var action = canEdit ? 'row_edit' : 'row_read';
@@ -12,6 +12,7 @@ import withProps from '../HoC/withProps';
12
12
  import { RowActionsCell } from '../components/gridCells';
13
13
  import { EditReadPosition } from '../types';
14
14
  var useEditReadAsColumn = function (props) {
15
+ var _a;
15
16
  var onRowAction = props.onRowAction, actionColumnDefinition = props.actionColumnDefinition, columnsDefinitions = props.columnsDefinitions, gridSelectors = props.gridSelectors, gridActions = props.gridActions, onRowEditClick = props.onRowEditClick, onRowReadClick = props.onRowReadClick;
16
17
  var modifiedActionColumnDefinition = useMemo(function () {
17
18
  var _a;
@@ -45,8 +46,9 @@ var useEditReadAsColumn = function (props) {
45
46
  var canRowRead = (actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.canRowRead) !== undefined;
46
47
  var stickTo = (actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.stickTo) || 'right';
47
48
  var flexBasis = (actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.flexBasis) || 88;
49
+ 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);
48
50
  var modifiedColumnsDefinitions = useMemo(function () {
49
- if (canRowEdit || canRowRead) {
51
+ if (canRowEdit || canRowRead || withCheckboxes) {
50
52
  var editReadColumnDefinition = {
51
53
  name: 'sticky',
52
54
  flexBasis: flexBasis,
@@ -57,6 +59,7 @@ var useEditReadAsColumn = function (props) {
57
59
  alwaysOn: true,
58
60
  cellComponent: withProps({
59
61
  actionColumnDefinition: actionColumnDefinition,
62
+ withCheckboxes: withCheckboxes,
60
63
  uxState: gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.uxState,
61
64
  onUxChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.handleUxChange
62
65
  })(RowActionsCell)
@@ -10,10 +10,8 @@ import { ReduxGrid, createRandomData, enumValues, gridDummyActions } from '../ut
10
10
  import withRedux from '../utils/withRedux';
11
11
  var ActionColumnButtons = {
12
12
  flexBasis: 80,
13
- canRowRead: true,
14
13
  stickTo: 'left',
15
- forceCheckboxes: false,
16
- canRowEdit: true
14
+ forceCheckboxes: true
17
15
  };
18
16
  var FilterSetter = function (_a) {
19
17
  var gridActions = _a.gridActions;