@bento-core/paginated-table 1.0.0-c3dc.36 → 1.0.0-c3dc.38
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.
|
@@ -187,6 +187,19 @@ const PaginatedTable = _ref => {
|
|
|
187
187
|
columns
|
|
188
188
|
})));
|
|
189
189
|
};
|
|
190
|
+
const handleAllColumnViewChange = checked => {
|
|
191
|
+
const columns = table.columns.map(col => {
|
|
192
|
+
const updateColumnView = _objectSpread({}, col);
|
|
193
|
+
if (!col.hideable) {
|
|
194
|
+
return updateColumnView;
|
|
195
|
+
}
|
|
196
|
+
updateColumnView.display = checked;
|
|
197
|
+
return updateColumnView;
|
|
198
|
+
});
|
|
199
|
+
dispatch((0, _Actions.onColumnViewChange)(_objectSpread(_objectSpread({}, table), {}, {
|
|
200
|
+
columns
|
|
201
|
+
})));
|
|
202
|
+
};
|
|
190
203
|
/**
|
|
191
204
|
* A. client table
|
|
192
205
|
* table data provide by bento app (tblRows)
|
|
@@ -202,6 +215,7 @@ const PaginatedTable = _ref => {
|
|
|
202
215
|
onToggleSelectAll: handleToggleSelectAll,
|
|
203
216
|
onSortByColumn: handleSortByColumn,
|
|
204
217
|
onColumnViewChange: handleColumnViewChange,
|
|
218
|
+
onAllColumnViewChange: handleAllColumnViewChange,
|
|
205
219
|
themeConfig: themeConfig
|
|
206
220
|
}));
|
|
207
221
|
}
|
|
@@ -226,6 +240,7 @@ const PaginatedTable = _ref => {
|
|
|
226
240
|
onToggleSelectAll: handleToggleSelectAll,
|
|
227
241
|
onSortByColumn: handleSortByColumn,
|
|
228
242
|
onColumnViewChange: handleColumnViewChange,
|
|
243
|
+
onAllColumnViewChange: handleAllColumnViewChange,
|
|
229
244
|
themeConfig: themeConfig
|
|
230
245
|
}));
|
|
231
246
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/paginated-table",
|
|
3
|
-
"version": "1.0.0-c3dc.
|
|
3
|
+
"version": "1.0.0-c3dc.38",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@bento-core/cart": "1.0.1-ccdihub.7",
|
|
19
|
-
"@bento-core/table": "^1.0.0-c3dc.
|
|
19
|
+
"@bento-core/table": "^1.0.0-c3dc.32",
|
|
20
20
|
"@bento-core/tool-tip": "^1.0.0",
|
|
21
21
|
"@bento-core/util": "^1.0.0"
|
|
22
22
|
},
|
|
@@ -183,6 +183,23 @@ const PaginatedTable = ({
|
|
|
183
183
|
columns,
|
|
184
184
|
}));
|
|
185
185
|
};
|
|
186
|
+
|
|
187
|
+
const handleAllColumnViewChange = (checked) => {
|
|
188
|
+
const columns = table.columns.map((col) => {
|
|
189
|
+
const updateColumnView = { ...col };
|
|
190
|
+
|
|
191
|
+
if (!col.hideable) {
|
|
192
|
+
return updateColumnView;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
updateColumnView.display = checked;
|
|
196
|
+
return updateColumnView;
|
|
197
|
+
});
|
|
198
|
+
dispatch(onColumnViewChange({
|
|
199
|
+
...table,
|
|
200
|
+
columns,
|
|
201
|
+
}));
|
|
202
|
+
};
|
|
186
203
|
/**
|
|
187
204
|
* A. client table
|
|
188
205
|
* table data provide by bento app (tblRows)
|
|
@@ -200,6 +217,7 @@ const PaginatedTable = ({
|
|
|
200
217
|
onToggleSelectAll={handleToggleSelectAll}
|
|
201
218
|
onSortByColumn={handleSortByColumn}
|
|
202
219
|
onColumnViewChange={handleColumnViewChange}
|
|
220
|
+
onAllColumnViewChange={handleAllColumnViewChange}
|
|
203
221
|
themeConfig={themeConfig}
|
|
204
222
|
/>
|
|
205
223
|
</>
|
|
@@ -229,6 +247,7 @@ const PaginatedTable = ({
|
|
|
229
247
|
onToggleSelectAll={handleToggleSelectAll}
|
|
230
248
|
onSortByColumn={handleSortByColumn}
|
|
231
249
|
onColumnViewChange={handleColumnViewChange}
|
|
250
|
+
onAllColumnViewChange={handleAllColumnViewChange}
|
|
232
251
|
themeConfig={themeConfig}
|
|
233
252
|
/>
|
|
234
253
|
</>
|