@longline/aqua-ui 1.0.263 → 1.0.267
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.
|
@@ -140,8 +140,9 @@ interface IListViewProps {
|
|
|
140
140
|
* If this callback is provided, items can be checked or unchecked. Items must have
|
|
141
141
|
* a key `checked` when they're checked. If `item` is true, then all items must be checked.
|
|
142
142
|
* If `item` is false, the all items must be unchecked.
|
|
143
|
+
* @param data List items currently shown in the list.
|
|
143
144
|
* @param item Item to toggle.
|
|
144
145
|
*/
|
|
145
|
-
onCheck?: (item: any | boolean) => void;
|
|
146
|
+
onCheck?: (data: any[], item: any | boolean) => void;
|
|
146
147
|
}
|
|
147
148
|
export { IListViewProps };
|
|
@@ -95,7 +95,7 @@ var ListViewBase = function (props) {
|
|
|
95
95
|
setReverse((_a = column.reverse) !== null && _a !== void 0 ? _a : false);
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
var handleCheck = function (item) {
|
|
98
|
+
var handleCheck = function (data, item) {
|
|
99
99
|
// Is there a handler for onCheck? If not, abort.
|
|
100
100
|
if (!props.onCheck)
|
|
101
101
|
return;
|
|
@@ -109,7 +109,7 @@ var ListViewBase = function (props) {
|
|
|
109
109
|
return { ...d, checked: item === d ? !d.checked : !!d.checked };
|
|
110
110
|
});
|
|
111
111
|
setData(newData);*/
|
|
112
|
-
props.onCheck(item);
|
|
112
|
+
props.onCheck(data, item);
|
|
113
113
|
};
|
|
114
114
|
var handleColumns = function () {
|
|
115
115
|
setColumnsMode(true);
|
|
@@ -77,7 +77,9 @@ var Body = React.forwardRef(function (props, ref) {
|
|
|
77
77
|
(props.onClick || props.onDoubleClick) ? 'clickable' : null
|
|
78
78
|
].join(' '), onClick: props.onClick ? function () { return props.onClick(item); } : null, onDoubleClick: props.onDoubleClick ? function () { return props.onDoubleClick(item); } : null },
|
|
79
79
|
props.onCheck && React.createElement("div", { className: "cell check" },
|
|
80
|
-
React.createElement(Selector, { checked: !!item.checked, onChange: function () {
|
|
80
|
+
React.createElement(Selector, { checked: !!item.checked, onChange: function () {
|
|
81
|
+
props.onCheck(props.data, props.data[i]);
|
|
82
|
+
} })),
|
|
81
83
|
props.columns.map(function (col, index) {
|
|
82
84
|
return React.createElement("div", { className: "cell ".concat(col.error || item.error ? 'error' : ''), key: index, style: { justifyContent: col.align == 'right' ? 'end' : 'start' } },
|
|
83
85
|
React.createElement("span", { className: "content" },
|
|
@@ -12,7 +12,7 @@ var Header = function (props) {
|
|
|
12
12
|
return (React.createElement("div", { className: "row header" },
|
|
13
13
|
props.onCheck &&
|
|
14
14
|
React.createElement("div", { className: "cell check" },
|
|
15
|
-
React.createElement(Selector, { indeterminate: indeterminate, checked: allChecked, onChange: function () { return props.onCheck(allChecked ? false : true); } })),
|
|
15
|
+
React.createElement(Selector, { indeterminate: indeterminate, checked: allChecked, onChange: function () { return props.onCheck(props.data, allChecked ? false : true); } })),
|
|
16
16
|
props.columns.map(function (col, index) { return React.createElement(HeaderCell, { key: index, column: col, sort: props.sort, reverse: props.reverse, dark: props.dark, onSortClick: props.onSortClick }); }),
|
|
17
17
|
props.columnsEditable &&
|
|
18
18
|
React.createElement("div", { className: "cell columns" },
|