@longline/aqua-ui 1.0.262 → 1.0.266
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 };
|
|
@@ -102,15 +102,14 @@ var ListViewBase = function (props) {
|
|
|
102
102
|
// Is the input data an array? If not, abort.
|
|
103
103
|
if (!Array.isArray(data))
|
|
104
104
|
return;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return __assign(__assign({}, d), { checked: item === d ? !d.checked : !!d.checked });
|
|
105
|
+
/*
|
|
106
|
+
const newData = data.map(d => {
|
|
107
|
+
if(item === true) return { ...d, checked: true };
|
|
108
|
+
if(item === false) return { ...d, checked: false };
|
|
109
|
+
return { ...d, checked: item === d ? !d.checked : !!d.checked };
|
|
111
110
|
});
|
|
112
|
-
setData(newData)
|
|
113
|
-
props.onCheck(item);
|
|
111
|
+
setData(newData);*/
|
|
112
|
+
props.onCheck(data, item);
|
|
114
113
|
};
|
|
115
114
|
var handleColumns = function () {
|
|
116
115
|
setColumnsMode(true);
|
|
@@ -77,7 +77,7 @@ 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 () { return props.onCheck(props.data[i]); } })),
|
|
80
|
+
React.createElement(Selector, { checked: !!item.checked, onChange: function () { return props.onCheck(props.data, props.data[i]); } })),
|
|
81
81
|
props.columns.map(function (col, index) {
|
|
82
82
|
return React.createElement("div", { className: "cell ".concat(col.error || item.error ? 'error' : ''), key: index, style: { justifyContent: col.align == 'right' ? 'end' : 'start' } },
|
|
83
83
|
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" },
|