@mailstep/design-system 0.7.61-beta.0 → 0.7.61
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
|
@@ -15,12 +15,17 @@ var DataRow = function (_a) {
|
|
|
15
15
|
}
|
|
16
16
|
}, [onRowAction, allowRowSelectOnAction, onUxChange]);
|
|
17
17
|
var handleRowClick = React.useCallback(function (e) {
|
|
18
|
-
var _a;
|
|
18
|
+
var _a, _b;
|
|
19
19
|
// test whether I should trigger event or not (because of possible button/link/input/etc in cell)
|
|
20
20
|
var classes = Object.values(e.target.classList);
|
|
21
21
|
// find children of parent that has propagation attribute
|
|
22
22
|
var parent = e.target.closest('.cell');
|
|
23
|
-
var canPropagation = ((_a =
|
|
23
|
+
var canPropagation = ((_a = e.target.dataset) === null || _a === void 0 ? void 0 : _a.propagation) === 'true';
|
|
24
|
+
var child = e.target;
|
|
25
|
+
while (child && child !== parent && !canPropagation) {
|
|
26
|
+
child = child.parentElement;
|
|
27
|
+
canPropagation = ((_b = child === null || child === void 0 ? void 0 : child.dataset) === null || _b === void 0 ? void 0 : _b.propagation) === 'true';
|
|
28
|
+
}
|
|
24
29
|
if (!classes.includes('dataRow') && !classes.includes('cell') && !canPropagation)
|
|
25
30
|
return;
|
|
26
31
|
if (onUxChange && allowRowSelect)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export var onRowEditClick = function (id, props) { return console.log('onRowEditClick', id, props); };
|
|
2
2
|
export var onRowReadClick = function (id, props) { return console.log('onRowReadClick', id, props); };
|
|
3
3
|
export var onRowAction = function (id, field, value) { return console.log('onRowAction', id, field, value); };
|
|
4
|
-
export var onRowClick = function (id, field, value) { return console.log('onRowClick', id, field
|
|
4
|
+
export var onRowClick = function (id, field, value) { return console.log('onRowClick', id, field); };
|
|
5
5
|
export var onBatchAction = function (action, affectedRows) {
|
|
6
6
|
console.log('onBatchAction called', action, affectedRows);
|
|
7
7
|
};
|