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 CHANGED
@@ -9400,6 +9400,7 @@ var TablePage2 = function TablePage2(props) {
9400
9400
  _props$editorFilter = props.editorFilter,
9401
9401
  editorFilter = _props$editorFilter === void 0 ? false : _props$editorFilter,
9402
9402
  tabbedBy = props.tabbedBy,
9403
+ sortedBy = props.sortedBy,
9403
9404
  tableClassName = props.tableClassName,
9404
9405
  children = props.children,
9405
9406
  onSelect = props.onSelect;
@@ -9550,6 +9551,7 @@ var TablePage2 = function TablePage2(props) {
9550
9551
  editable: editable,
9551
9552
  tabbedBy: tabbedBy,
9552
9553
  groupBy: groupBy,
9554
+ sortedBy: sortedBy,
9553
9555
  filter: tableFilter,
9554
9556
  actions: tableActions,
9555
9557
  canDelete: canDelete,
@@ -9834,7 +9836,8 @@ var TableEditor$1 = function TableEditor(props) {
9834
9836
  filter = props.filter,
9835
9837
  actions = props.actions,
9836
9838
  className = props.className,
9837
- tabbedBy = props.tabbedBy;
9839
+ tabbedBy = props.tabbedBy,
9840
+ sortedBy = props.sortedBy;
9838
9841
  var _useState4 = React.useState(props.groupBy),
9839
9842
  groupBy = _useState4[0],
9840
9843
  setGroupBy = _useState4[1];
@@ -9967,7 +9970,7 @@ var TableEditor$1 = function TableEditor(props) {
9967
9970
  groups[groupName].push(item);
9968
9971
  return groups;
9969
9972
  }, {});
9970
- var sections = Object.keys(groups).map(function (groupName) {
9973
+ var sections = Object.keys(groups).sort().map(function (groupName) {
9971
9974
  var rows = groups[groupName].map(function (item) {
9972
9975
  item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false;
9973
9976
  item.actions = actions ? actions.map(function (_action2) {
@@ -9997,6 +10000,15 @@ var TableEditor$1 = function TableEditor(props) {
9997
10000
  }));
9998
10001
  return item;
9999
10002
  });
10003
+ if (sortedBy) {
10004
+ rows.sort(function (a, b) {
10005
+ var valueA = a[sortedBy];
10006
+ var valueB = b[sortedBy];
10007
+ if (valueA < valueB) return -1;
10008
+ if (valueA > valueB) return 1;
10009
+ return 0;
10010
+ });
10011
+ }
10000
10012
  table.rows = rows;
10001
10013
  return {
10002
10014
  id: groupName,