@homebound/beam 2.417.6 → 2.417.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.
- package/dist/index.cjs +137 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -6
- package/dist/index.d.ts +25 -6
- package/dist/index.js +137 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5314,7 +5314,7 @@ declare function applyRowFn<R extends Kinded>(column: GridColumnWithId<R>, row:
|
|
|
5314
5314
|
declare const ASC: "ASC";
|
|
5315
5315
|
declare const DESC: "DESC";
|
|
5316
5316
|
declare const emptyCell: GridCellContent;
|
|
5317
|
-
declare function getFirstOrLastCellCss<R extends Kinded>(style: GridStyle, columnIndex: number, columns: GridColumnWithId<R>[]): Properties;
|
|
5317
|
+
declare function getFirstOrLastCellCss<R extends Kinded>(style: GridStyle, columnIndex: number, columns: GridColumnWithId<R>[], colspan?: number): Properties;
|
|
5318
5318
|
/** A heuristic to detect the result of `React.createElement` / i.e. JSX. */
|
|
5319
5319
|
declare function isJSX(content: any): boolean;
|
|
5320
5320
|
declare function getAlignment(column: GridColumnWithId<any>, maybeContent: ReactNode | GridCellContent): GridCellAlignment;
|
|
@@ -5392,23 +5392,27 @@ type LabelSuffixStyle = {
|
|
|
5392
5392
|
interface GridStyle {
|
|
5393
5393
|
/** Applied to the base div element. */
|
|
5394
5394
|
rootCss?: Properties;
|
|
5395
|
-
/**
|
|
5395
|
+
/**
|
|
5396
|
+
* Applied as the base body-row cell styling (commonly used for row separators).
|
|
5397
|
+
* This is applied to body rows broadly (including the last body row); use
|
|
5398
|
+
* `lastRowCellCss`/`lastRowCss` to adjust/cancel any final-row treatment.
|
|
5399
|
+
*/
|
|
5396
5400
|
betweenRowsCss?: Properties;
|
|
5397
|
-
/** Applied on the last row of the table
|
|
5401
|
+
/** Applied on the last row of the table, typically to override/cancel `betweenRowsCss`. */
|
|
5398
5402
|
lastRowCss?: Properties;
|
|
5399
5403
|
/** Applied on the first row of the table (could be the Header or Totals row). */
|
|
5400
5404
|
firstRowCss?: Properties;
|
|
5401
5405
|
/** Applied to every non-header row of the table */
|
|
5402
5406
|
nonHeaderRowCss?: Properties;
|
|
5403
|
-
/** Applied to the first
|
|
5404
|
-
|
|
5407
|
+
/** Applied to the first body row, i.e. if you want to cancel out `betweenRowsCss`. */
|
|
5408
|
+
firstBodyRowCss?: Properties;
|
|
5405
5409
|
/** Applied to all cell divs (via a selector off the base div). */
|
|
5406
5410
|
cellCss?: Properties;
|
|
5407
5411
|
/**
|
|
5408
5412
|
* Applied to the header row divs.
|
|
5409
5413
|
*
|
|
5410
5414
|
* NOTE `as=virtual`: When using a virtual table with the goal of adding space
|
|
5411
|
-
* between the header and the first row use `
|
|
5415
|
+
* between the header and the first row use `firstBodyRowCss` with a
|
|
5412
5416
|
* margin-top instead. Using `headerCellCss` will not work since the header
|
|
5413
5417
|
* rows are wrapper with Chrome rows.
|
|
5414
5418
|
*/
|
|
@@ -5423,6 +5427,18 @@ interface GridStyle {
|
|
|
5423
5427
|
firstCellCss?: Properties;
|
|
5424
5428
|
/** Applied to the last cell of all rows, i.e. for table-wide padding or right-side borders. */
|
|
5425
5429
|
lastCellCss?: Properties;
|
|
5430
|
+
/** Applied to every cell in the first table-head row (expandableHeader/header/totals). */
|
|
5431
|
+
firstRowCellCss?: Properties;
|
|
5432
|
+
/** Applied to the first cell in the first table-head row. */
|
|
5433
|
+
firstRowFirstCellCss?: Properties;
|
|
5434
|
+
/** Applied to the last cell in the first table-head row. */
|
|
5435
|
+
firstRowLastCellCss?: Properties;
|
|
5436
|
+
/** Applied to every cell in the last table-body row. */
|
|
5437
|
+
lastRowCellCss?: Properties;
|
|
5438
|
+
/** Applied to the first cell in the last table-body row. */
|
|
5439
|
+
lastRowFirstCellCss?: Properties;
|
|
5440
|
+
/** Applied to the last cell in the last table-body row. */
|
|
5441
|
+
lastRowLastCellCss?: Properties;
|
|
5426
5442
|
/** Applied if there is a fallback/overflow message showing. */
|
|
5427
5443
|
firstRowMessageCss?: Properties;
|
|
5428
5444
|
/** Applied on hover if a row has a rowLink/onClick set. */
|
|
@@ -5510,6 +5526,9 @@ interface RowProps<R extends Kinded> {
|
|
|
5510
5526
|
cellHighlight: boolean;
|
|
5511
5527
|
omitRowHover: boolean;
|
|
5512
5528
|
hasExpandableHeader: boolean;
|
|
5529
|
+
isFirstHeadRow: boolean;
|
|
5530
|
+
isFirstBodyRow: boolean;
|
|
5531
|
+
isLastBodyRow: boolean;
|
|
5513
5532
|
resizedWidths: ResizedWidths;
|
|
5514
5533
|
setResizedWidth: (columnId: string, width: number, columnIndex: number) => void;
|
|
5515
5534
|
disableColumnResizing: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -5314,7 +5314,7 @@ declare function applyRowFn<R extends Kinded>(column: GridColumnWithId<R>, row:
|
|
|
5314
5314
|
declare const ASC: "ASC";
|
|
5315
5315
|
declare const DESC: "DESC";
|
|
5316
5316
|
declare const emptyCell: GridCellContent;
|
|
5317
|
-
declare function getFirstOrLastCellCss<R extends Kinded>(style: GridStyle, columnIndex: number, columns: GridColumnWithId<R>[]): Properties;
|
|
5317
|
+
declare function getFirstOrLastCellCss<R extends Kinded>(style: GridStyle, columnIndex: number, columns: GridColumnWithId<R>[], colspan?: number): Properties;
|
|
5318
5318
|
/** A heuristic to detect the result of `React.createElement` / i.e. JSX. */
|
|
5319
5319
|
declare function isJSX(content: any): boolean;
|
|
5320
5320
|
declare function getAlignment(column: GridColumnWithId<any>, maybeContent: ReactNode | GridCellContent): GridCellAlignment;
|
|
@@ -5392,23 +5392,27 @@ type LabelSuffixStyle = {
|
|
|
5392
5392
|
interface GridStyle {
|
|
5393
5393
|
/** Applied to the base div element. */
|
|
5394
5394
|
rootCss?: Properties;
|
|
5395
|
-
/**
|
|
5395
|
+
/**
|
|
5396
|
+
* Applied as the base body-row cell styling (commonly used for row separators).
|
|
5397
|
+
* This is applied to body rows broadly (including the last body row); use
|
|
5398
|
+
* `lastRowCellCss`/`lastRowCss` to adjust/cancel any final-row treatment.
|
|
5399
|
+
*/
|
|
5396
5400
|
betweenRowsCss?: Properties;
|
|
5397
|
-
/** Applied on the last row of the table
|
|
5401
|
+
/** Applied on the last row of the table, typically to override/cancel `betweenRowsCss`. */
|
|
5398
5402
|
lastRowCss?: Properties;
|
|
5399
5403
|
/** Applied on the first row of the table (could be the Header or Totals row). */
|
|
5400
5404
|
firstRowCss?: Properties;
|
|
5401
5405
|
/** Applied to every non-header row of the table */
|
|
5402
5406
|
nonHeaderRowCss?: Properties;
|
|
5403
|
-
/** Applied to the first
|
|
5404
|
-
|
|
5407
|
+
/** Applied to the first body row, i.e. if you want to cancel out `betweenRowsCss`. */
|
|
5408
|
+
firstBodyRowCss?: Properties;
|
|
5405
5409
|
/** Applied to all cell divs (via a selector off the base div). */
|
|
5406
5410
|
cellCss?: Properties;
|
|
5407
5411
|
/**
|
|
5408
5412
|
* Applied to the header row divs.
|
|
5409
5413
|
*
|
|
5410
5414
|
* NOTE `as=virtual`: When using a virtual table with the goal of adding space
|
|
5411
|
-
* between the header and the first row use `
|
|
5415
|
+
* between the header and the first row use `firstBodyRowCss` with a
|
|
5412
5416
|
* margin-top instead. Using `headerCellCss` will not work since the header
|
|
5413
5417
|
* rows are wrapper with Chrome rows.
|
|
5414
5418
|
*/
|
|
@@ -5423,6 +5427,18 @@ interface GridStyle {
|
|
|
5423
5427
|
firstCellCss?: Properties;
|
|
5424
5428
|
/** Applied to the last cell of all rows, i.e. for table-wide padding or right-side borders. */
|
|
5425
5429
|
lastCellCss?: Properties;
|
|
5430
|
+
/** Applied to every cell in the first table-head row (expandableHeader/header/totals). */
|
|
5431
|
+
firstRowCellCss?: Properties;
|
|
5432
|
+
/** Applied to the first cell in the first table-head row. */
|
|
5433
|
+
firstRowFirstCellCss?: Properties;
|
|
5434
|
+
/** Applied to the last cell in the first table-head row. */
|
|
5435
|
+
firstRowLastCellCss?: Properties;
|
|
5436
|
+
/** Applied to every cell in the last table-body row. */
|
|
5437
|
+
lastRowCellCss?: Properties;
|
|
5438
|
+
/** Applied to the first cell in the last table-body row. */
|
|
5439
|
+
lastRowFirstCellCss?: Properties;
|
|
5440
|
+
/** Applied to the last cell in the last table-body row. */
|
|
5441
|
+
lastRowLastCellCss?: Properties;
|
|
5426
5442
|
/** Applied if there is a fallback/overflow message showing. */
|
|
5427
5443
|
firstRowMessageCss?: Properties;
|
|
5428
5444
|
/** Applied on hover if a row has a rowLink/onClick set. */
|
|
@@ -5510,6 +5526,9 @@ interface RowProps<R extends Kinded> {
|
|
|
5510
5526
|
cellHighlight: boolean;
|
|
5511
5527
|
omitRowHover: boolean;
|
|
5512
5528
|
hasExpandableHeader: boolean;
|
|
5529
|
+
isFirstHeadRow: boolean;
|
|
5530
|
+
isFirstBodyRow: boolean;
|
|
5531
|
+
isLastBodyRow: boolean;
|
|
5513
5532
|
resizedWidths: ResizedWidths;
|
|
5514
5533
|
setResizedWidth: (columnId: string, width: number, columnIndex: number) => void;
|
|
5515
5534
|
disableColumnResizing: boolean;
|
package/dist/index.js
CHANGED
|
@@ -7156,21 +7156,19 @@ function memoizedTableStyles() {
|
|
|
7156
7156
|
cellCss: {
|
|
7157
7157
|
...Css[cellTypography].gray900.bgWhite.ai(alignItems).pxPx(12).boxShadow(`inset 0 -1px 0 ${"rgba(236, 235, 235, 1)" /* Gray200 */}`).$,
|
|
7158
7158
|
...rowHeight === "flexible" ? Css.pyPx(12).$ : Css.wsnw.hPx(inlineEditing ? 48 : 36).$,
|
|
7159
|
-
...cellHighlight ? { "&:hover": Css.bgGray100.$ } : {}
|
|
7160
|
-
...bordered && { "&:first-child": Css.bl.bcGray200.$, "&:last-child": Css.br.bcGray200.$ }
|
|
7159
|
+
...cellHighlight ? { "&:hover": Css.bgGray100.$ } : {}
|
|
7161
7160
|
},
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
).$ : Css.addIn("> *", Css.bsh0.$).$,
|
|
7161
|
+
firstCellCss: bordered ? Css.bl.bcGray200.$ : void 0,
|
|
7162
|
+
lastCellCss: bordered ? Css.br.bcGray200.$ : void 0,
|
|
7163
|
+
firstRowCellCss: bordered ? Css.bt.bcGray200.$ : void 0,
|
|
7164
|
+
firstRowFirstCellCss: Css.borderRadius("8px 0 0 0 ").$,
|
|
7165
|
+
firstRowLastCellCss: Css.borderRadius("0 8px 0 0").$,
|
|
7166
|
+
// Keep `betweenRowsCss` on all body rows, but on the final body row
|
|
7167
|
+
// remove the inset shadow and, when bordered, replace it with a true bottom border.
|
|
7168
|
+
lastRowCellCss: bordered ? Css.bsh0.bb.bcGray200.$ : Css.bsh0.$,
|
|
7169
|
+
// Only apply bottom corner radii to the final body-row cells when using `bordered`.
|
|
7170
|
+
lastRowFirstCellCss: bordered ? Css.borderRadius("0 0 0 8px").$ : void 0,
|
|
7171
|
+
lastRowLastCellCss: bordered ? Css.borderRadius("0 0 8px 0").$ : void 0,
|
|
7174
7172
|
presentationSettings: {
|
|
7175
7173
|
borderless: true,
|
|
7176
7174
|
typeScale: "xs",
|
|
@@ -7189,6 +7187,7 @@ function memoizedTableStyles() {
|
|
|
7189
7187
|
var getTableStyles = memoizedTableStyles();
|
|
7190
7188
|
var totalsRowHeight = 40;
|
|
7191
7189
|
var expandableHeaderRowHeight = 40;
|
|
7190
|
+
var tableRowPrintBreakCss = Css.add("pageBreakAfter", "auto").add("pageBreakInside", "avoid").$;
|
|
7192
7191
|
var defaultStyle = getTableStyles({});
|
|
7193
7192
|
var condensedStyle = {
|
|
7194
7193
|
...getTableStyles({ rowHeight: "fixed" }),
|
|
@@ -7457,10 +7456,10 @@ function applyRowFn(column2, row, api, level, expanded, dragData) {
|
|
|
7457
7456
|
var ASC = "ASC";
|
|
7458
7457
|
var DESC = "DESC";
|
|
7459
7458
|
var emptyCell = { content: () => /* @__PURE__ */ jsx31(Fragment9, {}), value: "" };
|
|
7460
|
-
function getFirstOrLastCellCss(style, columnIndex, columns) {
|
|
7459
|
+
function getFirstOrLastCellCss(style, columnIndex, columns, colspan = 1) {
|
|
7461
7460
|
return {
|
|
7462
7461
|
...columnIndex === 0 ? style.firstCellCss : {},
|
|
7463
|
-
...columnIndex
|
|
7462
|
+
...columnIndex + colspan >= columns.length ? style.lastCellCss : {}
|
|
7464
7463
|
};
|
|
7465
7464
|
}
|
|
7466
7465
|
function isJSX(content) {
|
|
@@ -7851,7 +7850,7 @@ function ColumnResizeHandle({
|
|
|
7851
7850
|
import { useContext as useContext8 } from "react";
|
|
7852
7851
|
import { jsx as jsx33, jsxs as jsxs20 } from "@emotion/react/jsx-runtime";
|
|
7853
7852
|
function KeptGroupRow(props) {
|
|
7854
|
-
const { as, columnSizes, style, row, colSpan } = props;
|
|
7853
|
+
const { as, columnSizes, style, row, colSpan, isLastBodyRow } = props;
|
|
7855
7854
|
const CellTag = as === "table" ? "td" : "div";
|
|
7856
7855
|
const { tableState } = useContext8(TableStateContext);
|
|
7857
7856
|
const numHiddenSelectedRows = useComputed(() => tableState.keptRows.length, [tableState]);
|
|
@@ -7860,6 +7859,10 @@ function KeptGroupRow(props) {
|
|
|
7860
7859
|
{
|
|
7861
7860
|
css: {
|
|
7862
7861
|
...style.cellCss,
|
|
7862
|
+
...style.betweenRowsCss,
|
|
7863
|
+
...isLastBodyRow && style.lastRowCellCss,
|
|
7864
|
+
...isLastBodyRow && style.lastRowFirstCellCss,
|
|
7865
|
+
...isLastBodyRow && style.lastRowLastCellCss,
|
|
7863
7866
|
...style.keptGroupRowCss,
|
|
7864
7867
|
...Css.pl0.w(`calc(${columnSizes.join(" + ")})`).$
|
|
7865
7868
|
},
|
|
@@ -8174,6 +8177,9 @@ function RowImpl(props) {
|
|
|
8174
8177
|
cellHighlight,
|
|
8175
8178
|
omitRowHover,
|
|
8176
8179
|
hasExpandableHeader,
|
|
8180
|
+
isFirstHeadRow,
|
|
8181
|
+
isFirstBodyRow,
|
|
8182
|
+
isLastBodyRow,
|
|
8177
8183
|
resizedWidths,
|
|
8178
8184
|
setResizedWidth,
|
|
8179
8185
|
disableColumnResizing = true,
|
|
@@ -8192,6 +8198,8 @@ function RowImpl(props) {
|
|
|
8192
8198
|
const isTotals = row.kind === TOTALS;
|
|
8193
8199
|
const isExpandableHeader = row.kind === EXPANDABLE_HEADER;
|
|
8194
8200
|
const isKeptGroupRow = row.kind === KEPT_GROUP;
|
|
8201
|
+
const isBodyRow = !isHeader && !isTotals && !isExpandableHeader;
|
|
8202
|
+
const isFirstHeadCellRow = isExpandableHeader || !hasExpandableHeader && (isHeader || isTotals);
|
|
8195
8203
|
const rowStyle = rowStyles?.[row.kind];
|
|
8196
8204
|
const RowTag = as === "table" ? "tr" : "div";
|
|
8197
8205
|
const sortOn = tableState.sortConfig?.on;
|
|
@@ -8207,6 +8215,9 @@ function RowImpl(props) {
|
|
|
8207
8215
|
};
|
|
8208
8216
|
const rowCss = {
|
|
8209
8217
|
...!reservedRowKinds.includes(row.kind) && style.nonHeaderRowCss,
|
|
8218
|
+
...isFirstBodyRow && style.firstBodyRowCss,
|
|
8219
|
+
...isFirstHeadRow && style.firstRowCss,
|
|
8220
|
+
...as === "table" && tableRowPrintBreakCss,
|
|
8210
8221
|
// Optionally include the row hover styles, by default they should be turned on.
|
|
8211
8222
|
...showRowHoverColor && {
|
|
8212
8223
|
// Even though backgroundColor is set on the cellCss, the hover target is the row.
|
|
@@ -8219,6 +8230,7 @@ function RowImpl(props) {
|
|
|
8219
8230
|
...levelIndent && Css.mlPx(levelIndent).$,
|
|
8220
8231
|
// For virtual tables use `display: flex` to keep all cells on the same row.
|
|
8221
8232
|
...as === "table" ? {} : Css.relative.df.fg1.fs1.$,
|
|
8233
|
+
...isLastBodyRow && style.lastRowCss,
|
|
8222
8234
|
// Apply `cursorPointer` to the row if it has a link or `onClick` value.
|
|
8223
8235
|
...(rowStyle?.rowLink || rowStyle?.onClick) && { "&:hover": Css.cursorPointer.$ },
|
|
8224
8236
|
...maybeApplyFunction(row, rowStyle?.rowCss),
|
|
@@ -8239,7 +8251,17 @@ function RowImpl(props) {
|
|
|
8239
8251
|
[onDragOver]
|
|
8240
8252
|
);
|
|
8241
8253
|
const onDragOverDebounced = useDebouncedCallback4(dragOverCallback, 100);
|
|
8242
|
-
const RowContent = () => /* @__PURE__ */ jsx34(RowTag, { css: rowCss, ...others, "data-gridrow": true, ...getCount(row.id), ref, className: BorderHoverParent, children: isKeptGroupRow ? /* @__PURE__ */ jsx34(
|
|
8254
|
+
const RowContent = () => /* @__PURE__ */ jsx34(RowTag, { css: rowCss, ...others, "data-gridrow": true, ...getCount(row.id), ref, className: BorderHoverParent, children: isKeptGroupRow ? /* @__PURE__ */ jsx34(
|
|
8255
|
+
KeptGroupRow,
|
|
8256
|
+
{
|
|
8257
|
+
as,
|
|
8258
|
+
style,
|
|
8259
|
+
columnSizes,
|
|
8260
|
+
row,
|
|
8261
|
+
colSpan: columns.length,
|
|
8262
|
+
isLastBodyRow
|
|
8263
|
+
}
|
|
8264
|
+
) : columns.map((column2, columnIndex) => {
|
|
8243
8265
|
const maybeExpandedColumn = expandColumnHidden ? columns[columnIndex - 1] : column2;
|
|
8244
8266
|
const isExpanded = tableState.isExpandedColumn(maybeExpandedColumn.id);
|
|
8245
8267
|
if (column2.hideOnExpand && isExpanded) {
|
|
@@ -8323,8 +8345,16 @@ function RowImpl(props) {
|
|
|
8323
8345
|
...maybeStickyColumnStyles,
|
|
8324
8346
|
// Apply any static/all-cell styling
|
|
8325
8347
|
...style.cellCss,
|
|
8348
|
+
// Apply between-row cell styling for body rows.
|
|
8349
|
+
...isBodyRow && style.betweenRowsCss,
|
|
8350
|
+
...isFirstHeadCellRow && style.firstRowCellCss,
|
|
8351
|
+
...isLastBodyRow && style.lastRowCellCss,
|
|
8326
8352
|
// Then override with first/last cell styling
|
|
8327
|
-
...getFirstOrLastCellCss(style, columnIndex, columns),
|
|
8353
|
+
...getFirstOrLastCellCss(style, columnIndex, columns, currentColspan),
|
|
8354
|
+
...columnIndex === 0 && isFirstHeadCellRow && style.firstRowFirstCellCss,
|
|
8355
|
+
...columnIndex === columns.length - 1 && isFirstHeadCellRow && style.firstRowLastCellCss,
|
|
8356
|
+
...columnIndex === 0 && isLastBodyRow && style.lastRowFirstCellCss,
|
|
8357
|
+
...columnIndex === columns.length - 1 && isLastBodyRow && style.lastRowLastCellCss,
|
|
8328
8358
|
// Then override with per-cell/per-row justification
|
|
8329
8359
|
...justificationCss,
|
|
8330
8360
|
// Then apply any header-specific override
|
|
@@ -8340,7 +8370,7 @@ function RowImpl(props) {
|
|
|
8340
8370
|
// Only apply if not the last column in the table AND when this column is the last column in the group of expandable column or not expanded AND
|
|
8341
8371
|
...hasExpandableHeader && columnIndex + currentColspan < columns.length && (isHeader || isTotals) && currentExpandedColumnCount === 0 && Css.boxShadow(`inset -1px -1px 0 ${"rgba(236, 235, 235, 1)" /* Gray200 */}`).$,
|
|
8342
8372
|
// Or level-specific styling
|
|
8343
|
-
|
|
8373
|
+
...isBodyRow && levelStyle?.cellCss,
|
|
8344
8374
|
// Level specific styling for the first content column
|
|
8345
8375
|
...applyFirstContentColumnStyles && levelStyle?.firstContentColumn,
|
|
8346
8376
|
// The specific cell's css (if any from GridCellContent)
|
|
@@ -8535,6 +8565,7 @@ function TextFieldBase(props) {
|
|
|
8535
8565
|
},
|
|
8536
8566
|
input: {
|
|
8537
8567
|
...Css.w100.mw0.outline0.fg1.bgTransparent.$,
|
|
8568
|
+
// Keep `addIn` for `::selection` until we finish the StyleX migration.
|
|
8538
8569
|
// Not using Truss's inline `if` statement here because `addIn` properties do not respect the if statement.
|
|
8539
8570
|
...contrast && !inputStylePalette && Css.addIn("&::selection", Css.bgGray800.$).$,
|
|
8540
8571
|
// For "multiline" fields we add top and bottom padding of 7px for compact, or 11px for non-compact, to properly match the height of the single line fields
|
|
@@ -13778,7 +13809,25 @@ function GridTable(props) {
|
|
|
13778
13809
|
let visibleDataRows2 = [];
|
|
13779
13810
|
const { visibleRows } = tableState;
|
|
13780
13811
|
const hasExpandableHeader = visibleRows.some((rs) => rs.row.id === EXPANDABLE_HEADER);
|
|
13812
|
+
const bodyRowsCount = visibleRows.filter((rs) => ![HEADER, EXPANDABLE_HEADER, TOTALS].includes(rs.kind)).length;
|
|
13813
|
+
const onlyKeptBodyRows = bodyRowsCount > 0 && visibleRows.every(
|
|
13814
|
+
(rs) => (
|
|
13815
|
+
// For our purposes, "body rows" are any non-header / non-totals rows.
|
|
13816
|
+
[HEADER, EXPANDABLE_HEADER, TOTALS].includes(rs.kind) || rs.isKept || rs.kind === KEPT_GROUP
|
|
13817
|
+
)
|
|
13818
|
+
);
|
|
13819
|
+
let bodyRowsSeen = 0;
|
|
13820
|
+
let foundFirstBodyRow = false;
|
|
13821
|
+
let foundFirstHeadRow = false;
|
|
13781
13822
|
visibleRows.forEach((rs) => {
|
|
13823
|
+
const isHeadRow = [HEADER, EXPANDABLE_HEADER, TOTALS].includes(rs.kind);
|
|
13824
|
+
const isFirstHeadRow = isHeadRow && !foundFirstHeadRow;
|
|
13825
|
+
const isBodyRow = ![HEADER, EXPANDABLE_HEADER, TOTALS].includes(rs.kind);
|
|
13826
|
+
const isFirstBodyRow = isBodyRow && !foundFirstBodyRow;
|
|
13827
|
+
if (isHeadRow) foundFirstHeadRow = true;
|
|
13828
|
+
if (isBodyRow) bodyRowsSeen += 1;
|
|
13829
|
+
if (isBodyRow) foundFirstBodyRow = true;
|
|
13830
|
+
const isLastBodyRow = isBodyRow && bodyRowsSeen === bodyRowsCount && !onlyKeptBodyRows;
|
|
13782
13831
|
const row = /* @__PURE__ */ jsx81(
|
|
13783
13832
|
Row,
|
|
13784
13833
|
{
|
|
@@ -13797,6 +13846,9 @@ function GridTable(props) {
|
|
|
13797
13846
|
cellHighlight: "cellHighlight" in maybeStyle && maybeStyle.cellHighlight === true,
|
|
13798
13847
|
omitRowHover: "rowHover" in maybeStyle && maybeStyle.rowHover === false,
|
|
13799
13848
|
hasExpandableHeader,
|
|
13849
|
+
isFirstHeadRow,
|
|
13850
|
+
isFirstBodyRow,
|
|
13851
|
+
isLastBodyRow,
|
|
13800
13852
|
resizedWidths,
|
|
13801
13853
|
setResizedWidth: handleColumnResize,
|
|
13802
13854
|
disableColumnResizing,
|
|
@@ -13895,27 +13947,30 @@ function renderDiv(style, id, columns, visibleDataRows, keptSelectedRows, firstR
|
|
|
13895
13947
|
"div",
|
|
13896
13948
|
{
|
|
13897
13949
|
css: {
|
|
13898
|
-
...style.firstRowCss && Css.addIn("& > div:first-of-type", style.firstRowCss).$,
|
|
13899
13950
|
...Css.if(stickyHeader).sticky.topPx(stickyOffset).z(zIndices.stickyHeader).$
|
|
13900
13951
|
},
|
|
13901
13952
|
children: tableHeadRows
|
|
13902
13953
|
}
|
|
13903
13954
|
),
|
|
13904
|
-
/* @__PURE__ */ jsxs48(
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13955
|
+
/* @__PURE__ */ jsxs48("div", { children: [
|
|
13956
|
+
keptSelectedRows,
|
|
13957
|
+
firstRowMessage && /* @__PURE__ */ jsx81(
|
|
13958
|
+
"div",
|
|
13959
|
+
{
|
|
13960
|
+
css: {
|
|
13961
|
+
...keptSelectedRows.length === 0 && style.firstBodyRowCss,
|
|
13962
|
+
...style.firstRowMessageCss,
|
|
13963
|
+
...visibleDataRows.length === 0 && style.lastRowCss,
|
|
13964
|
+
...visibleDataRows.length === 0 && style.lastRowCellCss,
|
|
13965
|
+
...visibleDataRows.length === 0 && style.lastRowFirstCellCss,
|
|
13966
|
+
...visibleDataRows.length === 0 && style.lastRowLastCellCss
|
|
13967
|
+
},
|
|
13968
|
+
"data-gridrow": true,
|
|
13969
|
+
children: firstRowMessage
|
|
13970
|
+
}
|
|
13971
|
+
),
|
|
13972
|
+
visibleDataRows
|
|
13973
|
+
] })
|
|
13919
13974
|
]
|
|
13920
13975
|
}
|
|
13921
13976
|
);
|
|
@@ -13927,10 +13982,6 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
|
|
|
13927
13982
|
ref: tableContainerRef,
|
|
13928
13983
|
css: {
|
|
13929
13984
|
...Css.w100.add("borderCollapse", "separate").add("borderSpacing", "0").$,
|
|
13930
|
-
...Css.addIn("& tr ", { pageBreakAfter: "auto", pageBreakInside: "avoid" }).$,
|
|
13931
|
-
...Css.addIn("& > tbody > tr > * ", style.betweenRowsCss || {}).addIn("& > tbody > tr:first-of-type", style.firstNonHeaderRowCss || {}).$,
|
|
13932
|
-
...Css.addIn("& > tbody > tr:last-of-type", style.lastRowCss).$,
|
|
13933
|
-
...Css.addIn("& > thead > tr:first-of-type", style.firstRowCss).$,
|
|
13934
13985
|
...style.rootCss,
|
|
13935
13986
|
...style.minWidthPx ? Css.mwPx(style.minWidthPx).$ : {},
|
|
13936
13987
|
...xss
|
|
@@ -13940,7 +13991,30 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
|
|
|
13940
13991
|
/* @__PURE__ */ jsx81("thead", { css: Css.if(stickyHeader).sticky.topPx(stickyOffset).z(zIndices.stickyHeader).$, children: tableHeadRows }),
|
|
13941
13992
|
/* @__PURE__ */ jsxs48("tbody", { children: [
|
|
13942
13993
|
keptSelectedRows,
|
|
13943
|
-
firstRowMessage && /* @__PURE__ */ jsx81(
|
|
13994
|
+
firstRowMessage && /* @__PURE__ */ jsx81(
|
|
13995
|
+
"tr",
|
|
13996
|
+
{
|
|
13997
|
+
css: {
|
|
13998
|
+
...tableRowPrintBreakCss,
|
|
13999
|
+
...keptSelectedRows.length === 0 && style.firstBodyRowCss,
|
|
14000
|
+
...visibleDataRows.length === 0 && style.lastRowCss
|
|
14001
|
+
},
|
|
14002
|
+
children: /* @__PURE__ */ jsx81(
|
|
14003
|
+
"td",
|
|
14004
|
+
{
|
|
14005
|
+
colSpan: columns.length,
|
|
14006
|
+
css: {
|
|
14007
|
+
...style.betweenRowsCss,
|
|
14008
|
+
...style.firstRowMessageCss,
|
|
14009
|
+
...visibleDataRows.length === 0 && style.lastRowCellCss,
|
|
14010
|
+
...visibleDataRows.length === 0 && style.lastRowFirstCellCss,
|
|
14011
|
+
...visibleDataRows.length === 0 && style.lastRowLastCellCss
|
|
14012
|
+
},
|
|
14013
|
+
children: firstRowMessage
|
|
14014
|
+
}
|
|
14015
|
+
)
|
|
14016
|
+
}
|
|
14017
|
+
),
|
|
13944
14018
|
visibleDataRows
|
|
13945
14019
|
] })
|
|
13946
14020
|
]
|
|
@@ -13993,7 +14067,28 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
13993
14067
|
if (index === 0) {
|
|
13994
14068
|
return (
|
|
13995
14069
|
// Ensure the fallback message is the same width as the table
|
|
13996
|
-
/* @__PURE__ */ jsx81(
|
|
14070
|
+
/* @__PURE__ */ jsx81(
|
|
14071
|
+
"div",
|
|
14072
|
+
{
|
|
14073
|
+
css: {
|
|
14074
|
+
...getTableRefWidthStyles(true),
|
|
14075
|
+
...keptSelectedRows.length === 0 && style.firstBodyRowCss,
|
|
14076
|
+
...visibleDataRows.length === 0 && style.lastRowCss
|
|
14077
|
+
},
|
|
14078
|
+
children: /* @__PURE__ */ jsx81(
|
|
14079
|
+
"div",
|
|
14080
|
+
{
|
|
14081
|
+
css: {
|
|
14082
|
+
...style.firstRowMessageCss,
|
|
14083
|
+
...visibleDataRows.length === 0 && style.lastRowCellCss,
|
|
14084
|
+
...visibleDataRows.length === 0 && style.lastRowFirstCellCss,
|
|
14085
|
+
...visibleDataRows.length === 0 && style.lastRowLastCellCss
|
|
14086
|
+
},
|
|
14087
|
+
children: firstRowMessage
|
|
14088
|
+
}
|
|
14089
|
+
)
|
|
14090
|
+
}
|
|
14091
|
+
)
|
|
13997
14092
|
);
|
|
13998
14093
|
}
|
|
13999
14094
|
index--;
|
|
@@ -14031,20 +14126,12 @@ function renderVirtual(style, id, columns, visibleDataRows, keptSelectedRows, fi
|
|
|
14031
14126
|
var VirtualRoot = memoizeOne(
|
|
14032
14127
|
(gs, _columns, id, xss) => {
|
|
14033
14128
|
return React13.forwardRef(function VirtualRoot2({ style, children }, ref) {
|
|
14034
|
-
const isHeader = Object.keys(style || {}).length === 0;
|
|
14035
14129
|
return /* @__PURE__ */ jsx81(
|
|
14036
14130
|
"div",
|
|
14037
14131
|
{
|
|
14038
14132
|
ref,
|
|
14039
14133
|
style: { ...style, ...{ minWidth: "fit-content" } },
|
|
14040
14134
|
css: {
|
|
14041
|
-
// Add an extra `> div` due to Item + itemContent both having divs
|
|
14042
|
-
...Css.addIn("& > div + div > div > *", gs.betweenRowsCss || {}).$,
|
|
14043
|
-
// Table list styles only
|
|
14044
|
-
...isHeader ? Css.addIn("& > div:first-of-type > *", gs.firstRowCss).$ : {
|
|
14045
|
-
...Css.addIn("& > div:first-of-type", gs.firstNonHeaderRowCss).$,
|
|
14046
|
-
...Css.addIn("& > div:last-of-type > *", gs.lastRowCss).$
|
|
14047
|
-
},
|
|
14048
14135
|
...gs.rootCss,
|
|
14049
14136
|
...gs.minWidthPx ? Css.mwPx(gs.minWidthPx).$ : {},
|
|
14050
14137
|
...xss
|