ywana-core8 0.1.12 → 0.1.13
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/dist/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +14 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +14 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage2.js +14 -3
- package/src/site/site.css +2 -0
package/dist/index.umd.js
CHANGED
@@ -9393,6 +9393,7 @@
|
|
9393
9393
|
_props$editorFilter = props.editorFilter,
|
9394
9394
|
editorFilter = _props$editorFilter === void 0 ? false : _props$editorFilter,
|
9395
9395
|
tabbedBy = props.tabbedBy,
|
9396
|
+
sortedBy = props.sortedBy,
|
9396
9397
|
tableClassName = props.tableClassName,
|
9397
9398
|
children = props.children,
|
9398
9399
|
onSelect = props.onSelect;
|
@@ -9543,6 +9544,7 @@
|
|
9543
9544
|
editable: editable,
|
9544
9545
|
tabbedBy: tabbedBy,
|
9545
9546
|
groupBy: groupBy,
|
9547
|
+
sortedBy: sortedBy,
|
9546
9548
|
filter: tableFilter,
|
9547
9549
|
actions: tableActions,
|
9548
9550
|
canDelete: canDelete,
|
@@ -9827,7 +9829,8 @@
|
|
9827
9829
|
filter = props.filter,
|
9828
9830
|
actions = props.actions,
|
9829
9831
|
className = props.className,
|
9830
|
-
tabbedBy = props.tabbedBy
|
9832
|
+
tabbedBy = props.tabbedBy,
|
9833
|
+
sortedBy = props.sortedBy;
|
9831
9834
|
var _useState4 = React.useState(props.groupBy),
|
9832
9835
|
groupBy = _useState4[0],
|
9833
9836
|
setGroupBy = _useState4[1];
|
@@ -9960,7 +9963,7 @@
|
|
9960
9963
|
groups[groupName].push(item);
|
9961
9964
|
return groups;
|
9962
9965
|
}, {});
|
9963
|
-
var sections = Object.keys(groups).map(function (groupName) {
|
9966
|
+
var sections = Object.keys(groups).sort().map(function (groupName) {
|
9964
9967
|
var rows = groups[groupName].map(function (item) {
|
9965
9968
|
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false;
|
9966
9969
|
item.actions = actions ? actions.map(function (_action2) {
|
@@ -9990,6 +9993,15 @@
|
|
9990
9993
|
}));
|
9991
9994
|
return item;
|
9992
9995
|
});
|
9996
|
+
if (sortedBy) {
|
9997
|
+
rows.sort(function (a, b) {
|
9998
|
+
var valueA = a[sortedBy];
|
9999
|
+
var valueB = b[sortedBy];
|
10000
|
+
if (valueA < valueB) return -1;
|
10001
|
+
if (valueA > valueB) return 1;
|
10002
|
+
return 0;
|
10003
|
+
});
|
10004
|
+
}
|
9993
10005
|
table.rows = rows;
|
9994
10006
|
return {
|
9995
10007
|
id: groupName,
|