@paubox/ui 0.8.6 → 0.8.7

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.
Files changed (2) hide show
  1. package/index.esm.js +11 -6
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -32098,15 +32098,19 @@ var Table = function(param) {
32098
32098
  openMenuId
32099
32099
  ]);
32100
32100
  var handleSortingChange = useCallback(function(updater) {
32101
- var nextState = typeof updater === 'function' ? updater(sortBy && sortOrder ? [
32101
+ var currentSort = sortBy ? [
32102
32102
  {
32103
32103
  id: sortBy,
32104
32104
  desc: sortOrder === 'desc'
32105
32105
  }
32106
- ] : []) : updater;
32106
+ ] : [];
32107
+ var nextState = typeof updater === 'function' ? updater(currentSort) : updater;
32107
32108
  if (typeof onSortChange === 'function') {
32108
- var _nextState_, _nextState_1;
32109
- onSortChange((_nextState_ = nextState[0]) === null || _nextState_ === void 0 ? void 0 : _nextState_.id, ((_nextState_1 = nextState[0]) === null || _nextState_1 === void 0 ? void 0 : _nextState_1.desc) ? 'desc' : 'asc');
32109
+ if (nextState.length === 0) {
32110
+ onSortChange('', '');
32111
+ } else {
32112
+ onSortChange(nextState[0].id, nextState[0].desc ? 'desc' : 'asc');
32113
+ }
32110
32114
  }
32111
32115
  }, [
32112
32116
  sortBy,
@@ -32120,7 +32124,8 @@ var Table = function(param) {
32120
32124
  defaultColumn: {
32121
32125
  minSize: 100,
32122
32126
  maxSize: 500,
32123
- size: 200
32127
+ size: 200,
32128
+ sortDescFirst: false
32124
32129
  },
32125
32130
  state: {
32126
32131
  pagination: {
@@ -32128,7 +32133,7 @@ var Table = function(param) {
32128
32133
  pageSize: pageInfo.items
32129
32134
  },
32130
32135
  columnSizing: columnSizing,
32131
- sorting: sortBy && sortOrder ? [
32136
+ sorting: sortBy ? [
32132
32137
  {
32133
32138
  id: sortBy,
32134
32139
  desc: sortOrder === 'desc'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@paubox/ui",
3
3
  "author": "Paubox, Inc.",
4
4
  "description": "Paubox Component Library",
5
- "version": "0.8.6",
5
+ "version": "0.8.7",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {