@shortstravelmgmt/component-lib 0.2.12-rc.1 → 0.2.12-rc.2

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.js CHANGED
@@ -3978,7 +3978,7 @@ function toNumber(value) {
3978
3978
  * again to reverse — and an optional total row sums a column into a sticky
3979
3979
  * footer.
3980
3980
  */
3981
- function GridTable({ columns, data, gridTemplateColumns = `repeat(${columns.length}, minmax(0, 1fr))`, rowKey, header = {}, initialSortColumn, initialSortAscending, secondarySortComparator, bordered = true, emptyMessage = 'No data available.', totalRow, className = '', }) {
3981
+ function GridTable({ columns, data, gridTemplateColumns = `repeat(${columns.length}, minmax(0, 1fr))`, rowKey, header = {}, initialSortColumn, initialSortAscending, secondarySortComparator, bordered = true, hideHeader = false, emptyMessage = 'No data available.', totalRow, className = '', }) {
3982
3982
  const [sortColumn, setSortColumn] = React.useState(initialSortColumn);
3983
3983
  const [ascending, setAscending] = React.useState(initialSortAscending);
3984
3984
  const sorted = React.useMemo(() => {
@@ -4014,7 +4014,7 @@ function GridTable({ columns, data, gridTemplateColumns = `repeat(${columns.leng
4014
4014
  }, 0);
4015
4015
  }, [columns, data, totalRow]);
4016
4016
  const totalIndex = totalRow ? columns.findIndex((c) => c.name === totalRow.columnName) : -1;
4017
- return (jsxRuntime.jsxs("div", { className: `${styles$W.table} ${className}`, children: [jsxRuntime.jsxs("div", { className: styles$W.header, children: [header.above, jsxRuntime.jsx("div", { className: styles$W.grid, style: { gridTemplateColumns }, role: "row", children: columns.map((column, i) => (jsxRuntime.jsx(React.Fragment, { children: heading(column, { interactive: true }) }, i))) }), header.below] }), !sorted.length ? (jsxRuntime.jsx("div", { className: styles$W.empty, children: emptyMessage })) : (jsxRuntime.jsx("div", { className: styles$W.body, children: sorted.map((row, rowIndex) => {
4017
+ return (jsxRuntime.jsxs("div", { className: `${styles$W.table} ${className}`, children: [!hideHeader && (jsxRuntime.jsxs("div", { className: styles$W.header, children: [header.above, jsxRuntime.jsx("div", { className: styles$W.grid, style: { gridTemplateColumns }, role: "row", children: columns.map((column, i) => (jsxRuntime.jsx(React.Fragment, { children: heading(column, { interactive: true }) }, i))) }), header.below] })), !sorted.length ? (jsxRuntime.jsx("div", { className: styles$W.empty, children: emptyMessage })) : (jsxRuntime.jsx("div", { className: styles$W.body, children: sorted.map((row, rowIndex) => {
4018
4018
  const record = row;
4019
4019
  const key = String((rowKey && record[rowKey]) ?? record.id ?? rowIndex);
4020
4020
  return (jsxRuntime.jsx("div", { className: `${styles$W.row} ${bordered ? styles$W.bordered : ''}`, style: { gridTemplateColumns }, "data-rowid": key, "data-testid": `row-${key}`, children: columns.map((column, colIndex) => {