@paubox/ui 0.8.5 → 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 +23 -17
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -31670,14 +31670,15 @@ var TableHeader = function(param) {
31670
31670
  'row-select',
31671
31671
  'context'
31672
31672
  ];
31673
- var autoWidth = !!(header === null || header === void 0 ? void 0 : (_header_column = header.column) === null || _header_column === void 0 ? void 0 : _header_column.columnDef).autoWidth;
31673
+ var columnDef = header === null || header === void 0 ? void 0 : (_header_column = header.column) === null || _header_column === void 0 ? void 0 : _header_column.columnDef;
31674
+ var autoWidth = !!columnDef.autoWidth;
31674
31675
  return /*#__PURE__*/ jsxs(Th, {
31675
31676
  variant: "paragraph200Semibold",
31676
31677
  as: "th",
31677
31678
  style: {
31678
- width: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31679
- minWidth: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31680
- maxWidth: header.getSize() && !autoWidth ? "".concat(header.getSize(), "px") : 'auto',
31679
+ width: columnDef.width && !autoWidth ? "".concat(columnDef.width, "px") : "".concat(!autoWidth ? "".concat(header.getSize(), "px") : 'auto'),
31680
+ minWidth: columnDef.minSize && !autoWidth ? "".concat(columnDef.minSize, "px") : "auto",
31681
+ maxWidth: columnDef.maxSize && !autoWidth ? "".concat(columnDef.maxSize, "px") : 'auto',
31681
31682
  padding: dense ? "".concat(spacing(1), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(header.id === 'row-select' ? 1 : 1.5), "px")
31682
31683
  },
31683
31684
  children: [
@@ -32041,9 +32042,9 @@ var Table = function(param) {
32041
32042
  if (enableRowSelection) {
32042
32043
  cols.unshift({
32043
32044
  id: 'row-select',
32044
- size: 22,
32045
- minSize: 22,
32046
- maxSize: 22,
32045
+ size: 32,
32046
+ minSize: 32,
32047
+ maxSize: 32,
32047
32048
  header: function(param) {
32048
32049
  var table = param.table;
32049
32050
  return /*#__PURE__*/ jsx(Checkbox, {
@@ -32072,9 +32073,9 @@ var Table = function(param) {
32072
32073
  if (contextMenuActions === null || contextMenuActions === void 0 ? void 0 : contextMenuActions.length) {
32073
32074
  cols.push({
32074
32075
  id: 'context',
32075
- size: 22,
32076
- minSize: 22,
32077
- maxSize: 22,
32076
+ size: 32,
32077
+ minSize: 32,
32078
+ maxSize: 32,
32078
32079
  header: '',
32079
32080
  cell: function(param) {
32080
32081
  var row = param.row;
@@ -32097,15 +32098,19 @@ var Table = function(param) {
32097
32098
  openMenuId
32098
32099
  ]);
32099
32100
  var handleSortingChange = useCallback(function(updater) {
32100
- var nextState = typeof updater === 'function' ? updater(sortBy && sortOrder ? [
32101
+ var currentSort = sortBy ? [
32101
32102
  {
32102
32103
  id: sortBy,
32103
32104
  desc: sortOrder === 'desc'
32104
32105
  }
32105
- ] : []) : updater;
32106
+ ] : [];
32107
+ var nextState = typeof updater === 'function' ? updater(currentSort) : updater;
32106
32108
  if (typeof onSortChange === 'function') {
32107
- var _nextState_, _nextState_1;
32108
- 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
+ }
32109
32114
  }
32110
32115
  }, [
32111
32116
  sortBy,
@@ -32117,9 +32122,10 @@ var Table = function(param) {
32117
32122
  columns: allColumns,
32118
32123
  getRowId: getRowId,
32119
32124
  defaultColumn: {
32120
- minSize: 50,
32125
+ minSize: 100,
32121
32126
  maxSize: 500,
32122
- size: 200
32127
+ size: 200,
32128
+ sortDescFirst: false
32123
32129
  },
32124
32130
  state: {
32125
32131
  pagination: {
@@ -32127,7 +32133,7 @@ var Table = function(param) {
32127
32133
  pageSize: pageInfo.items
32128
32134
  },
32129
32135
  columnSizing: columnSizing,
32130
- sorting: sortBy && sortOrder ? [
32136
+ sorting: sortBy ? [
32131
32137
  {
32132
32138
  id: sortBy,
32133
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.5",
5
+ "version": "0.8.7",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {