@paubox/ui 0.8.4 → 0.8.5

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/index.esm.js CHANGED
@@ -31665,11 +31665,19 @@ var TableHeader = function(param) {
31665
31665
  children: table.getHeaderGroups().map(function(headerGroup) {
31666
31666
  return /*#__PURE__*/ jsx("tr", {
31667
31667
  children: headerGroup.headers.map(function(header) {
31668
+ var _header_column;
31669
+ var actionHeaders = [
31670
+ 'row-select',
31671
+ 'context'
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;
31668
31674
  return /*#__PURE__*/ jsxs(Th, {
31669
31675
  variant: "paragraph200Semibold",
31670
31676
  as: "th",
31671
31677
  style: {
31672
- width: "".concat(header.column.getSize(), "px"),
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',
31673
31681
  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")
31674
31682
  },
31675
31683
  children: [
@@ -31677,6 +31685,7 @@ var TableHeader = function(param) {
31677
31685
  role: header.column.getCanSort() ? 'button' : undefined,
31678
31686
  onClick: !disableControls ? header.column.getToggleSortingHandler() : undefined,
31679
31687
  style: {
31688
+ width: (actionHeaders === null || actionHeaders === void 0 ? void 0 : actionHeaders.includes(header === null || header === void 0 ? void 0 : header.id)) ? "".concat(header.getSize(), "px") : '100%',
31680
31689
  cursor: header.column.getCanSort() ? 'pointer' : 'default'
31681
31690
  },
31682
31691
  children: [
@@ -31697,7 +31706,7 @@ var TableHeader = function(param) {
31697
31706
  children: /*#__PURE__*/ jsx(ResizeHandle, {
31698
31707
  onMouseDown: header.getResizeHandler(),
31699
31708
  onTouchStart: header.getResizeHandler(),
31700
- className: "pbui-table-resize-handle",
31709
+ className: !autoWidth ? 'pbui-table-resize-handle' : '',
31701
31710
  onClick: function(e) {
31702
31711
  e.stopPropagation();
31703
31712
  e.preventDefault();
@@ -31996,7 +32005,7 @@ function _templateObject$1() {
31996
32005
  }
31997
32006
  function _templateObject1$1() {
31998
32007
  var data = _tagged_template_literal$1([
31999
- "\n position: relative;\n border-collapse: collapse;\n flex: 1;\n table-layout: fixed;\n min-height: 0;\n width: 100%;\n overflow-x: auto;\n"
32008
+ "\n position: relative;\n border-collapse: collapse;\n table-layout: fixed;\n min-height: 0;\n width: 100%;\n overflow-x: auto;\n"
32000
32009
  ]);
32001
32010
  _templateObject1$1 = function _templateObject() {
32002
32011
  return data;
@@ -32032,7 +32041,9 @@ var Table = function(param) {
32032
32041
  if (enableRowSelection) {
32033
32042
  cols.unshift({
32034
32043
  id: 'row-select',
32035
- size: 30,
32044
+ size: 22,
32045
+ minSize: 22,
32046
+ maxSize: 22,
32036
32047
  header: function(param) {
32037
32048
  var table = param.table;
32038
32049
  return /*#__PURE__*/ jsx(Checkbox, {
@@ -32061,6 +32072,9 @@ var Table = function(param) {
32061
32072
  if (contextMenuActions === null || contextMenuActions === void 0 ? void 0 : contextMenuActions.length) {
32062
32073
  cols.push({
32063
32074
  id: 'context',
32075
+ size: 22,
32076
+ minSize: 22,
32077
+ maxSize: 22,
32064
32078
  header: '',
32065
32079
  cell: function(param) {
32066
32080
  var row = param.row;
@@ -32071,7 +32085,6 @@ var Table = function(param) {
32071
32085
  contextMenuActions: contextMenuActions
32072
32086
  });
32073
32087
  },
32074
- size: 20,
32075
32088
  enableResizing: false
32076
32089
  });
32077
32090
  }
@@ -32104,9 +32117,9 @@ var Table = function(param) {
32104
32117
  columns: allColumns,
32105
32118
  getRowId: getRowId,
32106
32119
  defaultColumn: {
32107
- minSize: 20,
32108
- maxSize: 1000,
32109
- size: 20
32120
+ minSize: 50,
32121
+ maxSize: 500,
32122
+ size: 200
32110
32123
  },
32111
32124
  state: {
32112
32125
  pagination: {
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.4",
5
+ "version": "0.8.5",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "publishConfig": {
@@ -18,6 +18,7 @@ export type TableColumn<T> = ColumnDef<T> & {
18
18
  width?: number;
19
19
  sortable?: boolean;
20
20
  getter?: () => unknown;
21
+ autoWidth?: boolean;
21
22
  };
22
23
  export interface RowSelectState {
23
24
  [x: string]: boolean;