@homebound/beam 2.112.0 → 2.113.0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MutableRefObject, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { PresentationContextProps, PresentationFieldProps } from "../PresentationContext";
|
|
3
3
|
import { GridRowLookup } from "./GridRowLookup";
|
|
4
|
-
import { Margin, Only, Properties, Typography, Xss } from "../../Css";
|
|
4
|
+
import { Margin, Only, Palette, Properties, Typography, Xss } from "../../Css";
|
|
5
5
|
export declare type Kinded = {
|
|
6
6
|
kind: string;
|
|
7
7
|
};
|
|
@@ -42,7 +42,7 @@ export interface GridStyle {
|
|
|
42
42
|
/** Applied if there is a fallback/overflow message showing. */
|
|
43
43
|
firstRowMessageCss?: Properties;
|
|
44
44
|
/** Applied on hover if a row has a rowLink/onClick set. */
|
|
45
|
-
rowHoverColor?:
|
|
45
|
+
rowHoverColor?: Palette;
|
|
46
46
|
/** Styling for our special "nested card" output mode. */
|
|
47
47
|
nestedCards?: NestedCardsStyle;
|
|
48
48
|
/** Default content to put into an empty cell */
|
|
@@ -43,7 +43,6 @@ const visitor_1 = require("./visitor");
|
|
|
43
43
|
const Css_1 = require("../../Css");
|
|
44
44
|
const hooks_1 = require("../../hooks");
|
|
45
45
|
const useRenderCount_1 = require("../../hooks/useRenderCount");
|
|
46
|
-
const tinycolor2_1 = __importDefault(require("tinycolor2"));
|
|
47
46
|
const _1 = require(".");
|
|
48
47
|
exports.ASC = "ASC";
|
|
49
48
|
exports.DESC = "DESC";
|
|
@@ -452,6 +451,7 @@ function getFirstOrLastCellCss(style, columnIndex, columns) {
|
|
|
452
451
|
}
|
|
453
452
|
// We extract GridRow to its own mini-component primarily so we can React.memo'ize it.
|
|
454
453
|
function GridRow(props) {
|
|
454
|
+
var _a;
|
|
455
455
|
const { as, columns, row, style, rowStyles, stickyHeader, stickyOffset, sorting, sortState, setSortKey, openCards, columnSizes, level, getCount, ...others } = props;
|
|
456
456
|
// We treat the "header" kind as special for "good defaults" styling
|
|
457
457
|
const isHeader = row.kind === "header";
|
|
@@ -467,10 +467,9 @@ function GridRow(props) {
|
|
|
467
467
|
const rowCss = {
|
|
468
468
|
// For virtual tables use `display: flex` to keep all cells on the same row. For each cell in the row use `flexNone` to ensure they stay their defined widths
|
|
469
469
|
...(as === "table" ? {} : Css_1.Css.relative.df.fg1.fs1.addIn("&>*", Css_1.Css.flexNone.$).$),
|
|
470
|
-
...(((rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowLink) || (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.onClick)) &&
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
"&:hover > *": Css_1.Css.cursorPointer.bgColor(maybeDarken(rowStyleCellCss === null || rowStyleCellCss === void 0 ? void 0 : rowStyleCellCss.backgroundColor, style.rowHoverColor)).$,
|
|
470
|
+
...(((rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowLink) || (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.onClick)) && {
|
|
471
|
+
// Even though backgroundColor is set on the cellCss, the hover target is the row.
|
|
472
|
+
"&:hover > *": Css_1.Css.cursorPointer.bgColor((_a = style.rowHoverColor) !== null && _a !== void 0 ? _a : Css_1.Palette.LightBlue100).$,
|
|
474
473
|
}),
|
|
475
474
|
...maybeApplyFunction(row, rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowCss),
|
|
476
475
|
// Maybe add the sticky header styles
|
|
@@ -720,9 +719,6 @@ function matchesFilter(maybeContent, filter) {
|
|
|
720
719
|
return false;
|
|
721
720
|
}
|
|
722
721
|
exports.matchesFilter = matchesFilter;
|
|
723
|
-
function maybeDarken(color, defaultColor) {
|
|
724
|
-
return color ? (0, tinycolor2_1.default)(color).darken(4).toString() : defaultColor;
|
|
725
|
-
}
|
|
726
722
|
/** GridTable as Table utility to apply <tr> element override styles. */
|
|
727
723
|
function tableRowStyles(as, column) {
|
|
728
724
|
const thWidth = column === null || column === void 0 ? void 0 : column.w;
|
|
@@ -14,7 +14,6 @@ exports.defaultStyle = {
|
|
|
14
14
|
indentTwoCss: Css_1.Css.pl7.$,
|
|
15
15
|
headerCellCss: Css_1.Css.nowrap.py1.bgGray100.aife.$,
|
|
16
16
|
firstRowMessageCss: Css_1.Css.px1.py2.$,
|
|
17
|
-
rowHoverColor: Css_1.Palette.Gray200,
|
|
18
17
|
};
|
|
19
18
|
/** Tightens up the padding of rows, great for rows that have form elements in them. */
|
|
20
19
|
exports.condensedStyle = {
|
|
@@ -45,7 +44,6 @@ exports.beamFixedStyle = {
|
|
|
45
44
|
cellCss: Css_1.Css.gray900.xs.bgWhite.aic.nowrap.pxPx(12).hPx(36).boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray100}`).$,
|
|
46
45
|
emptyCell: "-",
|
|
47
46
|
presentationSettings: { borderless: true, typeScale: "xs", wrap: false },
|
|
48
|
-
rowHoverColor: Css_1.Palette.Gray200,
|
|
49
47
|
// Included as a hacky "treat indent as deprecated for this table" hint to GridTable
|
|
50
48
|
levels: {},
|
|
51
49
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homebound/beam",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.113.0",
|
|
4
4
|
"author": "Homebound",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"@internationalized/number": "^3.0.3",
|
|
38
38
|
"@react-aria/utils": "^3.9.0",
|
|
39
39
|
"@react-hook/resize-observer": "^1.2.2",
|
|
40
|
-
"@types/tinycolor2": "^1.4.2",
|
|
41
40
|
"change-case": "^4.1.2",
|
|
42
41
|
"date-fns": "^2.21.3",
|
|
43
42
|
"dompurify": "^2.3.0",
|
|
@@ -50,7 +49,6 @@
|
|
|
50
49
|
"react-router-dom": "^5.2.0",
|
|
51
50
|
"react-stately": "^3.9.0",
|
|
52
51
|
"react-virtuoso": "^2.4.0",
|
|
53
|
-
"tinycolor2": "^1.4.2",
|
|
54
52
|
"tributejs": "^5.1.3",
|
|
55
53
|
"trix": "^1.3.1",
|
|
56
54
|
"use-query-params": "^1.2.2",
|