@homebound/beam 2.306.0 → 2.306.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.
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AutoSaveIndicator = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const form_state_1 = require("@homebound/form-state");
|
|
6
5
|
const react_1 = require("react");
|
|
7
6
|
const Css_1 = require("../Css");
|
|
8
7
|
const types_1 = require("../types");
|
|
9
8
|
const _1 = require(".");
|
|
10
9
|
const Icon_1 = require("./Icon");
|
|
11
10
|
function AutoSaveIndicator({ hideOnIdle, doNotReset }) {
|
|
12
|
-
const { status, resetStatus, errors } = (0,
|
|
11
|
+
const { status, resetStatus, errors } = (0, _1.useAutoSaveStatus)();
|
|
13
12
|
(0, react_1.useEffect)(() => {
|
|
14
13
|
if (doNotReset)
|
|
15
14
|
return;
|
|
@@ -20,13 +19,13 @@ function AutoSaveIndicator({ hideOnIdle, doNotReset }) {
|
|
|
20
19
|
return () => resetStatus();
|
|
21
20
|
}, []);
|
|
22
21
|
switch (status) {
|
|
23
|
-
case
|
|
22
|
+
case _1.AutoSaveStatus.IDLE:
|
|
24
23
|
return hideOnIdle ? null : (0, jsx_runtime_1.jsx)(Indicator, { icon: "cloudSave" });
|
|
25
|
-
case
|
|
24
|
+
case _1.AutoSaveStatus.SAVING:
|
|
26
25
|
return (0, jsx_runtime_1.jsx)(Indicator, { icon: "refresh", text: "Saving..." });
|
|
27
|
-
case
|
|
26
|
+
case _1.AutoSaveStatus.DONE:
|
|
28
27
|
return (0, jsx_runtime_1.jsx)(Indicator, { icon: "cloudSave", text: "Saved" });
|
|
29
|
-
case
|
|
28
|
+
case _1.AutoSaveStatus.ERROR:
|
|
30
29
|
return (
|
|
31
30
|
/**
|
|
32
31
|
* Tooltip is expanding to fill as much available space as it can, possibly
|
|
@@ -7,6 +7,8 @@ const Css_1 = require("../../Css");
|
|
|
7
7
|
function PreventBrowserScroll({ children }) {
|
|
8
8
|
return (
|
|
9
9
|
// Take over the full viewport and hide any overflown content.
|
|
10
|
-
|
|
10
|
+
// Using `-webkit-fill-available`, otherwise `height: 100vh` includes the app bars in mobile Safari. See https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/
|
|
11
|
+
// Setting the multiple "(min|max-)height" properties is necessary, as Truss will turn this into an object and there can only be one `height` property.
|
|
12
|
+
(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.overflowHidden.vh100.mh("-webkit-fill-available").maxh("-webkit-fill-available").$, children: (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.h100.df.fdc.mh0.overflowAuto.$, children: children }) }));
|
|
11
13
|
}
|
|
12
14
|
exports.PreventBrowserScroll = PreventBrowserScroll;
|
|
@@ -29,7 +29,7 @@ function Pagination(props) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
const tid = (0, utils_1.useTestIds)(props, "pagination");
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.bGray200.bt.xs.gray500.px2.pt2.$, ...tid, children: [(0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.mya.mr2.$, ...tid.pageSizeLabel, children: "Page size:" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.wPx(78).$, children: (0, jsx_runtime_1.jsx)(inputs_1.SelectField, { compact: true, label: "Page Size", labelStyle: "hidden", options: exports.pageOptions, value: pageSize, onSelect: (val) => set({ pageNumber: 1, pageSize: val }), ...tid.pageSize }) }), (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mla.mya.df.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.mya.mr2.$, ...tid.pageInfoLabel, children: [first, " ", showLast ? `- ${last}` : "", " of ", totalCount] }), (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "chevronLeft", color: hasPrevPage ? Css_1.Palette.Blue700 : Css_1.Palette.Gray200, onClick: () => set({ pageNumber: pageNumber - 1, pageSize }), disabled: !hasPrevPage, ...tid.previousIcon }), (0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "chevronRight", color: hasNextPage ? Css_1.Palette.Blue700 : Css_1.Palette.Gray200, onClick: () => set({ pageNumber: pageNumber + 1, pageSize }), disabled: !hasNextPage, ...tid.nextIcon })] })] }));
|
|
33
33
|
}
|
|
34
34
|
exports.Pagination = Pagination;
|
|
35
35
|
function toLimitAndOffset(page) {
|
|
@@ -29,7 +29,11 @@ function memoizedTableStyles() {
|
|
|
29
29
|
const defaultLevels = { 1: { firstContentColumn: Css_1.Css.tiny.pl3.$ } };
|
|
30
30
|
cache[key] = {
|
|
31
31
|
emptyCell: "-",
|
|
32
|
-
firstRowMessageCss:
|
|
32
|
+
firstRowMessageCss: {
|
|
33
|
+
...Css_1.Css.tc.py3.$,
|
|
34
|
+
...(allWhite && Css_1.Css.bgWhite.$),
|
|
35
|
+
...(bordered && Css_1.Css.bl.br.bGray200.$),
|
|
36
|
+
},
|
|
33
37
|
headerCellCss: {
|
|
34
38
|
// We want to support headers having two lines of wrapped text, and could add a `lineClamp2` here, but
|
|
35
39
|
// lineClamp requires `display: webkit-box`, which disables `align-items: center` (requires `display: flex/grid`)
|
|
@@ -49,7 +53,7 @@ function memoizedTableStyles() {
|
|
|
49
53
|
.$,
|
|
50
54
|
...(rowHeight === "flexible" ? Css_1.Css.pyPx(12).$ : Css_1.Css.nowrap.hPx(inlineEditing ? 48 : 36).$),
|
|
51
55
|
...(cellHighlight ? { "&:hover": Css_1.Css.bgGray100.$ } : {}),
|
|
52
|
-
...(bordered && { "&:first-
|
|
56
|
+
...(bordered && { "&:first-child": Css_1.Css.bl.bGray200.$, "&:last-child": Css_1.Css.br.bGray200.$ }),
|
|
53
57
|
},
|
|
54
58
|
firstRowCss: {
|
|
55
59
|
...Css_1.Css.addIn("& > *:first-of-type", Css_1.Css.borderRadius("8px 0 0 0 ").$).addIn("& > *:last-of-type", Css_1.Css.borderRadius("0 8px 0 0").$).$,
|