trotl-table 1.0.103 → 1.0.105

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/README.md CHANGED
@@ -121,12 +121,17 @@ export default function Demo() {
121
121
  - `tableId`: unique string ID for the table
122
122
  - `columns`: array of `{ header, accessor }`
123
123
  - `data`: array of row objects
124
- - `styles`: optional table theme. Set to `"professional"` for a compact premium business grid: a graphite-navy header, fine horizontal separators, subtle row banding, outlined action icons, and blue selection/focus states. Other values retain the default appearance.
124
+ - `styles`: optional table theme. Supported themes use fine horizontal separators and outlined action icons:
125
+ - `"professional"`: graphite-navy header and slate-blue selection/focus states.
126
+ - `"power"`: bold charcoal header with warm amber selection/focus states and ivory row banding.
127
+ - `"lady"`: refined plum header with rose selection/focus states and soft blush row banding.
128
+ - `"amazing"`: airy white audit-table styling with a pale slate header, uppercase muted labels, fine separators, and generous `60px` rows. The header and group headers are `42px` tall.
129
+ - Missing or unrecognized values retain the default appearance.
125
130
  - `isGrouped`: enable grouped mode (true/false)
126
131
  - `groupKey`: key to group rows by
127
132
  - `extraSearchTerm`: string to filter + highlight rows
128
- - `rowHeight`: row height in px (default `34`). Ignored with `styles="professional"`, which always uses `30px` rows.
129
- - `groupHeaderHeight`: group header height in px (default `36`). Ignored with `styles="professional"`, which always uses `32px` group headers.
133
+ - `rowHeight`: row height in px (default `34`). Ignored with any supported theme: `"amazing"` uses `60px`; the other themes use `30px`.
134
+ - `groupHeaderHeight`: group header height in px (default `36`). Ignored with any supported theme: `"amazing"` uses `42px`; the other themes use `32px`.
130
135
  - `mobileColumnCount`: number of data columns shown at viewport widths of 768px or less (1 or 2; default `2`). The full row details are shown in a modal when a mobile row is clicked.
131
136
  - `mobileRowClick`: optional callback `(row) => {}` invoked instead of opening the built-in details modal when a mobile row is clicked. Clicks on row controls and action buttons keep their existing behavior.
132
137
  - On mobile, when `enableMouseRightClick` actions are provided, double-tapping a row opens the same context menu as a right click (a single tap then opens details after a short ~280ms delay).
package/dist/Table.cjs.js CHANGED
@@ -9762,9 +9762,9 @@ function TableInner({
9762
9762
  timeoutLoading = 5,
9763
9763
  t
9764
9764
  }) {
9765
- const isProfessional = styles === "professional";
9766
- const rowHeight = isProfessional ? 30 : requestedRowHeight;
9767
- const groupHeaderHeight = isProfessional ? 32 : requestedGroupHeaderHeight;
9765
+ const hasTheme = ["professional", "power", "lady", "amazing"].includes(styles);
9766
+ const rowHeight = hasTheme ? styles === "amazing" ? 60 : 30 : requestedRowHeight;
9767
+ const groupHeaderHeight = hasTheme ? styles === "amazing" ? 42 : 32 : requestedGroupHeaderHeight;
9768
9768
  const virtualizedListRef = React.useRef(null);
9769
9769
  React.useEffect(() => {
9770
9770
  virtualizedListRef.current?.recomputeRowHeights();
@@ -11369,7 +11369,7 @@ function TableInner({
11369
11369
  role: "img",
11370
11370
  "aria-hidden": "false",
11371
11371
  title: translate("view")
11372
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11372
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11373
11373
  name: "view"
11374
11374
  }) : "👁️") : translate("view")), showEdit && /*#__PURE__*/React.createElement("button", {
11375
11375
  className: "action-btn-table",
@@ -11380,7 +11380,7 @@ function TableInner({
11380
11380
  role: "img",
11381
11381
  "aria-hidden": "false",
11382
11382
  title: translate("edit")
11383
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11383
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11384
11384
  name: "edit"
11385
11385
  }) : "✏️") : translate("edit")), showDuplicate && /*#__PURE__*/React.createElement("button", {
11386
11386
  className: "action-btn-table",
@@ -11388,13 +11388,13 @@ function TableInner({
11388
11388
  onDoubleClick: e => e.stopPropagation(),
11389
11389
  "aria-label": translate("duplicate")
11390
11390
  }, showIcons ? /*#__PURE__*/React.createElement("span", {
11391
- style: isProfessional ? undefined : {
11391
+ style: hasTheme ? undefined : {
11392
11392
  color: "black"
11393
11393
  },
11394
11394
  role: "img",
11395
11395
  "aria-hidden": "false",
11396
11396
  title: translate("duplicate")
11397
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11397
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11398
11398
  name: "duplicate"
11399
11399
  }) : "🗐") : translate("duplicate")), showDelete && /*#__PURE__*/React.createElement("button", {
11400
11400
  className: "action-btn-table",
@@ -11406,7 +11406,7 @@ function TableInner({
11406
11406
  role: "img",
11407
11407
  "aria-hidden": "false",
11408
11408
  title: translate("delete")
11409
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11409
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11410
11410
  name: "delete"
11411
11411
  }) : "🗑️") : translate("delete")), showUndelete && /*#__PURE__*/React.createElement("button", {
11412
11412
  className: "action-btn-table",
@@ -11417,7 +11417,7 @@ function TableInner({
11417
11417
  role: "img",
11418
11418
  "aria-hidden": "false",
11419
11419
  title: translate("undelete")
11420
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11420
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11421
11421
  name: "undelete"
11422
11422
  }) : "♻️") : translate("undelete")), showShare && /*#__PURE__*/React.createElement("button", {
11423
11423
  className: "action-btn-table",
@@ -11428,7 +11428,7 @@ function TableInner({
11428
11428
  role: "img",
11429
11429
  "aria-hidden": "false",
11430
11430
  title: translate("share")
11431
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11431
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11432
11432
  name: "share"
11433
11433
  }) : "🔗") : translate("share")), showDownload && /*#__PURE__*/React.createElement("button", {
11434
11434
  className: "action-btn-table",
@@ -11439,7 +11439,7 @@ function TableInner({
11439
11439
  role: "img",
11440
11440
  "aria-hidden": "false",
11441
11441
  title: translate("download") || "Download"
11442
- }, isProfessional ? /*#__PURE__*/React.createElement(ActionIcon, {
11442
+ }, hasTheme ? /*#__PURE__*/React.createElement(ActionIcon, {
11443
11443
  name: "download"
11444
11444
  }) : "📥") : translate("download") || "Download")));
11445
11445
  if (enableDragRow && item.type === "row") {
@@ -11454,7 +11454,7 @@ function TableInner({
11454
11454
  }, content);
11455
11455
  }
11456
11456
  return content;
11457
- }, [tableDataFlat, visibleColumns, selectedRows, toggleRowSelection, groupRowsById, renderCell, getCellStyle, showActions, showDelete, showEdit, showKey, showView, translate, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId, customColumns, isMobile, enableMouseRightClick, doubleClickEnable, keyWidth, actionColumnStyle, showDuplicate, showDownload, showIcons, isProfessional, showShare, getHighlightRowStyle, triggerCellCallback, getAccessorKey, getAccessorValue]);
11457
+ }, [tableDataFlat, visibleColumns, selectedRows, toggleRowSelection, groupRowsById, renderCell, getCellStyle, showActions, showDelete, showEdit, showKey, showView, translate, enableDragRow, moveRow, enableMultiSelect, rowHeight, tableId, customColumns, isMobile, enableMouseRightClick, doubleClickEnable, keyWidth, actionColumnStyle, showDuplicate, showDownload, showIcons, hasTheme, showShare, getHighlightRowStyle, triggerCellCallback, getAccessorKey, getAccessorValue]);
11458
11458
  const rightClickActions = Array.isArray(enableMouseRightClick) ? enableMouseRightClick : [];
