@homebound/beam 3.40.0 → 3.42.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.
- package/dist/Css.json +6 -0
- package/dist/index.cjs +402 -352
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -43
- package/dist/index.d.ts +26 -43
- package/dist/index.js +429 -378
- package/dist/index.js.map +1 -1
- package/dist/truss.css +10 -8
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,6 @@ __export(index_exports, {
|
|
|
97
97
|
EnvironmentBannerLayout: () => EnvironmentBannerLayout,
|
|
98
98
|
ErrorMessage: () => ErrorMessage,
|
|
99
99
|
FieldGroup: () => FieldGroup,
|
|
100
|
-
FilterDropdownMenu: () => _FilterDropdownMenu,
|
|
101
100
|
FilterModal: () => FilterModal,
|
|
102
101
|
Filters: () => _Filters,
|
|
103
102
|
FormDivider: () => FormDivider,
|
|
@@ -2113,6 +2112,32 @@ var CssBuilder = class _CssBuilder {
|
|
|
2113
2112
|
position(value) {
|
|
2114
2113
|
return this.add("position", value);
|
|
2115
2114
|
}
|
|
2115
|
+
// scrollSnap
|
|
2116
|
+
/** Sets `scrollSnapAlign: value`. */
|
|
2117
|
+
ssa(value) {
|
|
2118
|
+
return this.add("scrollSnapAlign", value);
|
|
2119
|
+
}
|
|
2120
|
+
/** Sets `scrollSnapType: value`. */
|
|
2121
|
+
sst(value) {
|
|
2122
|
+
return this.add("scrollSnapType", value);
|
|
2123
|
+
}
|
|
2124
|
+
// scrollbarWidth
|
|
2125
|
+
/** Sets `scrollbarWidth: "auto"`. */
|
|
2126
|
+
get sbwa() {
|
|
2127
|
+
return this.add("scrollbarWidth", "auto");
|
|
2128
|
+
}
|
|
2129
|
+
/** Sets `scrollbarWidth: "thin"`. */
|
|
2130
|
+
get sbwt() {
|
|
2131
|
+
return this.add("scrollbarWidth", "thin");
|
|
2132
|
+
}
|
|
2133
|
+
/** Sets `scrollbarWidth: "none"`. */
|
|
2134
|
+
get sbwn() {
|
|
2135
|
+
return this.add("scrollbarWidth", "none");
|
|
2136
|
+
}
|
|
2137
|
+
/** Sets `scrollbarWidth: value`. */
|
|
2138
|
+
sbw(value) {
|
|
2139
|
+
return this.add("scrollbarWidth", value);
|
|
2140
|
+
}
|
|
2116
2141
|
// skins
|
|
2117
2142
|
/** Sets `color: "rgba(255, 255, 255, 1)"`. */
|
|
2118
2143
|
get white() {
|
|
@@ -16648,66 +16673,71 @@ function TableCardView(props) {
|
|
|
16648
16673
|
} = props;
|
|
16649
16674
|
const tid = useTestIds(props, "tableCardView");
|
|
16650
16675
|
const progressValue = (0, import_react81.useMemo)(() => progress !== void 0 ? clampProgress(progress) : 0, [progress]);
|
|
16676
|
+
const col1 = data.slice(0, Math.ceil(data.length / 2));
|
|
16677
|
+
const col2 = data.slice(Math.ceil(data.length / 2));
|
|
16651
16678
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { ...(0, import_runtime55.trussProps)({
|
|
16652
16679
|
paddingTop: "pt3",
|
|
16653
16680
|
paddingBottom: "pb3",
|
|
16654
16681
|
paddingRight: "pr3",
|
|
16655
16682
|
paddingLeft: "pl3",
|
|
16656
16683
|
width: "w100",
|
|
16657
|
-
height: "
|
|
16684
|
+
height: "h_430px",
|
|
16658
16685
|
boxShadow: "bshBasic",
|
|
16659
16686
|
backgroundColor: ["bgColor_var", {
|
|
16660
16687
|
"--backgroundColor": "var(--b-surface)"
|
|
16661
16688
|
}],
|
|
16662
16689
|
display: "df",
|
|
16663
16690
|
flexDirection: "fdc",
|
|
16664
|
-
gap: "gap2"
|
|
16691
|
+
gap: "gap2",
|
|
16692
|
+
borderRadius: "br8"
|
|
16665
16693
|
}), ...tid, children: [
|
|
16666
16694
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "relative", children: [
|
|
16667
16695
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("img", { className: "h_184px w100 objectFit_cover", src: imgSrc, alt: title, ...tid.image }),
|
|
16668
16696
|
status && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "absolute top1 left1", ...tid.status, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Tag, { ...status }) })
|
|
16669
16697
|
] }),
|
|
16670
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df fdc gap2", children: [
|
|
16698
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df fdc gap2 jcsb h100", children: [
|
|
16671
16699
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { children: [
|
|
16672
16700
|
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { className: "fw4 fz_14px lh_20px", ...tid.eyebrow, children: eyebrow }),
|
|
16673
16701
|
title && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "dif w100 jcsb aic", children: [
|
|
16674
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.
|
|
16675
|
-
title,
|
|
16676
|
-
" "
|
|
16677
|
-
] }),
|
|
16702
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h4", { className: "fwb fz_20px lh_28px oh d_negwebkit_box wbo_vertical to_ellipsis wlc_2", ...tid.title, children: title }),
|
|
16678
16703
|
(badge || badgeTags?.length) && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "dif aic gap1 fs0", ...tid.badge, children: [
|
|
16679
16704
|
badge && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "fw4 fz_14px lh_20px wsnw", children: badge }),
|
|
16680
16705
|
badgeTags?.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Tag, { ...tag }, tag.text))
|
|
16681
16706
|
] })
|
|
16682
16707
|
] })
|
|
16683
16708
|
] }),
|
|
16684
|
-
|
|
16685
|
-
|
|
16686
|
-
|
|
16687
|
-
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
|
|
16691
|
-
|
|
16692
|
-
d.label,
|
|
16693
|
-
":"
|
|
16709
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df fdc gap2", children: [
|
|
16710
|
+
data && data?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("dl", { className: "df gap2 fw4 fz_14px lh_20px", children: [
|
|
16711
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "df fdc fg1", children: col1.map((d) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df gap_4px", ...tid[defaultTestId(d.label)], children: [
|
|
16712
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("dt", { children: [
|
|
16713
|
+
d.label,
|
|
16714
|
+
":"
|
|
16715
|
+
] }),
|
|
16716
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dd", { children: d.value })
|
|
16717
|
+
] }, d.label)) }),
|
|
16718
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "df fdc fg1", children: col2.map((d) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df gap_4px", ...tid[defaultTestId(d.label)], children: [
|
|
16719
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("dt", { children: [
|
|
16720
|
+
d.label,
|
|
16721
|
+
":"
|
|
16722
|
+
] }),
|
|
16723
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dd", { children: d.value })
|
|
16724
|
+
] }, d.label)) })
|
|
16694
16725
|
] }),
|
|
16695
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
|
|
16701
|
-
|
|
16702
|
-
|
|
16703
|
-
|
|
16704
|
-
|
|
16705
|
-
|
|
16706
|
-
|
|
16707
|
-
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
] }) })
|
|
16726
|
+
progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "df fdc gap1", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "df aic gap1 fs_10px lh_14px", children: [
|
|
16727
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w25 h_8px br4 bgGray200", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { ...(0, import_runtime55.trussProps)({
|
|
16728
|
+
height: "h100",
|
|
16729
|
+
borderRadius: "br4",
|
|
16730
|
+
backgroundColor: "bgBlue500",
|
|
16731
|
+
width: ["w_var", {
|
|
16732
|
+
"--width": (0, import_runtime55.maybeCssVar)(__maybeInc10(`${progressValue}%`))
|
|
16733
|
+
}]
|
|
16734
|
+
}) }) }),
|
|
16735
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { ...tid.progressValue, children: [
|
|
16736
|
+
progressValue,
|
|
16737
|
+
"%"
|
|
16738
|
+
] })
|
|
16739
|
+
] }) })
|
|
16740
|
+
] })
|
|
16711
16741
|
] })
|
|
16712
16742
|
] });
|
|
16713
16743
|
}
|
|
@@ -20095,7 +20125,7 @@ function invertSpacing(value) {
|
|
|
20095
20125
|
}
|
|
20096
20126
|
|
|
20097
20127
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
20098
|
-
var
|
|
20128
|
+
var import_utils125 = require("@react-aria/utils");
|
|
20099
20129
|
var import_react110 = __toESM(require("react"), 1);
|
|
20100
20130
|
|
|
20101
20131
|
// src/components/ButtonMenu.tsx
|
|
@@ -20135,8 +20165,26 @@ function isSelectionButtonMenuProps(props) {
|
|
|
20135
20165
|
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
20136
20166
|
}
|
|
20137
20167
|
|
|
20138
|
-
// src/components/Filters/
|
|
20139
|
-
|
|
20168
|
+
// src/components/Filters/utils.tsx
|
|
20169
|
+
function getActiveFilterCount(filter) {
|
|
20170
|
+
return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
|
|
20171
|
+
}
|
|
20172
|
+
function updateFilter(currentFilter, key, value) {
|
|
20173
|
+
if (value === void 0) {
|
|
20174
|
+
return omitKey(key, currentFilter);
|
|
20175
|
+
} else {
|
|
20176
|
+
return { ...currentFilter, [key]: value };
|
|
20177
|
+
}
|
|
20178
|
+
}
|
|
20179
|
+
var filterTestIdPrefix = "filter";
|
|
20180
|
+
|
|
20181
|
+
// src/components/Layout/layoutTypes.ts
|
|
20182
|
+
function isGridTableProps(props) {
|
|
20183
|
+
return "rows" in props;
|
|
20184
|
+
}
|
|
20185
|
+
|
|
20186
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20187
|
+
var import_react107 = require("react");
|
|
20140
20188
|
|
|
20141
20189
|
// src/components/CountBadge.tsx
|
|
20142
20190
|
var import_runtime74 = require("@homebound/truss/runtime");
|
|
@@ -20182,6 +20230,114 @@ function CountBadge(props) {
|
|
|
20182
20230
|
}), children: count });
|
|
20183
20231
|
}
|
|
20184
20232
|
|
|
20233
|
+
// src/components/Table/components/EditColumnsButton.tsx
|
|
20234
|
+
var import_react103 = require("react");
|
|
20235
|
+
var import_react_aria46 = require("react-aria");
|
|
20236
|
+
var import_react_stately17 = require("react-stately");
|
|
20237
|
+
var import_runtime75 = require("@homebound/truss/runtime");
|
|
20238
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
20239
|
+
function EditColumnsButton(props) {
|
|
20240
|
+
const {
|
|
20241
|
+
defaultOpen,
|
|
20242
|
+
disabled,
|
|
20243
|
+
columns,
|
|
20244
|
+
api
|
|
20245
|
+
} = props;
|
|
20246
|
+
const state = (0, import_react_stately17.useMenuTriggerState)({
|
|
20247
|
+
isOpen: defaultOpen
|
|
20248
|
+
});
|
|
20249
|
+
const buttonRef = (0, import_react103.useRef)(null);
|
|
20250
|
+
const {
|
|
20251
|
+
menuTriggerProps
|
|
20252
|
+
} = (0, import_react_aria46.useMenuTrigger)({
|
|
20253
|
+
isDisabled: !!disabled
|
|
20254
|
+
}, state, buttonRef);
|
|
20255
|
+
const tid = useTestIds(props, "columns");
|
|
20256
|
+
const {
|
|
20257
|
+
sm
|
|
20258
|
+
} = useBreakpoint();
|
|
20259
|
+
const options = (0, import_react103.useMemo)(() => columns.filter((column2) => column2.canHide).filter((column2) => {
|
|
20260
|
+
if (!column2.name || column2.name.length === 0 || !column2.id || column2.id.length === 0) {
|
|
20261
|
+
console.warn("Column is missing 'name' and/or 'id' property required by the Edit Columns button", column2);
|
|
20262
|
+
return false;
|
|
20263
|
+
}
|
|
20264
|
+
return true;
|
|
20265
|
+
}).map((column2) => ({
|
|
20266
|
+
label: column2.name,
|
|
20267
|
+
value: column2.id
|
|
20268
|
+
})), [columns]);
|
|
20269
|
+
const selectedValues = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
20270
|
+
const setSelectedValues = (0, import_react103.useCallback)((ids) => {
|
|
20271
|
+
api.resetColumnWidths();
|
|
20272
|
+
api.setVisibleColumns(columns.filter((column2) => column2.canHide ? ids.includes(column2.id) : true).map((c) => c.id));
|
|
20273
|
+
}, [columns, api]);
|
|
20274
|
+
const hasHiddenColumn = (0, import_react103.useMemo)(() => {
|
|
20275
|
+
const selectableOptionValues = options.map((option) => option.value);
|
|
20276
|
+
return selectableOptionValues.some((option) => !selectedValues.includes(option));
|
|
20277
|
+
}, [options, selectedValues]);
|
|
20278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverlayTrigger, { ...props, trigger: sm ? {
|
|
20279
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
20280
|
+
variant: "outline"
|
|
20281
|
+
} : {
|
|
20282
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
20283
|
+
label: "",
|
|
20284
|
+
size: "md",
|
|
20285
|
+
variant: "secondaryBlack"
|
|
20286
|
+
}, menuTriggerProps, state, buttonRef, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { ...(0, import_runtime75.trussProps)({
|
|
20287
|
+
display: "df",
|
|
20288
|
+
flexDirection: "fdc",
|
|
20289
|
+
backgroundColor: ["bgColor_var", {
|
|
20290
|
+
"--backgroundColor": "var(--b-surface)"
|
|
20291
|
+
}],
|
|
20292
|
+
maxWidth: "maxw_326px",
|
|
20293
|
+
maxHeight: "maxh_512px",
|
|
20294
|
+
boxShadow: "h_bshHover"
|
|
20295
|
+
}), children: [
|
|
20296
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "dg gtc_1fr_auto gap2 pt2 pb2 pr2 pl2 fg1 mh0 oya", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_react103.Fragment, { children: [
|
|
20297
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "fw4 fz_14px lh_20px wsnw oh to_ellipsis pr1", children: option.label }),
|
|
20298
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Switch, { compact: true, selected: selectedValues.includes(option.value), onChange: (value) => setSelectedValues(value ? [...selectedValues, option.value] : selectedValues.filter((v) => v !== option.value)), labelStyle: "hidden", label: option.label, ...tid[`option${option.value}`] })
|
|
20299
|
+
] }, option.value)) }),
|
|
20300
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { ...(0, import_runtime75.trussProps)({
|
|
20301
|
+
display: "df",
|
|
20302
|
+
justifyContent: "jcc",
|
|
20303
|
+
paddingTop: "pt2",
|
|
20304
|
+
paddingBottom: "pb2",
|
|
20305
|
+
paddingRight: "pr2",
|
|
20306
|
+
paddingLeft: "pl2",
|
|
20307
|
+
borderTopStyle: "bts_solid",
|
|
20308
|
+
borderTopWidth: "btw_1px",
|
|
20309
|
+
borderColor: ["bc_var", {
|
|
20310
|
+
"--borderColor": "var(--b-surface-separator)"
|
|
20311
|
+
}]
|
|
20312
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button, { variant: "tertiary", label: "Reset Column Widths", onClick: () => api.resetColumnWidths() }) })
|
|
20313
|
+
] }) });
|
|
20314
|
+
}
|
|
20315
|
+
|
|
20316
|
+
// src/components/Table/components/ViewToggleButton.tsx
|
|
20317
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
20318
|
+
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
20319
|
+
const { sm } = useBreakpoint();
|
|
20320
|
+
const tid = useTestIds({}, "viewToggleButton");
|
|
20321
|
+
const menuItems = [
|
|
20322
|
+
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
20323
|
+
{ label: "Card", icon: "tile", onClick: () => onChange("card") }
|
|
20324
|
+
];
|
|
20325
|
+
const icon = view === "list" ? "projects" : "tile";
|
|
20326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
20327
|
+
ButtonMenu,
|
|
20328
|
+
{
|
|
20329
|
+
trigger: sm ? { icon, variant: "outline" } : { icon, label: "", size: "md", variant: "secondaryBlack" },
|
|
20330
|
+
items: menuItems,
|
|
20331
|
+
defaultOpen,
|
|
20332
|
+
...tid
|
|
20333
|
+
}
|
|
20334
|
+
);
|
|
20335
|
+
}
|
|
20336
|
+
|
|
20337
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20338
|
+
var import_use_debounce7 = require("use-debounce");
|
|
20339
|
+
var import_use_query_params3 = require("use-query-params");
|
|
20340
|
+
|
|
20185
20341
|
// src/components/Filters/BaseFilter.ts
|
|
20186
20342
|
var BaseFilter = class {
|
|
20187
20343
|
constructor(key, props) {
|
|
@@ -20200,7 +20356,7 @@ var BaseFilter = class {
|
|
|
20200
20356
|
};
|
|
20201
20357
|
|
|
20202
20358
|
// src/components/Filters/DateFilter.tsx
|
|
20203
|
-
var
|
|
20359
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
20204
20360
|
function dateFilter(props) {
|
|
20205
20361
|
return (key) => new DateFilter(key, props);
|
|
20206
20362
|
}
|
|
@@ -20222,10 +20378,10 @@ var DateFilter = class extends BaseFilter {
|
|
|
20222
20378
|
}
|
|
20223
20379
|
render(value, setValue, tid, inModal, vertical) {
|
|
20224
20380
|
const { label, operations, getOperationValue, getOperationLabel, defaultValue } = this.props;
|
|
20225
|
-
return /* @__PURE__ */ (0,
|
|
20226
|
-
vertical && /* @__PURE__ */ (0,
|
|
20227
|
-
/* @__PURE__ */ (0,
|
|
20228
|
-
/* @__PURE__ */ (0,
|
|
20381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
20382
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Label, { label }),
|
|
20383
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(CompoundField, { children: [
|
|
20384
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
20229
20385
|
SelectField,
|
|
20230
20386
|
{
|
|
20231
20387
|
sizeToContent: true,
|
|
@@ -20247,7 +20403,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
20247
20403
|
...tid[`${defaultTestId(this.label)}_dateOperation`]
|
|
20248
20404
|
}
|
|
20249
20405
|
),
|
|
20250
|
-
/* @__PURE__ */ (0,
|
|
20406
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
20251
20407
|
DateField,
|
|
20252
20408
|
{
|
|
20253
20409
|
labelStyle: "inline",
|
|
@@ -20271,7 +20427,7 @@ function isDateFilterValue(value) {
|
|
|
20271
20427
|
}
|
|
20272
20428
|
|
|
20273
20429
|
// src/components/Filters/DateRangeFilter.tsx
|
|
20274
|
-
var
|
|
20430
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
20275
20431
|
function dateRangeFilter(props) {
|
|
20276
20432
|
return (key) => new DateRangeFilter(key, props);
|
|
20277
20433
|
}
|
|
@@ -20293,9 +20449,9 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
20293
20449
|
}
|
|
20294
20450
|
render(value, setValue, tid, inModal, vertical) {
|
|
20295
20451
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
20296
|
-
return /* @__PURE__ */ (0,
|
|
20297
|
-
vertical && /* @__PURE__ */ (0,
|
|
20298
|
-
/* @__PURE__ */ (0,
|
|
20452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, { children: [
|
|
20453
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Label, { label }),
|
|
20454
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
20299
20455
|
DateRangeField,
|
|
20300
20456
|
{
|
|
20301
20457
|
labelStyle: "inline",
|
|
@@ -20351,7 +20507,7 @@ function resolveNestedOptions(optionsOrLoad) {
|
|
|
20351
20507
|
}
|
|
20352
20508
|
|
|
20353
20509
|
// src/components/Filters/MultiFilter.tsx
|
|
20354
|
-
var
|
|
20510
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
20355
20511
|
function multiFilter(props) {
|
|
20356
20512
|
return (key) => new MultiFilter(key, props);
|
|
20357
20513
|
}
|
|
@@ -20365,7 +20521,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20365
20521
|
const { disabledOptions } = this.props;
|
|
20366
20522
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
20367
20523
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
20368
|
-
return /* @__PURE__ */ (0,
|
|
20524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
20369
20525
|
ToggleChipGroup,
|
|
20370
20526
|
{
|
|
20371
20527
|
label: this.label,
|
|
@@ -20389,7 +20545,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20389
20545
|
);
|
|
20390
20546
|
}
|
|
20391
20547
|
const { defaultValue, nothingSelectedText, ...props } = this.props;
|
|
20392
|
-
return /* @__PURE__ */ (0,
|
|
20548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
20393
20549
|
MultiSelectField,
|
|
20394
20550
|
{
|
|
20395
20551
|
...props,
|
|
@@ -20408,7 +20564,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20408
20564
|
};
|
|
20409
20565
|
|
|
20410
20566
|
// src/components/Filters/NumberRangeFilter.tsx
|
|
20411
|
-
var
|
|
20567
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
20412
20568
|
function numberRangeFilter(props) {
|
|
20413
20569
|
return (key) => new NumberRangeFilter(key, props);
|
|
20414
20570
|
}
|
|
@@ -20425,10 +20581,10 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20425
20581
|
} = this.props;
|
|
20426
20582
|
const min = value?.min ?? void 0;
|
|
20427
20583
|
const max = value?.max ?? void 0;
|
|
20428
|
-
return /* @__PURE__ */ (0,
|
|
20429
|
-
vertical && /* @__PURE__ */ (0,
|
|
20430
|
-
/* @__PURE__ */ (0,
|
|
20431
|
-
/* @__PURE__ */ (0,
|
|
20584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_jsx_runtime139.Fragment, { children: [
|
|
20585
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { ...tid, children: [
|
|
20586
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Label, { label }),
|
|
20587
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "pb1", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NumberField, { labelStyle: "inline", clearable: true, label: "Min", value: min, type: numberFieldType, numberFormatOptions, onChange: (minVal) => {
|
|
20432
20588
|
const maxValue = max ? {
|
|
20433
20589
|
max
|
|
20434
20590
|
} : {};
|
|
@@ -20437,7 +20593,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20437
20593
|
...maxValue
|
|
20438
20594
|
} : void 0);
|
|
20439
20595
|
}, ...tid[`${defaultTestId(label)}_min_vertical`] }) }),
|
|
20440
|
-
/* @__PURE__ */ (0,
|
|
20596
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NumberField, { labelStyle: "inline", clearable: true, label: "Max", value: max, type: numberFieldType, numberFormatOptions, onChange: (maxVal) => {
|
|
20441
20597
|
const minValue = min ? {
|
|
20442
20598
|
min
|
|
20443
20599
|
} : {};
|
|
@@ -20447,8 +20603,8 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20447
20603
|
} : void 0);
|
|
20448
20604
|
}, ...tid[`${defaultTestId(label)}_max_vertical`] })
|
|
20449
20605
|
] }),
|
|
20450
|
-
!vertical && /* @__PURE__ */ (0,
|
|
20451
|
-
/* @__PURE__ */ (0,
|
|
20606
|
+
!vertical && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(CompoundField, { ...tid, children: [
|
|
20607
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
20452
20608
|
NumberField,
|
|
20453
20609
|
{
|
|
20454
20610
|
sizeToContent: !inModal,
|
|
@@ -20470,7 +20626,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20470
20626
|
...tid[`${defaultTestId(label)}_min`]
|
|
20471
20627
|
}
|
|
20472
20628
|
),
|
|
20473
|
-
/* @__PURE__ */ (0,
|
|
20629
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NumberField, { sizeToContent: !inModal, labelStyle: "inline", clearable: true, label: !inModal ? `${label} Max` : "Max", value: max, type: numberFieldType, numberFormatOptions, onChange: (maxVal) => {
|
|
20474
20630
|
const minValue = min ? {
|
|
20475
20631
|
min
|
|
20476
20632
|
} : {};
|
|
@@ -20485,7 +20641,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20485
20641
|
};
|
|
20486
20642
|
|
|
20487
20643
|
// src/components/Filters/SingleFilter.tsx
|
|
20488
|
-
var
|
|
20644
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
20489
20645
|
function singleFilter(props) {
|
|
20490
20646
|
return (key) => new SingleFilter(key, props);
|
|
20491
20647
|
}
|
|
@@ -20506,7 +20662,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20506
20662
|
...props
|
|
20507
20663
|
} = this.props;
|
|
20508
20664
|
const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
|
|
20509
|
-
return /* @__PURE__ */ (0,
|
|
20665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
20510
20666
|
SelectField,
|
|
20511
20667
|
{
|
|
20512
20668
|
...props,
|
|
@@ -20526,7 +20682,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20526
20682
|
};
|
|
20527
20683
|
|
|
20528
20684
|
// src/components/Filters/TreeFilter.tsx
|
|
20529
|
-
var
|
|
20685
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
20530
20686
|
function treeFilter(props) {
|
|
20531
20687
|
return (key) => new TreeFilter(key, props);
|
|
20532
20688
|
}
|
|
@@ -20537,7 +20693,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20537
20693
|
}
|
|
20538
20694
|
render(value, setValue, tid, inModal, vertical) {
|
|
20539
20695
|
const { defaultValue, nothingSelectedText, filterBy = "root", ...props } = this.props;
|
|
20540
|
-
return /* @__PURE__ */ (0,
|
|
20696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
20541
20697
|
TreeSelectField,
|
|
20542
20698
|
{
|
|
20543
20699
|
...props,
|
|
@@ -20557,7 +20713,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20557
20713
|
};
|
|
20558
20714
|
|
|
20559
20715
|
// src/components/Filters/BooleanFilter.tsx
|
|
20560
|
-
var
|
|
20716
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
20561
20717
|
function booleanFilter(props) {
|
|
20562
20718
|
return (key) => new BooleanFilter(key, props);
|
|
20563
20719
|
}
|
|
@@ -20569,7 +20725,7 @@ var BooleanFilter = class extends BaseFilter {
|
|
|
20569
20725
|
}
|
|
20570
20726
|
render(value, setValue, tid, inModal, vertical) {
|
|
20571
20727
|
const { options = defaultBooleanOptions, label, defaultValue, ...props } = this.props;
|
|
20572
|
-
return /* @__PURE__ */ (0,
|
|
20728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
20573
20729
|
SelectField,
|
|
20574
20730
|
{
|
|
20575
20731
|
...props,
|
|
@@ -20596,7 +20752,7 @@ var defaultBooleanOptions = [
|
|
|
20596
20752
|
];
|
|
20597
20753
|
|
|
20598
20754
|
// src/components/Filters/CheckboxFilter.tsx
|
|
20599
|
-
var
|
|
20755
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
20600
20756
|
function checkboxFilter(props) {
|
|
20601
20757
|
return (key) => new CheckboxFilter(key, {
|
|
20602
20758
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20611,7 +20767,7 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
20611
20767
|
}
|
|
20612
20768
|
render(value, setValue, tid, inModal, vertical) {
|
|
20613
20769
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20614
|
-
return /* @__PURE__ */ (0,
|
|
20770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
20615
20771
|
Checkbox,
|
|
20616
20772
|
{
|
|
20617
20773
|
...props,
|
|
@@ -20630,29 +20786,29 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
20630
20786
|
};
|
|
20631
20787
|
|
|
20632
20788
|
// src/components/Filters/FilterModal.tsx
|
|
20633
|
-
var
|
|
20789
|
+
var import_react105 = require("react");
|
|
20634
20790
|
|
|
20635
20791
|
// src/components/Modal/OpenModal.tsx
|
|
20636
|
-
var
|
|
20637
|
-
var
|
|
20792
|
+
var import_react104 = require("react");
|
|
20793
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
20638
20794
|
function OpenModal(props) {
|
|
20639
20795
|
const { openModal } = useModal();
|
|
20640
20796
|
const { size, children, keepOpen } = props;
|
|
20641
|
-
(0,
|
|
20797
|
+
(0, import_react104.useEffect)(() => {
|
|
20642
20798
|
if (!keepOpen) {
|
|
20643
20799
|
openModal({ size, content: children });
|
|
20644
20800
|
}
|
|
20645
20801
|
}, [keepOpen, openModal, size, children]);
|
|
20646
20802
|
if (keepOpen) {
|
|
20647
|
-
return /* @__PURE__ */ (0,
|
|
20803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Modal, { size, content: children });
|
|
20648
20804
|
} else {
|
|
20649
|
-
return /* @__PURE__ */ (0,
|
|
20805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { children: "dummy content" });
|
|
20650
20806
|
}
|
|
20651
20807
|
}
|
|
20652
20808
|
|
|
20653
20809
|
// src/components/Filters/FilterModal.tsx
|
|
20654
|
-
var
|
|
20655
|
-
var
|
|
20810
|
+
var import_runtime76 = require("@homebound/truss/runtime");
|
|
20811
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
20656
20812
|
function FilterModal(props) {
|
|
20657
20813
|
const {
|
|
20658
20814
|
filter,
|
|
@@ -20663,20 +20819,20 @@ function FilterModal(props) {
|
|
|
20663
20819
|
const {
|
|
20664
20820
|
closeModal
|
|
20665
20821
|
} = useModal();
|
|
20666
|
-
const [modalFilter, setModalFilter] = (0,
|
|
20667
|
-
return /* @__PURE__ */ (0,
|
|
20668
|
-
/* @__PURE__ */ (0,
|
|
20669
|
-
/* @__PURE__ */ (0,
|
|
20670
|
-
/* @__PURE__ */ (0,
|
|
20822
|
+
const [modalFilter, setModalFilter] = (0, import_react105.useState)(filter);
|
|
20823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
20824
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(ModalHeader, { children: "More Filters" }),
|
|
20825
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(ModalBody, { children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "df fdc", children: safeEntries(filters).map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(ModalFilterItem, { label: f.hideLabelInModal ? void 0 : f.label, children: f.render(modalFilter[key], (value) => setModalFilter(updateFilter(modalFilter, key, value)), testId, true, false) }, key)) }) }),
|
|
20826
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(ModalFooter, { xss: {
|
|
20671
20827
|
justifyContent: "jcsb"
|
|
20672
20828
|
}, children: [
|
|
20673
|
-
/* @__PURE__ */ (0,
|
|
20829
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Clear", variant: "tertiary", disabled: safeKeys(filters).filter((fk) => modalFilter[fk] !== void 0).length === 0, onClick: () => (
|
|
20674
20830
|
// Only remove the filters keys that exist in the modal.
|
|
20675
20831
|
setModalFilter(safeKeys(filters).reduce((acc, fk) => omitKey(fk, acc), modalFilter))
|
|
20676
20832
|
), ...testId.modalClear }),
|
|
20677
|
-
/* @__PURE__ */ (0,
|
|
20678
|
-
/* @__PURE__ */ (0,
|
|
20679
|
-
/* @__PURE__ */ (0,
|
|
20833
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "df gap1", children: [
|
|
20834
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Cancel", variant: "quaternary", onClick: closeModal, ...testId.modalClose }),
|
|
20835
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Apply", onClick: () => {
|
|
20680
20836
|
onApply(modalFilter);
|
|
20681
20837
|
closeModal();
|
|
20682
20838
|
}, ...testId.modalApply })
|
|
@@ -20688,7 +20844,7 @@ function ModalFilterItem({
|
|
|
20688
20844
|
label,
|
|
20689
20845
|
children
|
|
20690
20846
|
}) {
|
|
20691
|
-
return /* @__PURE__ */ (0,
|
|
20847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { ...(0, import_runtime76.trussProps)({
|
|
20692
20848
|
marginBottom: "mb4",
|
|
20693
20849
|
...!label ? {
|
|
20694
20850
|
borderTopStyle: "bts_solid",
|
|
@@ -20696,8 +20852,8 @@ function ModalFilterItem({
|
|
|
20696
20852
|
borderColor: "bcGray200"
|
|
20697
20853
|
} : {}
|
|
20698
20854
|
}), children: [
|
|
20699
|
-
label && /* @__PURE__ */ (0,
|
|
20700
|
-
/* @__PURE__ */ (0,
|
|
20855
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("h2", { className: "fw4 fz_16px lh_24px mb2", children: label }),
|
|
20856
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { ...(0, import_runtime76.trussProps)({
|
|
20701
20857
|
...!label ? {
|
|
20702
20858
|
paddingTop: "pt3"
|
|
20703
20859
|
} : {}
|
|
@@ -20706,9 +20862,9 @@ function ModalFilterItem({
|
|
|
20706
20862
|
}
|
|
20707
20863
|
|
|
20708
20864
|
// src/components/Filters/Filters.tsx
|
|
20709
|
-
var
|
|
20710
|
-
var
|
|
20711
|
-
var
|
|
20865
|
+
var import_react106 = require("react");
|
|
20866
|
+
var import_runtime77 = require("@homebound/truss/runtime");
|
|
20867
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
20712
20868
|
function Filters(props) {
|
|
20713
20869
|
const {
|
|
20714
20870
|
filter,
|
|
@@ -20722,7 +20878,7 @@ function Filters(props) {
|
|
|
20722
20878
|
const {
|
|
20723
20879
|
openModal
|
|
20724
20880
|
} = useModal();
|
|
20725
|
-
const [pageFilters, modalFilters] = (0,
|
|
20881
|
+
const [pageFilters, modalFilters] = (0, import_react106.useMemo)(() => {
|
|
20726
20882
|
const impls = safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]);
|
|
20727
20883
|
if (!vertical && impls.length > numberOfInlineFilters) {
|
|
20728
20884
|
return [Object.fromEntries(impls.slice(0, numberOfInlineFilters - 1)), Object.fromEntries(impls.slice(numberOfInlineFilters - 1))];
|
|
@@ -20730,8 +20886,8 @@ function Filters(props) {
|
|
|
20730
20886
|
return [Object.fromEntries(impls), {}];
|
|
20731
20887
|
}, [numberOfInlineFilters, vertical, filterDefs]);
|
|
20732
20888
|
const numModalFilters = safeKeys(modalFilters).filter((fk) => filter[fk] !== void 0).length;
|
|
20733
|
-
const maybeGroupByField = groupBy ? /* @__PURE__ */ (0,
|
|
20734
|
-
return /* @__PURE__ */ (0,
|
|
20889
|
+
const maybeGroupByField = groupBy ? /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(SelectField, { label: "Group by", labelStyle: !vertical ? "inline" : "above", sizeToContent: !vertical, options: groupBy.options, getOptionValue: (o) => o.id, getOptionLabel: (o) => o.name, value: groupBy.value, onSelect: (g) => g && groupBy.setValue(g) }) }) : null;
|
|
20890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { ...(0, import_runtime77.trussProps)({
|
|
20735
20891
|
...vertical ? {
|
|
20736
20892
|
display: "df",
|
|
20737
20893
|
flexDirection: "fdc",
|
|
@@ -20743,18 +20899,18 @@ function Filters(props) {
|
|
|
20743
20899
|
}
|
|
20744
20900
|
}), ...testId, children: [
|
|
20745
20901
|
maybeGroupByField,
|
|
20746
|
-
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ (0,
|
|
20747
|
-
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ (0,
|
|
20902
|
+
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, vertical) }, key)),
|
|
20903
|
+
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Button, { label: "More Filters", endAdornment: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(CountBadge, { count: numModalFilters, hideIfZero: true }), variant: "secondary", onClick: () => openModal({
|
|
20748
20904
|
// Spreading `props` to pass along `data-testid`
|
|
20749
|
-
content: /* @__PURE__ */ (0,
|
|
20905
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(FilterModal, { ...props, filter, onApply: onChange, filters: modalFilters })
|
|
20750
20906
|
}), ...testId.moreFiltersBtn }),
|
|
20751
|
-
Object.keys(filter).length > 0 && /* @__PURE__ */ (0,
|
|
20907
|
+
Object.keys(filter).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn }) })
|
|
20752
20908
|
] });
|
|
20753
20909
|
}
|
|
20754
|
-
var _Filters = (0,
|
|
20910
|
+
var _Filters = (0, import_react106.memo)(Filters);
|
|
20755
20911
|
|
|
20756
20912
|
// src/components/Filters/ToggleFilter.tsx
|
|
20757
|
-
var
|
|
20913
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
20758
20914
|
function toggleFilter(props) {
|
|
20759
20915
|
return (key) => new ToggleFilter(key, {
|
|
20760
20916
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20769,7 +20925,7 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20769
20925
|
}
|
|
20770
20926
|
render(value, setValue, tid, inModal, vertical) {
|
|
20771
20927
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20772
|
-
return /* @__PURE__ */ (0,
|
|
20928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
20773
20929
|
Switch,
|
|
20774
20930
|
{
|
|
20775
20931
|
...props,
|
|
@@ -20788,126 +20944,83 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20788
20944
|
}
|
|
20789
20945
|
};
|
|
20790
20946
|
|
|
20791
|
-
// src/components/
|
|
20792
|
-
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
if (value === void 0) {
|
|
20797
|
-
return omitKey(key, currentFilter);
|
|
20798
|
-
} else {
|
|
20799
|
-
return { ...currentFilter, [key]: value };
|
|
20800
|
-
}
|
|
20947
|
+
// src/components/Layout/GridTableLayout/FilterPanel.tsx
|
|
20948
|
+
var import_runtime78 = require("@homebound/truss/runtime");
|
|
20949
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
20950
|
+
function FilterPanel(props) {
|
|
20951
|
+
return props.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(FilterPanelOpen, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(FilterPanelClosed, { ...props });
|
|
20801
20952
|
}
|
|
20802
|
-
|
|
20803
|
-
|
|
20804
|
-
|
|
20805
|
-
|
|
20806
|
-
|
|
20807
|
-
|
|
20808
|
-
|
|
20809
|
-
|
|
20810
|
-
const
|
|
20811
|
-
|
|
20812
|
-
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20816
|
-
|
|
20817
|
-
|
|
20818
|
-
|
|
20819
|
-
|
|
20820
|
-
|
|
20821
|
-
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
|
|
20829
|
-
|
|
20830
|
-
|
|
20831
|
-
if (searchProps) {
|
|
20832
|
-
searchProps.onSearch(debouncedSearch);
|
|
20833
|
-
setQueryParams({
|
|
20834
|
-
search: debouncedSearch || void 0
|
|
20835
|
-
}, "replaceIn");
|
|
20836
|
-
}
|
|
20837
|
-
}, [debouncedSearch, searchProps, setQueryParams]);
|
|
20838
|
-
const hasSearch = !!searchProps;
|
|
20839
|
-
const hasFilters = !!filterDefs && Object.keys(filterDefs ?? {}).length > 0;
|
|
20840
|
-
const activeFilterCount = (0, import_react106.useMemo)(() => filter ? getActiveFilterCount(filter) : 0, [filter]);
|
|
20841
|
-
const filterImpls = (0, import_react106.useMemo)(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
20842
|
-
const renderFilters = () => {
|
|
20843
|
-
if (!filter || !onChange) return null;
|
|
20844
|
-
const entries = safeEntries(filterImpls);
|
|
20845
|
-
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
20846
|
-
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
20847
|
-
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
20848
|
-
};
|
|
20849
|
-
const searchTextField = /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => setSearchValue(v ?? ""), placeholder: "Search", clearable: true, startAdornment: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ }) });
|
|
20850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
|
|
20851
|
-
hasSearch && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { ...(0, import_runtime77.trussProps)({
|
|
20852
|
-
width: "w_244px",
|
|
20853
|
-
...sm ? {
|
|
20854
|
-
position: "absolute",
|
|
20855
|
-
overflow: "oh",
|
|
20856
|
-
clip: "cli_inset_50",
|
|
20857
|
-
clipPath: "clp_none",
|
|
20858
|
-
border: "bd_0",
|
|
20859
|
-
height: "h_1px",
|
|
20860
|
-
margin: "m_neg1px",
|
|
20861
|
-
width: "w_1px",
|
|
20862
|
-
padding: "p_0",
|
|
20863
|
-
whiteSpace: "wsnw",
|
|
20864
|
-
opacity: "o0"
|
|
20865
|
-
} : {}
|
|
20866
|
-
}), children: searchTextField }),
|
|
20867
|
-
sm && hasSearch && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setSearchIsOpen(!searchIsOpen), active: searchIsOpen, ...testId.searchButton }),
|
|
20868
|
-
sm && hasFilters && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(IconButton, { variant: "outline", icon: activeFilterCount > 0 ? "filterBadged" : "filter", label: "Filter", active: isOpen, onClick: () => setIsOpen(!isOpen), ...testId.button }),
|
|
20869
|
-
!sm && hasFilters && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Button, { label: "Filter", icon: "filter", size: "md", endAdornment: /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "df aic gap1", children: [
|
|
20870
|
-
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(CountBadge, { count: activeFilterCount }),
|
|
20871
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Icon, { icon: isOpen ? "chevronUp" : "chevronDown" })
|
|
20872
|
-
] }), variant: "secondaryBlack", onClick: () => setIsOpen(!isOpen), active: isOpen, ...testId.button }),
|
|
20873
|
-
searchIsOpen && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { ...(0, import_runtime77.trussProps)({
|
|
20874
|
-
width: "w100",
|
|
20875
|
-
...!sm ? {
|
|
20876
|
-
position: "absolute",
|
|
20877
|
-
overflow: "oh",
|
|
20878
|
-
clip: "cli_inset_50",
|
|
20879
|
-
clipPath: "clp_none",
|
|
20880
|
-
border: "bd_0",
|
|
20881
|
-
height: "h_1px",
|
|
20882
|
-
margin: "m_neg1px",
|
|
20883
|
-
width: "w_1px",
|
|
20884
|
-
padding: "p_0",
|
|
20885
|
-
whiteSpace: "wsnw",
|
|
20886
|
-
opacity: "o0"
|
|
20953
|
+
function FilterPanelOpen({
|
|
20954
|
+
groupBy,
|
|
20955
|
+
filterImpls,
|
|
20956
|
+
filter,
|
|
20957
|
+
setFilter,
|
|
20958
|
+
onClear
|
|
20959
|
+
}) {
|
|
20960
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20961
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20962
|
+
const activeFilterCount = getActiveFilterCount(filter ?? {});
|
|
20963
|
+
const filterControls = filter && setFilter ? buildFilterControls(filterImpls, filter, setFilter, tid) : null;
|
|
20964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { ...(0, import_runtime78.trussProps)({
|
|
20965
|
+
...{
|
|
20966
|
+
display: "df",
|
|
20967
|
+
alignItems: "aic",
|
|
20968
|
+
gap: "gap1",
|
|
20969
|
+
scrollbarWidth: "sbwn"
|
|
20970
|
+
},
|
|
20971
|
+
...{
|
|
20972
|
+
overflowX: "sm_oxa",
|
|
20973
|
+
minWidth: "sm_mw0"
|
|
20974
|
+
},
|
|
20975
|
+
...{
|
|
20976
|
+
flexWrap: "mdandup_fww"
|
|
20977
|
+
},
|
|
20978
|
+
...{
|
|
20979
|
+
...inDocumentScrollLayout ? {
|
|
20980
|
+
paddingLeft: "pl3",
|
|
20981
|
+
paddingRight: "pr3"
|
|
20887
20982
|
} : {}
|
|
20888
|
-
}
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
] }),
|
|
20894
|
-
hasFilters && !isOpen && filter && onChange && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(FilterChips, { filter, filterImpls, onChange, onClear: () => onChange({}), testId })
|
|
20983
|
+
}
|
|
20984
|
+
}), children: [
|
|
20985
|
+
groupBy && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(SelectField, { label: "Group by", labelStyle: "inline", sizeToContent: true, options: groupBy.options, getOptionValue: (o) => o.id, getOptionLabel: (o) => o.name, value: groupBy.value, onSelect: (g) => g && groupBy.setValue(g) }),
|
|
20986
|
+
filterControls,
|
|
20987
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20895
20988
|
] });
|
|
20896
20989
|
}
|
|
20897
|
-
function
|
|
20898
|
-
filter,
|
|
20990
|
+
function FilterPanelClosed({
|
|
20899
20991
|
filterImpls,
|
|
20900
|
-
|
|
20901
|
-
|
|
20902
|
-
|
|
20992
|
+
filter,
|
|
20993
|
+
setFilter,
|
|
20994
|
+
onClear
|
|
20903
20995
|
}) {
|
|
20904
|
-
const
|
|
20996
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20997
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20998
|
+
if (!filter || !setFilter) return null;
|
|
20999
|
+
const chips = safeEntries(filterImpls).flatMap(([key, f]) => chipsForFilterKey(key, f, filter, setFilter, tid));
|
|
20905
21000
|
if (chips.length === 0) return null;
|
|
20906
|
-
return /* @__PURE__ */ (0,
|
|
21001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { ...(0, import_runtime78.trussProps)({
|
|
21002
|
+
display: "df",
|
|
21003
|
+
gap: "gap1",
|
|
21004
|
+
alignItems: "aic",
|
|
21005
|
+
minWidth: "mw0",
|
|
21006
|
+
flexWrap: "fww",
|
|
21007
|
+
...inDocumentScrollLayout ? {
|
|
21008
|
+
paddingLeft: "pl3"
|
|
21009
|
+
} : {}
|
|
21010
|
+
}), children: [
|
|
20907
21011
|
chips,
|
|
20908
|
-
/* @__PURE__ */ (0,
|
|
21012
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20909
21013
|
] });
|
|
20910
21014
|
}
|
|
21015
|
+
function buildFilterControls(filterImpls, filter, setFilter, testId) {
|
|
21016
|
+
const entries = safeEntries(filterImpls);
|
|
21017
|
+
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
21018
|
+
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
21019
|
+
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { children: f.render(filter[key], (value) => setFilter(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
21020
|
+
}
|
|
21021
|
+
function buildFilterImpls(filterDefs) {
|
|
21022
|
+
return Object.fromEntries(safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]));
|
|
21023
|
+
}
|
|
20911
21024
|
function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
20912
21025
|
const value = filter[key];
|
|
20913
21026
|
if (!isDefined(value)) return [];
|
|
@@ -20917,143 +21030,90 @@ function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
|
20917
21030
|
if (!isDefined(label2)) return [];
|
|
20918
21031
|
const chipKey = `${String(key)}_${item}`;
|
|
20919
21032
|
const newArray = value.filter((v) => v !== item);
|
|
20920
|
-
return /* @__PURE__ */ (0,
|
|
21033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ToggleChip, { text: label2, onClick: () => onChange(updateFilter(filter, key, newArray.length > 0 ? newArray : void 0)), ...testId[`chip_${chipKey}`] }, chipKey);
|
|
20921
21034
|
});
|
|
20922
21035
|
}
|
|
20923
21036
|
const label = f.formatSelectedFilterLabel(value);
|
|
20924
21037
|
if (!isDefined(label)) return [];
|
|
20925
|
-
return /* @__PURE__ */ (0,
|
|
20926
|
-
}
|
|
20927
|
-
function buildFilterImpls(filterDefs) {
|
|
20928
|
-
return Object.fromEntries(safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]));
|
|
21038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ToggleChip, { text: label, onClick: () => onChange(updateFilter(filter, key, void 0)), ...testId[`chip_${String(key)}`] }, String(key));
|
|
20929
21039
|
}
|
|
20930
|
-
var _FilterDropdownMenu = (0, import_react106.memo)(FilterDropdownMenu);
|
|
20931
21040
|
|
|
20932
|
-
// src/components/
|
|
20933
|
-
var
|
|
20934
|
-
var
|
|
20935
|
-
|
|
20936
|
-
var import_runtime78 = require("@homebound/truss/runtime");
|
|
20937
|
-
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
20938
|
-
function EditColumnsButton(props) {
|
|
21041
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
21042
|
+
var import_runtime79 = require("@homebound/truss/runtime");
|
|
21043
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
21044
|
+
function GridTableLayoutActionsComponent(props) {
|
|
20939
21045
|
const {
|
|
20940
|
-
|
|
20941
|
-
|
|
21046
|
+
filter,
|
|
21047
|
+
setFilter,
|
|
21048
|
+
filterDefs,
|
|
21049
|
+
groupBy,
|
|
21050
|
+
searchProps,
|
|
21051
|
+
hasHideableColumns,
|
|
20942
21052
|
columns,
|
|
20943
|
-
api
|
|
21053
|
+
api,
|
|
21054
|
+
withCardView,
|
|
21055
|
+
view,
|
|
21056
|
+
setView
|
|
20944
21057
|
} = props;
|
|
20945
|
-
const
|
|
20946
|
-
isOpen: defaultOpen
|
|
20947
|
-
});
|
|
20948
|
-
const buttonRef = (0, import_react107.useRef)(null);
|
|
20949
|
-
const {
|
|
20950
|
-
menuTriggerProps
|
|
20951
|
-
} = (0, import_react_aria46.useMenuTrigger)({
|
|
20952
|
-
isDisabled: !!disabled
|
|
20953
|
-
}, state, buttonRef);
|
|
20954
|
-
const tid = useTestIds(props, "columns");
|
|
21058
|
+
const testId = useTestIds(props, "gridTableLayoutActions");
|
|
20955
21059
|
const {
|
|
20956
21060
|
sm
|
|
20957
21061
|
} = useBreakpoint();
|
|
20958
|
-
const
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(OverlayTrigger, { ...props, trigger: {
|
|
20974
|
-
icon: "columns",
|
|
20975
|
-
size: "md",
|
|
20976
|
-
label: "",
|
|
20977
|
-
variant: "secondaryBlack"
|
|
20978
|
-
}, menuTriggerProps, state, buttonRef, hideEndAdornment: sm, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { ...(0, import_runtime78.trussProps)({
|
|
20979
|
-
display: "df",
|
|
20980
|
-
flexDirection: "fdc",
|
|
20981
|
-
backgroundColor: ["bgColor_var", {
|
|
20982
|
-
"--backgroundColor": "var(--b-surface)"
|
|
20983
|
-
}],
|
|
20984
|
-
maxWidth: "maxw_326px",
|
|
20985
|
-
maxHeight: "maxh_512px",
|
|
20986
|
-
boxShadow: "h_bshHover"
|
|
20987
|
-
}), children: [
|
|
20988
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "dg gtc_1fr_auto gap2 pt2 pb2 pr2 pl2 fg1 mh0 oya", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_react107.Fragment, { children: [
|
|
20989
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "fw4 fz_14px lh_20px wsnw oh to_ellipsis pr1", children: option.label }),
|
|
20990
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Switch, { compact: true, selected: selectedValues.includes(option.value), onChange: (value) => setSelectedValues(value ? [...selectedValues, option.value] : selectedValues.filter((v) => v !== option.value)), labelStyle: "hidden", label: option.label, ...tid[`option${option.value}`] })
|
|
20991
|
-
] }, option.value)) }),
|
|
20992
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { ...(0, import_runtime78.trussProps)({
|
|
20993
|
-
display: "df",
|
|
20994
|
-
justifyContent: "jcc",
|
|
20995
|
-
paddingTop: "pt2",
|
|
20996
|
-
paddingBottom: "pb2",
|
|
20997
|
-
paddingRight: "pr2",
|
|
20998
|
-
paddingLeft: "pl2",
|
|
20999
|
-
borderTopStyle: "bts_solid",
|
|
21000
|
-
borderTopWidth: "btw_1px",
|
|
21001
|
-
borderColor: ["bc_var", {
|
|
21002
|
-
"--borderColor": "var(--b-surface-separator)"
|
|
21003
|
-
}]
|
|
21004
|
-
}), children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Button, { variant: "tertiary", label: "Reset Column Widths", onClick: () => api.resetColumnWidths() }) })
|
|
21005
|
-
] }) });
|
|
21006
|
-
}
|
|
21007
|
-
|
|
21008
|
-
// src/components/Table/components/ViewToggleButton.tsx
|
|
21009
|
-
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
21010
|
-
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
21011
|
-
const { sm } = useBreakpoint();
|
|
21012
|
-
const tid = useTestIds({}, "viewToggleButton");
|
|
21013
|
-
const menuItems = [
|
|
21014
|
-
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
21015
|
-
{ label: "Card", icon: "tile", onClick: () => onChange("card") }
|
|
21016
|
-
];
|
|
21017
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
21018
|
-
ButtonMenu,
|
|
21019
|
-
{
|
|
21020
|
-
trigger: { icon: view === "list" ? "projects" : "tile", label: "", size: "md", variant: "secondaryBlack" },
|
|
21021
|
-
items: menuItems,
|
|
21022
|
-
hideEndAdornment: sm,
|
|
21023
|
-
defaultOpen,
|
|
21024
|
-
...tid
|
|
21062
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
21063
|
+
const [showSearch, setShowSearch] = (0, import_react107.useState)(false);
|
|
21064
|
+
const [showFilters, setShowFilters] = (0, import_react107.useState)(false);
|
|
21065
|
+
const [{
|
|
21066
|
+
search: initialValue
|
|
21067
|
+
}, setQueryParams] = (0, import_use_query_params3.useQueryParams)({
|
|
21068
|
+
search: import_use_query_params3.StringParam
|
|
21069
|
+
});
|
|
21070
|
+
const [searchValue, setSearchValue] = (0, import_react107.useState)(initialValue || "");
|
|
21071
|
+
const handleSearchDebounced = (0, import_use_debounce7.useDebouncedCallback)((value) => {
|
|
21072
|
+
if (searchProps) {
|
|
21073
|
+
searchProps.onSearch(value);
|
|
21074
|
+
setQueryParams({
|
|
21075
|
+
search: value || void 0
|
|
21076
|
+
}, "replaceIn");
|
|
21025
21077
|
}
|
|
21026
|
-
);
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
} = props;
|
|
21038
|
-
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { ...(0, import_runtime79.trussProps)({
|
|
21039
|
-
...{
|
|
21078
|
+
}, 300);
|
|
21079
|
+
const hasSearch = !!searchProps;
|
|
21080
|
+
const hasFilters = !!filterDefs && Object.keys(filterDefs ?? {}).length > 0;
|
|
21081
|
+
const activeFilterCount = (0, import_react107.useMemo)(() => filter ? getActiveFilterCount(filter) : 0, [filter]);
|
|
21082
|
+
const filterImpls = (0, import_react107.useMemo)(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
21083
|
+
const searchTextField = /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => {
|
|
21084
|
+
setSearchValue(v ?? "");
|
|
21085
|
+
handleSearchDebounced(v ?? "");
|
|
21086
|
+
}, placeholder: "Search", clearable: true, fullWidth: true, startAdornment: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ }) });
|
|
21087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df fdc gap1 pb2", children: [
|
|
21088
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { ...(0, import_runtime79.trussProps)({
|
|
21040
21089
|
display: "df",
|
|
21041
21090
|
gap: "gap1",
|
|
21042
|
-
alignItems: "aifs",
|
|
21043
21091
|
justifyContent: "jcsb",
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21092
|
+
paddingTop: "pt3",
|
|
21093
|
+
...inDocumentScrollLayout ? {
|
|
21094
|
+
paddingLeft: "pl3",
|
|
21095
|
+
paddingRight: "pr3"
|
|
21096
|
+
} : {}
|
|
21097
|
+
}), children: [
|
|
21098
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df gap1 aic", children: [
|
|
21099
|
+
!sm && hasSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w_244px", children: searchTextField }),
|
|
21100
|
+
sm && hasSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setShowSearch(!showSearch), active: showSearch, ...testId.searchButton }),
|
|
21101
|
+
sm && hasFilters && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(IconButton, { variant: "outline", icon: activeFilterCount > 0 ? "filterBadged" : "filter", label: "Filter", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterSmallButton }),
|
|
21102
|
+
!sm && hasFilters && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Button, { label: "Filter", icon: "filter", size: "md", endAdornment: /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df aic gap1", children: [
|
|
21103
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(CountBadge, { count: activeFilterCount }),
|
|
21104
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
|
|
21105
|
+
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
|
|
21106
|
+
] }),
|
|
21107
|
+
(hasHideableColumns || withCardView) && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df gap1", children: [
|
|
21108
|
+
hasHideableColumns && view === "list" && columns && api && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns" }),
|
|
21109
|
+
withCardView && view !== void 0 && setView && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ViewToggleButton, { view, onChange: setView })
|
|
21110
|
+
] })
|
|
21111
|
+
] }),
|
|
21112
|
+
sm && showSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "pl3 pr3", children: searchTextField }),
|
|
21113
|
+
hasFilters && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(FilterPanel, { isOpen: showFilters, groupBy, filterImpls, filter, setFilter, onClear: () => setFilter?.({}) })
|
|
21050
21114
|
] });
|
|
21051
21115
|
}
|
|
21052
|
-
|
|
21053
|
-
// src/components/Layout/layoutTypes.ts
|
|
21054
|
-
function isGridTableProps(props) {
|
|
21055
|
-
return "rows" in props;
|
|
21056
|
-
}
|
|
21116
|
+
var _GridTableLayoutActions = (0, import_react107.memo)(GridTableLayoutActionsComponent);
|
|
21057
21117
|
|
|
21058
21118
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
21059
21119
|
var import_react108 = require("react");
|
|
@@ -21215,16 +21275,7 @@ function GridTableLayoutComponent(props) {
|
|
|
21215
21275
|
onSearch: layoutState.setSearchString
|
|
21216
21276
|
} : void 0, [layoutState?.search, layoutState?.setSearchString]);
|
|
21217
21277
|
const emptyState = (0, import_react110.useMemo)(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback), [layoutEmptyFallback, layoutState, tableProps]);
|
|
21218
|
-
const tableActionsEl = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
21219
|
-
hasHideableColumns && view === "list" && /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns", ...tid.editColumnsButton }),
|
|
21220
|
-
withCardView && /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(ViewToggleButton, { view, onChange: setView })
|
|
21221
|
-
] }), xss: {
|
|
21222
|
-
paddingTop: "pt3",
|
|
21223
|
-
...inDocumentScrollLayout ? {
|
|
21224
|
-
paddingLeft: "pl3",
|
|
21225
|
-
paddingRight: "pr3"
|
|
21226
|
-
} : {}
|
|
21227
|
-
}, children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: filterSearchProps }) });
|
|
21278
|
+
const tableActionsEl = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(_GridTableLayoutActions, { filterDefs: layoutState?.filterDefs, filter: layoutState?.filter, setFilter: layoutState?.setFilter, groupBy: layoutState?.groupBy, searchProps: filterSearchProps, hasHideableColumns, columns, api, withCardView, view, setView });
|
|
21228
21279
|
const cardAs = withCardView && view === "card" ? "card" : void 0;
|
|
21229
21280
|
const tableBody = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_jsx_runtime152.Fragment, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(GridTable, { ...tableProps, ...cardAs ? {
|
|
21230
21281
|
as: cardAs
|
|
@@ -21340,7 +21391,7 @@ function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
|
21340
21391
|
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
21341
21392
|
}
|
|
21342
21393
|
}, [enabled, tableActionsRef, tableWrapperRef]);
|
|
21343
|
-
(0,
|
|
21394
|
+
(0, import_utils125.useResizeObserver)({
|
|
21344
21395
|
ref: tableActionsRef,
|
|
21345
21396
|
onResize: enabled ? syncHeightVar : noop
|
|
21346
21397
|
});
|
|
@@ -21977,7 +22028,7 @@ var import_react118 = require("react");
|
|
|
21977
22028
|
var import_react_aria50 = require("react-aria");
|
|
21978
22029
|
|
|
21979
22030
|
// src/components/Tag.tsx
|
|
21980
|
-
var
|
|
22031
|
+
var import_utils133 = require("@react-aria/utils");
|
|
21981
22032
|
var import_react117 = require("react");
|
|
21982
22033
|
var import_runtime85 = require("@homebound/truss/runtime");
|
|
21983
22034
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
@@ -22002,7 +22053,7 @@ function Tag(props) {
|
|
|
22002
22053
|
const tid = useTestIds(otherProps);
|
|
22003
22054
|
const [showTooltip, setShowTooltip] = (0, import_react117.useState)(false);
|
|
22004
22055
|
const ref = (0, import_react117.useRef)(null);
|
|
22005
|
-
(0,
|
|
22056
|
+
(0, import_utils133.useResizeObserver)({
|
|
22006
22057
|
ref,
|
|
22007
22058
|
onResize: () => {
|
|
22008
22059
|
if (!isIconOnly && ref.current) {
|
|
@@ -22950,7 +23001,7 @@ function HomeboundLogo(props) {
|
|
|
22950
23001
|
}
|
|
22951
23002
|
|
|
22952
23003
|
// src/components/MaxLines.tsx
|
|
22953
|
-
var
|
|
23004
|
+
var import_utils142 = require("@react-aria/utils");
|
|
22954
23005
|
var import_react127 = require("react");
|
|
22955
23006
|
var import_runtime95 = require("@homebound/truss/runtime");
|
|
22956
23007
|
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
@@ -22961,7 +23012,7 @@ function MaxLines({
|
|
|
22961
23012
|
const elRef = (0, import_react127.useRef)(null);
|
|
22962
23013
|
const [hasMore, setHasMore] = (0, import_react127.useState)(false);
|
|
22963
23014
|
const [expanded, setExpanded] = (0, import_react127.useState)(false);
|
|
22964
|
-
(0,
|
|
23015
|
+
(0, import_utils142.useLayoutEffect)(() => {
|
|
22965
23016
|
if (!elRef.current) return;
|
|
22966
23017
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
22967
23018
|
}, []);
|
|
@@ -22972,7 +23023,7 @@ function MaxLines({
|
|
|
22972
23023
|
if (!elRef.current) return;
|
|
22973
23024
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
22974
23025
|
}, [expanded]);
|
|
22975
|
-
(0,
|
|
23026
|
+
(0, import_utils142.useResizeObserver)({
|
|
22976
23027
|
ref: elRef,
|
|
22977
23028
|
onResize
|
|
22978
23029
|
});
|
|
@@ -22996,7 +23047,7 @@ function MaxLines({
|
|
|
22996
23047
|
var import_change_case8 = require("change-case");
|
|
22997
23048
|
|
|
22998
23049
|
// src/components/AppNav/AppNavGroup.tsx
|
|
22999
|
-
var
|
|
23050
|
+
var import_utils144 = require("@react-aria/utils");
|
|
23000
23051
|
var import_change_case7 = require("change-case");
|
|
23001
23052
|
var import_react130 = require("react");
|
|
23002
23053
|
|
|
@@ -23239,7 +23290,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
23239
23290
|
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
23240
23291
|
}
|
|
23241
23292
|
}, [expanded, contentEl]);
|
|
23242
|
-
(0,
|
|
23293
|
+
(0, import_utils144.useResizeObserver)({
|
|
23243
23294
|
ref: contentRef,
|
|
23244
23295
|
onResize
|
|
23245
23296
|
});
|
|
@@ -23941,7 +23992,7 @@ function toPageNumberSize(page) {
|
|
|
23941
23992
|
}
|
|
23942
23993
|
|
|
23943
23994
|
// src/components/ScrollShadows.tsx
|
|
23944
|
-
var
|
|
23995
|
+
var import_utils153 = require("@react-aria/utils");
|
|
23945
23996
|
var import_react134 = require("react");
|
|
23946
23997
|
var import_runtime103 = require("@homebound/truss/runtime");
|
|
23947
23998
|
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
@@ -24030,7 +24081,7 @@ function ScrollShadows(props) {
|
|
|
24030
24081
|
setShowEndShadow(start + boxSize < end);
|
|
24031
24082
|
}, [horizontal]);
|
|
24032
24083
|
const onResize = (0, import_react134.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
24033
|
-
(0,
|
|
24084
|
+
(0, import_utils153.useResizeObserver)({
|
|
24034
24085
|
ref: scrollRef,
|
|
24035
24086
|
onResize
|
|
24036
24087
|
});
|
|
@@ -25018,7 +25069,7 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
25018
25069
|
}
|
|
25019
25070
|
|
|
25020
25071
|
// src/layouts/useMeasuredHeight.ts
|
|
25021
|
-
var
|
|
25072
|
+
var import_utils162 = require("@react-aria/utils");
|
|
25022
25073
|
var import_react142 = require("react");
|
|
25023
25074
|
function useMeasuredHeight(ref, enabled) {
|
|
25024
25075
|
const [height, setHeight] = (0, import_react142.useState)(0);
|
|
@@ -25027,7 +25078,7 @@ function useMeasuredHeight(ref, enabled) {
|
|
|
25027
25078
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
25028
25079
|
setHeight((prev) => prev === next ? prev : next);
|
|
25029
25080
|
}, [ref]);
|
|
25030
|
-
(0,
|
|
25081
|
+
(0, import_utils162.useResizeObserver)({ ref, onResize: syncElementHeight });
|
|
25031
25082
|
(0, import_react142.useLayoutEffect)(() => {
|
|
25032
25083
|
syncElementHeight();
|
|
25033
25084
|
}, [enabled, syncElementHeight]);
|
|
@@ -25265,7 +25316,6 @@ function PageHeaderLayout(props) {
|
|
|
25265
25316
|
EnvironmentBannerLayout,
|
|
25266
25317
|
ErrorMessage,
|
|
25267
25318
|
FieldGroup,
|
|
25268
|
-
FilterDropdownMenu,
|
|
25269
25319
|
FilterModal,
|
|
25270
25320
|
Filters,
|
|
25271
25321
|
FormDivider,
|