@homebound/beam 4.9.0 → 4.9.1
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 +17 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6954,7 +6954,6 @@ var import_mobx5 = require("mobx");
|
|
|
6954
6954
|
// src/components/Table/components/CompanionRow.tsx
|
|
6955
6955
|
var import_mobx_react = require("mobx-react");
|
|
6956
6956
|
var import_react16 = require("react");
|
|
6957
|
-
var import_runtime16 = require("@homebound/truss/runtime");
|
|
6958
6957
|
|
|
6959
6958
|
// src/layouts/DocumentScrollLayoutContext.tsx
|
|
6960
6959
|
var import_utils2 = require("@react-aria/utils");
|
|
@@ -7140,6 +7139,7 @@ function headerContentPaddingX(compact = false) {
|
|
|
7140
7139
|
}
|
|
7141
7140
|
|
|
7142
7141
|
// src/components/Table/components/CompanionRow.tsx
|
|
7142
|
+
var import_runtime16 = require("@homebound/truss/runtime");
|
|
7143
7143
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
7144
7144
|
var __maybeInc7 = (inc) => {
|
|
7145
7145
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
@@ -7155,7 +7155,9 @@ function CompanionRowImpl(props) {
|
|
|
7155
7155
|
isLastBodyRow,
|
|
7156
7156
|
companion,
|
|
7157
7157
|
position = "trailing",
|
|
7158
|
-
levelIndent
|
|
7158
|
+
levelIndent,
|
|
7159
|
+
rowCss,
|
|
7160
|
+
cellCss
|
|
7159
7161
|
} = props;
|
|
7160
7162
|
const RowTag = as === "table" ? "tr" : "div";
|
|
7161
7163
|
const CellTag = as === "table" ? "td" : "div";
|
|
@@ -7186,7 +7188,8 @@ function CompanionRowImpl(props) {
|
|
|
7186
7188
|
"--marginLeft": `${levelIndent}px`
|
|
7187
7189
|
}]
|
|
7188
7190
|
},
|
|
7189
|
-
...isLastBodyRow && style.lastRowCss
|
|
7191
|
+
...isLastBodyRow && style.lastRowCss,
|
|
7192
|
+
...rowCss
|
|
7190
7193
|
}), "data-gridrow": true, ...tid[rowId], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CellTag, { ...(0, import_runtime16.trussProps)({
|
|
7191
7194
|
...style.cellCss,
|
|
7192
7195
|
...style.betweenRowsCss,
|
|
@@ -7197,6 +7200,7 @@ function CompanionRowImpl(props) {
|
|
|
7197
7200
|
...isLastBodyRow && style.lastRowCellCss,
|
|
7198
7201
|
...isLastBodyRow && style.lastRowFirstCellCss,
|
|
7199
7202
|
...isLastBodyRow && style.lastRowLastCellCss,
|
|
7203
|
+
...cellCss,
|
|
7200
7204
|
// Companion content is arbitrary — allow wrapping and grow with content.
|
|
7201
7205
|
...{
|
|
7202
7206
|
height: "h_auto",
|
|
@@ -9731,6 +9735,11 @@ function resolveStyles(style) {
|
|
|
9731
9735
|
return style;
|
|
9732
9736
|
}
|
|
9733
9737
|
|
|
9738
|
+
// src/components/Table/utils/maybeApplyFunction.ts
|
|
9739
|
+
function maybeApplyFunction(row, maybeFn) {
|
|
9740
|
+
return typeof maybeFn === "function" ? maybeFn(row) : maybeFn;
|
|
9741
|
+
}
|
|
9742
|
+
|
|
9734
9743
|
// src/hooks/useRenderCount.ts
|
|
9735
9744
|
var import_react28 = require("react");
|
|
9736
9745
|
function useRenderCount() {
|
|
@@ -10117,7 +10126,7 @@ var __typography2 = {
|
|
|
10117
10126
|
lineHeight: "lh_32px"
|
|
10118
10127
|
}
|
|
10119
10128
|
};
|
|
10120
|
-
function
|
|
10129
|
+
function maybeApplyFunction2(row, maybeFn) {
|
|
10121
10130
|
return typeof maybeFn === "function" ? maybeFn(row) : maybeFn;
|
|
10122
10131
|
}
|
|
10123
10132
|
function RowImpl(props) {
|
|
@@ -10173,7 +10182,7 @@ function RowImpl(props) {
|
|
|
10173
10182
|
const RowTag = as === "table" ? "tr" : "div";
|
|
10174
10183
|
const sortOn = tableState.sortConfig?.on;
|
|
10175
10184
|
const showRowHoverColor = !reservedRowKinds.includes(row.kind) && !omitRowHover && style.rowHoverColor !== "none";
|
|
10176
|
-
const rowStyleCellCss =
|
|
10185
|
+
const rowStyleCellCss = maybeApplyFunction2(row, rowStyle?.cellCss);
|
|
10177
10186
|
const levelStyle = style.levels && (typeof style.levels === "function" ? style.levels(level) : style.levels[level]);
|
|
10178
10187
|
const levelIndent = levelStyle?.rowIndent;
|
|
10179
10188
|
const containerCss = {
|
|
@@ -10210,7 +10219,7 @@ function RowImpl(props) {
|
|
|
10210
10219
|
...(rowStyle?.rowLink || rowStyle?.onClick) && {
|
|
10211
10220
|
cursor: "h_cursorPointer"
|
|
10212
10221
|
},
|
|
10213
|
-
...
|
|
10222
|
+
...maybeApplyFunction2(row, rowStyle?.rowCss),
|
|
10214
10223
|
// Row hover paints cells via Row.css.ts (`.beam-row-hover:hover > *`); set the var via Css.style
|
|
10215
10224
|
// (React CSSProperties rejects custom props without a cast).
|
|
10216
10225
|
...showRowHoverColor && {
|
|
@@ -13770,7 +13779,8 @@ function GridTable(props) {
|
|
|
13770
13779
|
} }, rs.key);
|
|
13771
13780
|
const makeCompanionRow = (rs, resolved, isFirstBodyRow, isLastBodyRow) => {
|
|
13772
13781
|
const levelStyle = style.levels && (typeof style.levels === "function" ? style.levels(rs.level) : style.levels[rs.level]);
|
|
13773
|
-
|
|
13782
|
+
const rowStyle = rowStyles?.[rs.row.kind];
|
|
13783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CompanionRow, { as, style, columnSizes, rowId: rs.row.id, colSpan: columns.length, isFirstBodyRow, isLastBodyRow, position: resolved.position, companion: resolved.content, levelIndent: levelStyle?.rowIndent, rowCss: maybeApplyFunction(rs.row, rowStyle?.rowCss), cellCss: maybeApplyFunction(rs.row, rowStyle?.cellCss) }, `${rs.key}-companion`);
|
|
13774
13784
|
};
|
|
13775
13785
|
const makeRowGroup = (rs, isFirstBodyRow, isLastBodyRow, inHead) => {
|
|
13776
13786
|
const resolved = rs.companion;
|