11459
11459
  const [hoveredActionIndex, setHoveredActionIndex] = React.useState(null);
11460
11460
  const rowHeightGetter = ({
@@ -11485,8 +11485,8 @@ function TableInner({
11485
11485
  }
11486
11486
  }, [useExternalDndContext, enableExternalRowDrop, externalDrop]);
11487
11487
  const tableMarkup = /*#__PURE__*/React.createElement("div", {
11488
- className: "table-container",
11489
- "data-table-style": isProfessional ? styles : undefined,
11488
+ className: hasTheme ? "table-container table-themed" : "table-container",
11489
+ "data-table-style": hasTheme ? styles : undefined,
11490
11490
  ref: setTableRef,
11491
11491
  style: useExternalDndContext && enableExternalRowDrop ? {
11492
11492
  transition: "background 0.15s",
@@ -11550,7 +11550,7 @@ function TableInner({
11550
11550
  className: "table-cell action-cell",
11551
11551
  style: actionColumnStyle,
11552
11552
  title: translate("action")
11553
- }, showIcons && !isProfessional ? /*#__PURE__*/React.createElement("span", {
11553
+ }, showIcons && !hasTheme ? /*#__PURE__*/React.createElement("span", {
11554
11554
  title: translate("action")
11555
11555
  }, "\u2699\uFE0F") : translate("action")))), /*#__PURE__*/React.createElement("div", {
11556
11556
  className: "main-table",