@mailstep/design-system 0.6.69 → 0.6.70-beta.1
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/DataCell.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/DataRow.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/DataRow.js +2 -2
- package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +1 -1
- package/ui/Blocks/CommonGrid/types.d.ts +2 -2
- package/ui/index.es.js +15373 -15870
- package/ui/index.umd.js +623 -623
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { ColumnDefinition, RowProps, Group } from '../types';
|
|
|
3
3
|
type DataCellPros = {
|
|
4
4
|
column: ColumnDefinition;
|
|
5
5
|
rowData: RowProps;
|
|
6
|
-
onRowAction?: (id: string, field: string, value: any) => void;
|
|
6
|
+
onRowAction?: (id: string, field: string, value: any, rowData?: RowProps) => void;
|
|
7
7
|
displayColumnWidth: number;
|
|
8
8
|
group: Group;
|
|
9
9
|
};
|
|
@@ -11,7 +11,7 @@ type DataRowProps = {
|
|
|
11
11
|
onRowEditClick?: (id: string, props: RowProps) => void;
|
|
12
12
|
onRowReadClick?: (id: string, props: RowProps) => void;
|
|
13
13
|
onRowClick?: (id: string, props: RowProps) => void;
|
|
14
|
-
onRowAction?: (id: string, field: string, value: any) => void;
|
|
14
|
+
onRowAction?: (id: string, field: string, value: any, rowData?: RowProps) => void;
|
|
15
15
|
createLink?: (params?: object) => string;
|
|
16
16
|
displayColumnsWidth: Required<GridSelectorsType>['columnsWidth'];
|
|
17
17
|
groups: Group[];
|
|
@@ -64,9 +64,9 @@ var DataRow = function (_a) {
|
|
|
64
64
|
if (onUxChange && allowRowSelectOnAction)
|
|
65
65
|
onUxChange('selectedRow', rowData.id);
|
|
66
66
|
}, [onRowReadClick, rowData]);
|
|
67
|
-
var handleRowAction = React.useCallback(function (id, field, value) {
|
|
67
|
+
var handleRowAction = React.useCallback(function (id, field, value, rowData) {
|
|
68
68
|
if (onRowAction)
|
|
69
|
-
onRowAction(id, field, value);
|
|
69
|
+
onRowAction(id, field, value, rowData);
|
|
70
70
|
if (onUxChange && allowRowSelectOnAction)
|
|
71
71
|
onUxChange('selectedRow', id);
|
|
72
72
|
}, [onRowReadClick, rowData]);
|
|
@@ -16,7 +16,7 @@ export var ToggleCell = function (_a) {
|
|
|
16
16
|
var onSwitchChange = useCallback(function () {
|
|
17
17
|
if (!onRowAction)
|
|
18
18
|
return;
|
|
19
|
-
var ret = onRowAction(rowData.id, actionName, !isChecked);
|
|
19
|
+
var ret = onRowAction(rowData.id, actionName, !isChecked, rowData);
|
|
20
20
|
if (ret) {
|
|
21
21
|
// promise returned = we wait for result
|
|
22
22
|
ret.then(function () { return setIsChecked(!isChecked); });
|
|
@@ -157,7 +157,7 @@ export type ActionColumnHeadProps = {
|
|
|
157
157
|
};
|
|
158
158
|
export type DataCellProps<T> = {
|
|
159
159
|
rowData: T;
|
|
160
|
-
onRowAction?: (id: string, field: string, value: any) => void | Promise<any>;
|
|
160
|
+
onRowAction?: (id: string, field: string, value: any, rowData?: T) => void | Promise<any>;
|
|
161
161
|
column: ColumnDefinition;
|
|
162
162
|
children?: React.ReactNode;
|
|
163
163
|
};
|
|
@@ -250,7 +250,7 @@ export type CommonGridProps<TData extends RowProps = RowProps> = {
|
|
|
250
250
|
totalRowsCount?: number;
|
|
251
251
|
allowRowSelect?: boolean;
|
|
252
252
|
allowRowSelectOnAction?: boolean;
|
|
253
|
-
onRowAction?: (id: string, field: string, value: any) => void;
|
|
253
|
+
onRowAction?: (id: string, field: string, value: any, rowData?: RowProps) => void;
|
|
254
254
|
onRowEditClick?: (id: string, props: TData) => void;
|
|
255
255
|
onRowReadClick?: (id: string, props: TData) => void;
|
|
256
256
|
onRowClick?: (id: string, props: TData) => void;
|