@homebound/beam 3.40.0 → 3.41.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 +364 -319
- 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 +391 -345
- package/dist/index.js.map +1 -1
- package/dist/truss.css +8 -2
- 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() {
|
|
@@ -20095,7 +20120,7 @@ function invertSpacing(value) {
|
|
|
20095
20120
|
}
|
|
20096
20121
|
|
|
20097
20122
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
20098
|
-
var
|
|
20123
|
+
var import_utils125 = require("@react-aria/utils");
|
|
20099
20124
|
var import_react110 = __toESM(require("react"), 1);
|
|
20100
20125
|
|
|
20101
20126
|
// src/components/ButtonMenu.tsx
|
|
@@ -20135,8 +20160,26 @@ function isSelectionButtonMenuProps(props) {
|
|
|
20135
20160
|
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
20136
20161
|
}
|
|
20137
20162
|
|
|
20138
|
-
// src/components/Filters/
|
|
20139
|
-
|
|
20163
|
+
// src/components/Filters/utils.tsx
|
|
20164
|
+
function getActiveFilterCount(filter) {
|
|
20165
|
+
return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
|
|
20166
|
+
}
|
|
20167
|
+
function updateFilter(currentFilter, key, value) {
|
|
20168
|
+
if (value === void 0) {
|
|
20169
|
+
return omitKey(key, currentFilter);
|
|
20170
|
+
} else {
|
|
20171
|
+
return { ...currentFilter, [key]: value };
|
|
20172
|
+
}
|
|
20173
|
+
}
|
|
20174
|
+
var filterTestIdPrefix = "filter";
|
|
20175
|
+
|
|
20176
|
+
// src/components/Layout/layoutTypes.ts
|
|
20177
|
+
function isGridTableProps(props) {
|
|
20178
|
+
return "rows" in props;
|
|
20179
|
+
}
|
|
20180
|
+
|
|
20181
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20182
|
+
var import_react107 = require("react");
|
|
20140
20183
|
|
|
20141
20184
|
// src/components/CountBadge.tsx
|
|
20142
20185
|
var import_runtime74 = require("@homebound/truss/runtime");
|
|
@@ -20182,6 +20225,114 @@ function CountBadge(props) {
|
|
|
20182
20225
|
}), children: count });
|
|
20183
20226
|
}
|
|
20184
20227
|
|
|
20228
|
+
// src/components/Table/components/EditColumnsButton.tsx
|
|
20229
|
+
var import_react103 = require("react");
|
|
20230
|
+
var import_react_aria46 = require("react-aria");
|
|
20231
|
+
var import_react_stately17 = require("react-stately");
|
|
20232
|
+
var import_runtime75 = require("@homebound/truss/runtime");
|
|
20233
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
20234
|
+
function EditColumnsButton(props) {
|
|
20235
|
+
const {
|
|
20236
|
+
defaultOpen,
|
|
20237
|
+
disabled,
|
|
20238
|
+
columns,
|
|
20239
|
+
api
|
|
20240
|
+
} = props;
|
|
20241
|
+
const state = (0, import_react_stately17.useMenuTriggerState)({
|
|
20242
|
+
isOpen: defaultOpen
|
|
20243
|
+
});
|
|
20244
|
+
const buttonRef = (0, import_react103.useRef)(null);
|
|
20245
|
+
const {
|
|
20246
|
+
menuTriggerProps
|
|
20247
|
+
} = (0, import_react_aria46.useMenuTrigger)({
|
|
20248
|
+
isDisabled: !!disabled
|
|
20249
|
+
}, state, buttonRef);
|
|
20250
|
+
const tid = useTestIds(props, "columns");
|
|
20251
|
+
const {
|
|
20252
|
+
sm
|
|
20253
|
+
} = useBreakpoint();
|
|
20254
|
+
const options = (0, import_react103.useMemo)(() => columns.filter((column2) => column2.canHide).filter((column2) => {
|
|
20255
|
+
if (!column2.name || column2.name.length === 0 || !column2.id || column2.id.length === 0) {
|
|
20256
|
+
console.warn("Column is missing 'name' and/or 'id' property required by the Edit Columns button", column2);
|
|
20257
|
+
return false;
|
|
20258
|
+
}
|
|
20259
|
+
return true;
|
|
20260
|
+
}).map((column2) => ({
|
|
20261
|
+
label: column2.name,
|
|
20262
|
+
value: column2.id
|
|
20263
|
+
})), [columns]);
|
|
20264
|
+
const selectedValues = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
20265
|
+
const setSelectedValues = (0, import_react103.useCallback)((ids) => {
|
|
20266
|
+
api.resetColumnWidths();
|
|
20267
|
+
api.setVisibleColumns(columns.filter((column2) => column2.canHide ? ids.includes(column2.id) : true).map((c) => c.id));
|
|
20268
|
+
}, [columns, api]);
|
|
20269
|
+
const hasHiddenColumn = (0, import_react103.useMemo)(() => {
|
|
20270
|
+
const selectableOptionValues = options.map((option) => option.value);
|
|
20271
|
+
return selectableOptionValues.some((option) => !selectedValues.includes(option));
|
|
20272
|
+
}, [options, selectedValues]);
|
|
20273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(OverlayTrigger, { ...props, trigger: sm ? {
|
|
20274
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
20275
|
+
variant: "outline"
|
|
20276
|
+
} : {
|
|
20277
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
20278
|
+
label: "",
|
|
20279
|
+
size: "md",
|
|
20280
|
+
variant: "secondaryBlack"
|
|
20281
|
+
}, menuTriggerProps, state, buttonRef, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { ...(0, import_runtime75.trussProps)({
|
|
20282
|
+
display: "df",
|
|
20283
|
+
flexDirection: "fdc",
|
|
20284
|
+
backgroundColor: ["bgColor_var", {
|
|
20285
|
+
"--backgroundColor": "var(--b-surface)"
|
|
20286
|
+
}],
|
|
20287
|
+
maxWidth: "maxw_326px",
|
|
20288
|
+
maxHeight: "maxh_512px",
|
|
20289
|
+
boxShadow: "h_bshHover"
|
|
20290
|
+
}), children: [
|
|
20291
|
+
/* @__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: [
|
|
20292
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "fw4 fz_14px lh_20px wsnw oh to_ellipsis pr1", children: option.label }),
|
|
20293
|
+
/* @__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}`] })
|
|
20294
|
+
] }, option.value)) }),
|
|
20295
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { ...(0, import_runtime75.trussProps)({
|
|
20296
|
+
display: "df",
|
|
20297
|
+
justifyContent: "jcc",
|
|
20298
|
+
paddingTop: "pt2",
|
|
20299
|
+
paddingBottom: "pb2",
|
|
20300
|
+
paddingRight: "pr2",
|
|
20301
|
+
paddingLeft: "pl2",
|
|
20302
|
+
borderTopStyle: "bts_solid",
|
|
20303
|
+
borderTopWidth: "btw_1px",
|
|
20304
|
+
borderColor: ["bc_var", {
|
|
20305
|
+
"--borderColor": "var(--b-surface-separator)"
|
|
20306
|
+
}]
|
|
20307
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Button, { variant: "tertiary", label: "Reset Column Widths", onClick: () => api.resetColumnWidths() }) })
|
|
20308
|
+
] }) });
|
|
20309
|
+
}
|
|
20310
|
+
|
|
20311
|
+
// src/components/Table/components/ViewToggleButton.tsx
|
|
20312
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
20313
|
+
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
20314
|
+
const { sm } = useBreakpoint();
|
|
20315
|
+
const tid = useTestIds({}, "viewToggleButton");
|
|
20316
|
+
const menuItems = [
|
|
20317
|
+
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
20318
|
+
{ label: "Card", icon: "tile", onClick: () => onChange("card") }
|
|
20319
|
+
];
|
|
20320
|
+
const icon = view === "list" ? "projects" : "tile";
|
|
20321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
20322
|
+
ButtonMenu,
|
|
20323
|
+
{
|
|
20324
|
+
trigger: sm ? { icon, variant: "outline" } : { icon, label: "", size: "md", variant: "secondaryBlack" },
|
|
20325
|
+
items: menuItems,
|
|
20326
|
+
defaultOpen,
|
|
20327
|
+
...tid
|
|
20328
|
+
}
|
|
20329
|
+
);
|
|
20330
|
+
}
|
|
20331
|
+
|
|
20332
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20333
|
+
var import_use_debounce7 = require("use-debounce");
|
|
20334
|
+
var import_use_query_params3 = require("use-query-params");
|
|
20335
|
+
|
|
20185
20336
|
// src/components/Filters/BaseFilter.ts
|
|
20186
20337
|
var BaseFilter = class {
|
|
20187
20338
|
constructor(key, props) {
|
|
@@ -20200,7 +20351,7 @@ var BaseFilter = class {
|
|
|
20200
20351
|
};
|
|
20201
20352
|
|
|
20202
20353
|
// src/components/Filters/DateFilter.tsx
|
|
20203
|
-
var
|
|
20354
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
20204
20355
|
function dateFilter(props) {
|
|
20205
20356
|
return (key) => new DateFilter(key, props);
|
|
20206
20357
|
}
|
|
@@ -20222,10 +20373,10 @@ var DateFilter = class extends BaseFilter {
|
|
|
20222
20373
|
}
|
|
20223
20374
|
render(value, setValue, tid, inModal, vertical) {
|
|
20224
20375
|
const { label, operations, getOperationValue, getOperationLabel, defaultValue } = this.props;
|
|
20225
|
-
return /* @__PURE__ */ (0,
|
|
20226
|
-
vertical && /* @__PURE__ */ (0,
|
|
20227
|
-
/* @__PURE__ */ (0,
|
|
20228
|
-
/* @__PURE__ */ (0,
|
|
20376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
20377
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Label, { label }),
|
|
20378
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(CompoundField, { children: [
|
|
20379
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
20229
20380
|
SelectField,
|
|
20230
20381
|
{
|
|
20231
20382
|
sizeToContent: true,
|
|
@@ -20247,7 +20398,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
20247
20398
|
...tid[`${defaultTestId(this.label)}_dateOperation`]
|
|
20248
20399
|
}
|
|
20249
20400
|
),
|
|
20250
|
-
/* @__PURE__ */ (0,
|
|
20401
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
20251
20402
|
DateField,
|
|
20252
20403
|
{
|
|
20253
20404
|
labelStyle: "inline",
|
|
@@ -20271,7 +20422,7 @@ function isDateFilterValue(value) {
|
|
|
20271
20422
|
}
|
|
20272
20423
|
|
|
20273
20424
|
// src/components/Filters/DateRangeFilter.tsx
|
|
20274
|
-
var
|
|
20425
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
20275
20426
|
function dateRangeFilter(props) {
|
|
20276
20427
|
return (key) => new DateRangeFilter(key, props);
|
|
20277
20428
|
}
|
|
@@ -20293,9 +20444,9 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
20293
20444
|
}
|
|
20294
20445
|
render(value, setValue, tid, inModal, vertical) {
|
|
20295
20446
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
20296
|
-
return /* @__PURE__ */ (0,
|
|
20297
|
-
vertical && /* @__PURE__ */ (0,
|
|
20298
|
-
/* @__PURE__ */ (0,
|
|
20447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_jsx_runtime137.Fragment, { children: [
|
|
20448
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Label, { label }),
|
|
20449
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
20299
20450
|
DateRangeField,
|
|
20300
20451
|
{
|
|
20301
20452
|
labelStyle: "inline",
|
|
@@ -20351,7 +20502,7 @@ function resolveNestedOptions(optionsOrLoad) {
|
|
|
20351
20502
|
}
|
|
20352
20503
|
|
|
20353
20504
|
// src/components/Filters/MultiFilter.tsx
|
|
20354
|
-
var
|
|
20505
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
20355
20506
|
function multiFilter(props) {
|
|
20356
20507
|
return (key) => new MultiFilter(key, props);
|
|
20357
20508
|
}
|
|
@@ -20365,7 +20516,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20365
20516
|
const { disabledOptions } = this.props;
|
|
20366
20517
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
20367
20518
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
20368
|
-
return /* @__PURE__ */ (0,
|
|
20519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
20369
20520
|
ToggleChipGroup,
|
|
20370
20521
|
{
|
|
20371
20522
|
label: this.label,
|
|
@@ -20389,7 +20540,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20389
20540
|
);
|
|
20390
20541
|
}
|
|
20391
20542
|
const { defaultValue, nothingSelectedText, ...props } = this.props;
|
|
20392
|
-
return /* @__PURE__ */ (0,
|
|
20543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
20393
20544
|
MultiSelectField,
|
|
20394
20545
|
{
|
|
20395
20546
|
...props,
|
|
@@ -20408,7 +20559,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
20408
20559
|
};
|
|
20409
20560
|
|
|
20410
20561
|
// src/components/Filters/NumberRangeFilter.tsx
|
|
20411
|
-
var
|
|
20562
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
20412
20563
|
function numberRangeFilter(props) {
|
|
20413
20564
|
return (key) => new NumberRangeFilter(key, props);
|
|
20414
20565
|
}
|
|
@@ -20425,10 +20576,10 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20425
20576
|
} = this.props;
|
|
20426
20577
|
const min = value?.min ?? void 0;
|
|
20427
20578
|
const max = value?.max ?? void 0;
|
|
20428
|
-
return /* @__PURE__ */ (0,
|
|
20429
|
-
vertical && /* @__PURE__ */ (0,
|
|
20430
|
-
/* @__PURE__ */ (0,
|
|
20431
|
-
/* @__PURE__ */ (0,
|
|
20579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_jsx_runtime139.Fragment, { children: [
|
|
20580
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { ...tid, children: [
|
|
20581
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Label, { label }),
|
|
20582
|
+
/* @__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
20583
|
const maxValue = max ? {
|
|
20433
20584
|
max
|
|
20434
20585
|
} : {};
|
|
@@ -20437,7 +20588,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20437
20588
|
...maxValue
|
|
20438
20589
|
} : void 0);
|
|
20439
20590
|
}, ...tid[`${defaultTestId(label)}_min_vertical`] }) }),
|
|
20440
|
-
/* @__PURE__ */ (0,
|
|
20591
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NumberField, { labelStyle: "inline", clearable: true, label: "Max", value: max, type: numberFieldType, numberFormatOptions, onChange: (maxVal) => {
|
|
20441
20592
|
const minValue = min ? {
|
|
20442
20593
|
min
|
|
20443
20594
|
} : {};
|
|
@@ -20447,8 +20598,8 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20447
20598
|
} : void 0);
|
|
20448
20599
|
}, ...tid[`${defaultTestId(label)}_max_vertical`] })
|
|
20449
20600
|
] }),
|
|
20450
|
-
!vertical && /* @__PURE__ */ (0,
|
|
20451
|
-
/* @__PURE__ */ (0,
|
|
20601
|
+
!vertical && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(CompoundField, { ...tid, children: [
|
|
20602
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
20452
20603
|
NumberField,
|
|
20453
20604
|
{
|
|
20454
20605
|
sizeToContent: !inModal,
|
|
@@ -20470,7 +20621,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20470
20621
|
...tid[`${defaultTestId(label)}_min`]
|
|
20471
20622
|
}
|
|
20472
20623
|
),
|
|
20473
|
-
/* @__PURE__ */ (0,
|
|
20624
|
+
/* @__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
20625
|
const minValue = min ? {
|
|
20475
20626
|
min
|
|
20476
20627
|
} : {};
|
|
@@ -20485,7 +20636,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20485
20636
|
};
|
|
20486
20637
|
|
|
20487
20638
|
// src/components/Filters/SingleFilter.tsx
|
|
20488
|
-
var
|
|
20639
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
20489
20640
|
function singleFilter(props) {
|
|
20490
20641
|
return (key) => new SingleFilter(key, props);
|
|
20491
20642
|
}
|
|
@@ -20506,7 +20657,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20506
20657
|
...props
|
|
20507
20658
|
} = this.props;
|
|
20508
20659
|
const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
|
|
20509
|
-
return /* @__PURE__ */ (0,
|
|
20660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
20510
20661
|
SelectField,
|
|
20511
20662
|
{
|
|
20512
20663
|
...props,
|
|
@@ -20526,7 +20677,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20526
20677
|
};
|
|
20527
20678
|
|
|
20528
20679
|
// src/components/Filters/TreeFilter.tsx
|
|
20529
|
-
var
|
|
20680
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
20530
20681
|
function treeFilter(props) {
|
|
20531
20682
|
return (key) => new TreeFilter(key, props);
|
|
20532
20683
|
}
|
|
@@ -20537,7 +20688,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20537
20688
|
}
|
|
20538
20689
|
render(value, setValue, tid, inModal, vertical) {
|
|
20539
20690
|
const { defaultValue, nothingSelectedText, filterBy = "root", ...props } = this.props;
|
|
20540
|
-
return /* @__PURE__ */ (0,
|
|
20691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
20541
20692
|
TreeSelectField,
|
|
20542
20693
|
{
|
|
20543
20694
|
...props,
|
|
@@ -20557,7 +20708,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20557
20708
|
};
|
|
20558
20709
|
|
|
20559
20710
|
// src/components/Filters/BooleanFilter.tsx
|
|
20560
|
-
var
|
|
20711
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
20561
20712
|
function booleanFilter(props) {
|
|
20562
20713
|
return (key) => new BooleanFilter(key, props);
|
|
20563
20714
|
}
|
|
@@ -20569,7 +20720,7 @@ var BooleanFilter = class extends BaseFilter {
|
|
|
20569
20720
|
}
|
|
20570
20721
|
render(value, setValue, tid, inModal, vertical) {
|
|
20571
20722
|
const { options = defaultBooleanOptions, label, defaultValue, ...props } = this.props;
|
|
20572
|
-
return /* @__PURE__ */ (0,
|
|
20723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
20573
20724
|
SelectField,
|
|
20574
20725
|
{
|
|
20575
20726
|
...props,
|
|
@@ -20596,7 +20747,7 @@ var defaultBooleanOptions = [
|
|
|
20596
20747
|
];
|
|
20597
20748
|
|
|
20598
20749
|
// src/components/Filters/CheckboxFilter.tsx
|
|
20599
|
-
var
|
|
20750
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
20600
20751
|
function checkboxFilter(props) {
|
|
20601
20752
|
return (key) => new CheckboxFilter(key, {
|
|
20602
20753
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20611,7 +20762,7 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
20611
20762
|
}
|
|
20612
20763
|
render(value, setValue, tid, inModal, vertical) {
|
|
20613
20764
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20614
|
-
return /* @__PURE__ */ (0,
|
|
20765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
|
|
20615
20766
|
Checkbox,
|
|
20616
20767
|
{
|
|
20617
20768
|
...props,
|
|
@@ -20630,29 +20781,29 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
20630
20781
|
};
|
|
20631
20782
|
|
|
20632
20783
|
// src/components/Filters/FilterModal.tsx
|
|
20633
|
-
var
|
|
20784
|
+
var import_react105 = require("react");
|
|
20634
20785
|
|
|
20635
20786
|
// src/components/Modal/OpenModal.tsx
|
|
20636
|
-
var
|
|
20637
|
-
var
|
|
20787
|
+
var import_react104 = require("react");
|
|
20788
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
20638
20789
|
function OpenModal(props) {
|
|
20639
20790
|
const { openModal } = useModal();
|
|
20640
20791
|
const { size, children, keepOpen } = props;
|
|
20641
|
-
(0,
|
|
20792
|
+
(0, import_react104.useEffect)(() => {
|
|
20642
20793
|
if (!keepOpen) {
|
|
20643
20794
|
openModal({ size, content: children });
|
|
20644
20795
|
}
|
|
20645
20796
|
}, [keepOpen, openModal, size, children]);
|
|
20646
20797
|
if (keepOpen) {
|
|
20647
|
-
return /* @__PURE__ */ (0,
|
|
20798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Modal, { size, content: children });
|
|
20648
20799
|
} else {
|
|
20649
|
-
return /* @__PURE__ */ (0,
|
|
20800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { children: "dummy content" });
|
|
20650
20801
|
}
|
|
20651
20802
|
}
|
|
20652
20803
|
|
|
20653
20804
|
// src/components/Filters/FilterModal.tsx
|
|
20654
|
-
var
|
|
20655
|
-
var
|
|
20805
|
+
var import_runtime76 = require("@homebound/truss/runtime");
|
|
20806
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
20656
20807
|
function FilterModal(props) {
|
|
20657
20808
|
const {
|
|
20658
20809
|
filter,
|
|
@@ -20663,20 +20814,20 @@ function FilterModal(props) {
|
|
|
20663
20814
|
const {
|
|
20664
20815
|
closeModal
|
|
20665
20816
|
} = useModal();
|
|
20666
|
-
const [modalFilter, setModalFilter] = (0,
|
|
20667
|
-
return /* @__PURE__ */ (0,
|
|
20668
|
-
/* @__PURE__ */ (0,
|
|
20669
|
-
/* @__PURE__ */ (0,
|
|
20670
|
-
/* @__PURE__ */ (0,
|
|
20817
|
+
const [modalFilter, setModalFilter] = (0, import_react105.useState)(filter);
|
|
20818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
20819
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(ModalHeader, { children: "More Filters" }),
|
|
20820
|
+
/* @__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)) }) }),
|
|
20821
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(ModalFooter, { xss: {
|
|
20671
20822
|
justifyContent: "jcsb"
|
|
20672
20823
|
}, children: [
|
|
20673
|
-
/* @__PURE__ */ (0,
|
|
20824
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Clear", variant: "tertiary", disabled: safeKeys(filters).filter((fk) => modalFilter[fk] !== void 0).length === 0, onClick: () => (
|
|
20674
20825
|
// Only remove the filters keys that exist in the modal.
|
|
20675
20826
|
setModalFilter(safeKeys(filters).reduce((acc, fk) => omitKey(fk, acc), modalFilter))
|
|
20676
20827
|
), ...testId.modalClear }),
|
|
20677
|
-
/* @__PURE__ */ (0,
|
|
20678
|
-
/* @__PURE__ */ (0,
|
|
20679
|
-
/* @__PURE__ */ (0,
|
|
20828
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "df gap1", children: [
|
|
20829
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Cancel", variant: "quaternary", onClick: closeModal, ...testId.modalClose }),
|
|
20830
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(Button, { label: "Apply", onClick: () => {
|
|
20680
20831
|
onApply(modalFilter);
|
|
20681
20832
|
closeModal();
|
|
20682
20833
|
}, ...testId.modalApply })
|
|
@@ -20688,7 +20839,7 @@ function ModalFilterItem({
|
|
|
20688
20839
|
label,
|
|
20689
20840
|
children
|
|
20690
20841
|
}) {
|
|
20691
|
-
return /* @__PURE__ */ (0,
|
|
20842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { ...(0, import_runtime76.trussProps)({
|
|
20692
20843
|
marginBottom: "mb4",
|
|
20693
20844
|
...!label ? {
|
|
20694
20845
|
borderTopStyle: "bts_solid",
|
|
@@ -20696,8 +20847,8 @@ function ModalFilterItem({
|
|
|
20696
20847
|
borderColor: "bcGray200"
|
|
20697
20848
|
} : {}
|
|
20698
20849
|
}), children: [
|
|
20699
|
-
label && /* @__PURE__ */ (0,
|
|
20700
|
-
/* @__PURE__ */ (0,
|
|
20850
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("h2", { className: "fw4 fz_16px lh_24px mb2", children: label }),
|
|
20851
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { ...(0, import_runtime76.trussProps)({
|
|
20701
20852
|
...!label ? {
|
|
20702
20853
|
paddingTop: "pt3"
|
|
20703
20854
|
} : {}
|
|
@@ -20706,9 +20857,9 @@ function ModalFilterItem({
|
|
|
20706
20857
|
}
|
|
20707
20858
|
|
|
20708
20859
|
// src/components/Filters/Filters.tsx
|
|
20709
|
-
var
|
|
20710
|
-
var
|
|
20711
|
-
var
|
|
20860
|
+
var import_react106 = require("react");
|
|
20861
|
+
var import_runtime77 = require("@homebound/truss/runtime");
|
|
20862
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
20712
20863
|
function Filters(props) {
|
|
20713
20864
|
const {
|
|
20714
20865
|
filter,
|
|
@@ -20722,7 +20873,7 @@ function Filters(props) {
|
|
|
20722
20873
|
const {
|
|
20723
20874
|
openModal
|
|
20724
20875
|
} = useModal();
|
|
20725
|
-
const [pageFilters, modalFilters] = (0,
|
|
20876
|
+
const [pageFilters, modalFilters] = (0, import_react106.useMemo)(() => {
|
|
20726
20877
|
const impls = safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]);
|
|
20727
20878
|
if (!vertical && impls.length > numberOfInlineFilters) {
|
|
20728
20879
|
return [Object.fromEntries(impls.slice(0, numberOfInlineFilters - 1)), Object.fromEntries(impls.slice(numberOfInlineFilters - 1))];
|
|
@@ -20730,8 +20881,8 @@ function Filters(props) {
|
|
|
20730
20881
|
return [Object.fromEntries(impls), {}];
|
|
20731
20882
|
}, [numberOfInlineFilters, vertical, filterDefs]);
|
|
20732
20883
|
const numModalFilters = safeKeys(modalFilters).filter((fk) => filter[fk] !== void 0).length;
|
|
20733
|
-
const maybeGroupByField = groupBy ? /* @__PURE__ */ (0,
|
|
20734
|
-
return /* @__PURE__ */ (0,
|
|
20884
|
+
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;
|
|
20885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { ...(0, import_runtime77.trussProps)({
|
|
20735
20886
|
...vertical ? {
|
|
20736
20887
|
display: "df",
|
|
20737
20888
|
flexDirection: "fdc",
|
|
@@ -20743,18 +20894,18 @@ function Filters(props) {
|
|
|
20743
20894
|
}
|
|
20744
20895
|
}), ...testId, children: [
|
|
20745
20896
|
maybeGroupByField,
|
|
20746
|
-
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ (0,
|
|
20747
|
-
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ (0,
|
|
20897
|
+
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)),
|
|
20898
|
+
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
20899
|
// Spreading `props` to pass along `data-testid`
|
|
20749
|
-
content: /* @__PURE__ */ (0,
|
|
20900
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(FilterModal, { ...props, filter, onApply: onChange, filters: modalFilters })
|
|
20750
20901
|
}), ...testId.moreFiltersBtn }),
|
|
20751
|
-
Object.keys(filter).length > 0 && /* @__PURE__ */ (0,
|
|
20902
|
+
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
20903
|
] });
|
|
20753
20904
|
}
|
|
20754
|
-
var _Filters = (0,
|
|
20905
|
+
var _Filters = (0, import_react106.memo)(Filters);
|
|
20755
20906
|
|
|
20756
20907
|
// src/components/Filters/ToggleFilter.tsx
|
|
20757
|
-
var
|
|
20908
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
20758
20909
|
function toggleFilter(props) {
|
|
20759
20910
|
return (key) => new ToggleFilter(key, {
|
|
20760
20911
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20769,7 +20920,7 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20769
20920
|
}
|
|
20770
20921
|
render(value, setValue, tid, inModal, vertical) {
|
|
20771
20922
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20772
|
-
return /* @__PURE__ */ (0,
|
|
20923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
20773
20924
|
Switch,
|
|
20774
20925
|
{
|
|
20775
20926
|
...props,
|
|
@@ -20788,126 +20939,83 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20788
20939
|
}
|
|
20789
20940
|
};
|
|
20790
20941
|
|
|
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
|
-
}
|
|
20942
|
+
// src/components/Layout/GridTableLayout/FilterPanel.tsx
|
|
20943
|
+
var import_runtime78 = require("@homebound/truss/runtime");
|
|
20944
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
20945
|
+
function FilterPanel(props) {
|
|
20946
|
+
return props.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(FilterPanelOpen, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(FilterPanelClosed, { ...props });
|
|
20801
20947
|
}
|
|
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"
|
|
20948
|
+
function FilterPanelOpen({
|
|
20949
|
+
groupBy,
|
|
20950
|
+
filterImpls,
|
|
20951
|
+
filter,
|
|
20952
|
+
setFilter,
|
|
20953
|
+
onClear
|
|
20954
|
+
}) {
|
|
20955
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20956
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20957
|
+
const activeFilterCount = getActiveFilterCount(filter ?? {});
|
|
20958
|
+
const filterControls = filter && setFilter ? buildFilterControls(filterImpls, filter, setFilter, tid) : null;
|
|
20959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { ...(0, import_runtime78.trussProps)({
|
|
20960
|
+
...{
|
|
20961
|
+
display: "df",
|
|
20962
|
+
alignItems: "aic",
|
|
20963
|
+
gap: "gap1",
|
|
20964
|
+
scrollbarWidth: "sbwn"
|
|
20965
|
+
},
|
|
20966
|
+
...{
|
|
20967
|
+
overflowX: "sm_oxa",
|
|
20968
|
+
minWidth: "sm_mw0"
|
|
20969
|
+
},
|
|
20970
|
+
...{
|
|
20971
|
+
flexWrap: "mdandup_fww"
|
|
20972
|
+
},
|
|
20973
|
+
...{
|
|
20974
|
+
...inDocumentScrollLayout ? {
|
|
20975
|
+
paddingLeft: "pl3",
|
|
20976
|
+
paddingRight: "pr3"
|
|
20887
20977
|
} : {}
|
|
20888
|
-
}
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
] }),
|
|
20894
|
-
hasFilters && !isOpen && filter && onChange && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(FilterChips, { filter, filterImpls, onChange, onClear: () => onChange({}), testId })
|
|
20978
|
+
}
|
|
20979
|
+
}), children: [
|
|
20980
|
+
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) }),
|
|
20981
|
+
filterControls,
|
|
20982
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20895
20983
|
] });
|
|
20896
20984
|
}
|
|
20897
|
-
function
|
|
20898
|
-
filter,
|
|
20985
|
+
function FilterPanelClosed({
|
|
20899
20986
|
filterImpls,
|
|
20900
|
-
|
|
20901
|
-
|
|
20902
|
-
|
|
20987
|
+
filter,
|
|
20988
|
+
setFilter,
|
|
20989
|
+
onClear
|
|
20903
20990
|
}) {
|
|
20904
|
-
const
|
|
20991
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20992
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20993
|
+
if (!filter || !setFilter) return null;
|
|
20994
|
+
const chips = safeEntries(filterImpls).flatMap(([key, f]) => chipsForFilterKey(key, f, filter, setFilter, tid));
|
|
20905
20995
|
if (chips.length === 0) return null;
|
|
20906
|
-
return /* @__PURE__ */ (0,
|
|
20996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { ...(0, import_runtime78.trussProps)({
|
|
20997
|
+
display: "df",
|
|
20998
|
+
gap: "gap1",
|
|
20999
|
+
alignItems: "aic",
|
|
21000
|
+
minWidth: "mw0",
|
|
21001
|
+
flexWrap: "fww",
|
|
21002
|
+
...inDocumentScrollLayout ? {
|
|
21003
|
+
paddingLeft: "pl3"
|
|
21004
|
+
} : {}
|
|
21005
|
+
}), children: [
|
|
20907
21006
|
chips,
|
|
20908
|
-
/* @__PURE__ */ (0,
|
|
21007
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20909
21008
|
] });
|
|
20910
21009
|
}
|
|
21010
|
+
function buildFilterControls(filterImpls, filter, setFilter, testId) {
|
|
21011
|
+
const entries = safeEntries(filterImpls);
|
|
21012
|
+
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
21013
|
+
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
21014
|
+
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));
|
|
21015
|
+
}
|
|
21016
|
+
function buildFilterImpls(filterDefs) {
|
|
21017
|
+
return Object.fromEntries(safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]));
|
|
21018
|
+
}
|
|
20911
21019
|
function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
20912
21020
|
const value = filter[key];
|
|
20913
21021
|
if (!isDefined(value)) return [];
|
|
@@ -20917,143 +21025,90 @@ function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
|
20917
21025
|
if (!isDefined(label2)) return [];
|
|
20918
21026
|
const chipKey = `${String(key)}_${item}`;
|
|
20919
21027
|
const newArray = value.filter((v) => v !== item);
|
|
20920
|
-
return /* @__PURE__ */ (0,
|
|
21028
|
+
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
21029
|
});
|
|
20922
21030
|
}
|
|
20923
21031
|
const label = f.formatSelectedFilterLabel(value);
|
|
20924
21032
|
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)]));
|
|
21033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ToggleChip, { text: label, onClick: () => onChange(updateFilter(filter, key, void 0)), ...testId[`chip_${String(key)}`] }, String(key));
|
|
20929
21034
|
}
|
|
20930
|
-
var _FilterDropdownMenu = (0, import_react106.memo)(FilterDropdownMenu);
|
|
20931
21035
|
|
|
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) {
|
|
21036
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
21037
|
+
var import_runtime79 = require("@homebound/truss/runtime");
|
|
21038
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
21039
|
+
function GridTableLayoutActionsComponent(props) {
|
|
20939
21040
|
const {
|
|
20940
|
-
|
|
20941
|
-
|
|
21041
|
+
filter,
|
|
21042
|
+
setFilter,
|
|
21043
|
+
filterDefs,
|
|
21044
|
+
groupBy,
|
|
21045
|
+
searchProps,
|
|
21046
|
+
hasHideableColumns,
|
|
20942
21047
|
columns,
|
|
20943
|
-
api
|
|
21048
|
+
api,
|
|
21049
|
+
withCardView,
|
|
21050
|
+
view,
|
|
21051
|
+
setView
|
|
20944
21052
|
} = 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");
|
|
21053
|
+
const testId = useTestIds(props, "gridTableLayoutActions");
|
|
20955
21054
|
const {
|
|
20956
21055
|
sm
|
|
20957
21056
|
} = 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
|
|
21057
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
21058
|
+
const [showSearch, setShowSearch] = (0, import_react107.useState)(false);
|
|
21059
|
+
const [showFilters, setShowFilters] = (0, import_react107.useState)(false);
|
|
21060
|
+
const [{
|
|
21061
|
+
search: initialValue
|
|
21062
|
+
}, setQueryParams] = (0, import_use_query_params3.useQueryParams)({
|
|
21063
|
+
search: import_use_query_params3.StringParam
|
|
21064
|
+
});
|
|
21065
|
+
const [searchValue, setSearchValue] = (0, import_react107.useState)(initialValue || "");
|
|
21066
|
+
const handleSearchDebounced = (0, import_use_debounce7.useDebouncedCallback)((value) => {
|
|
21067
|
+
if (searchProps) {
|
|
21068
|
+
searchProps.onSearch(value);
|
|
21069
|
+
setQueryParams({
|
|
21070
|
+
search: value || void 0
|
|
21071
|
+
}, "replaceIn");
|
|
21025
21072
|
}
|
|
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
|
-
...{
|
|
21073
|
+
}, 300);
|
|
21074
|
+
const hasSearch = !!searchProps;
|
|
21075
|
+
const hasFilters = !!filterDefs && Object.keys(filterDefs ?? {}).length > 0;
|
|
21076
|
+
const activeFilterCount = (0, import_react107.useMemo)(() => filter ? getActiveFilterCount(filter) : 0, [filter]);
|
|
21077
|
+
const filterImpls = (0, import_react107.useMemo)(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
21078
|
+
const searchTextField = /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => {
|
|
21079
|
+
setSearchValue(v ?? "");
|
|
21080
|
+
handleSearchDebounced(v ?? "");
|
|
21081
|
+
}, placeholder: "Search", clearable: true, fullWidth: true, startAdornment: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ }) });
|
|
21082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df fdc gap1 pb2", children: [
|
|
21083
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { ...(0, import_runtime79.trussProps)({
|
|
21040
21084
|
display: "df",
|
|
21041
21085
|
gap: "gap1",
|
|
21042
|
-
alignItems: "aifs",
|
|
21043
21086
|
justifyContent: "jcsb",
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21087
|
+
paddingTop: "pt3",
|
|
21088
|
+
...inDocumentScrollLayout ? {
|
|
21089
|
+
paddingLeft: "pl3",
|
|
21090
|
+
paddingRight: "pr3"
|
|
21091
|
+
} : {}
|
|
21092
|
+
}), children: [
|
|
21093
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df gap1 aic", children: [
|
|
21094
|
+
!sm && hasSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w_244px", children: searchTextField }),
|
|
21095
|
+
sm && hasSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setShowSearch(!showSearch), active: showSearch, ...testId.searchButton }),
|
|
21096
|
+
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 }),
|
|
21097
|
+
!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: [
|
|
21098
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(CountBadge, { count: activeFilterCount }),
|
|
21099
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
|
|
21100
|
+
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
|
|
21101
|
+
] }),
|
|
21102
|
+
(hasHideableColumns || withCardView) && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "df gap1", children: [
|
|
21103
|
+
hasHideableColumns && view === "list" && columns && api && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(EditColumnsButton, { columns, api, tooltip: "Display columns" }),
|
|
21104
|
+
withCardView && view !== void 0 && setView && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ViewToggleButton, { view, onChange: setView })
|
|
21105
|
+
] })
|
|
21106
|
+
] }),
|
|
21107
|
+
sm && showSearch && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "pl3 pr3", children: searchTextField }),
|
|
21108
|
+
hasFilters && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(FilterPanel, { isOpen: showFilters, groupBy, filterImpls, filter, setFilter, onClear: () => setFilter?.({}) })
|
|
21050
21109
|
] });
|
|
21051
21110
|
}
|
|
21052
|
-
|
|
21053
|
-
// src/components/Layout/layoutTypes.ts
|
|
21054
|
-
function isGridTableProps(props) {
|
|
21055
|
-
return "rows" in props;
|
|
21056
|
-
}
|
|
21111
|
+
var _GridTableLayoutActions = (0, import_react107.memo)(GridTableLayoutActionsComponent);
|
|
21057
21112
|
|
|
21058
21113
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
21059
21114
|
var import_react108 = require("react");
|
|
@@ -21215,16 +21270,7 @@ function GridTableLayoutComponent(props) {
|
|
|
21215
21270
|
onSearch: layoutState.setSearchString
|
|
21216
21271
|
} : void 0, [layoutState?.search, layoutState?.setSearchString]);
|
|
21217
21272
|
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 }) });
|
|
21273
|
+
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
21274
|
const cardAs = withCardView && view === "card" ? "card" : void 0;
|
|
21229
21275
|
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
21276
|
as: cardAs
|
|
@@ -21340,7 +21386,7 @@ function useSetTableActionsHeight(tableWrapperRef, tableActionsRef, enabled) {
|
|
|
21340
21386
|
tableWrapper.style.removeProperty(beamTableActionsHeightVar);
|
|
21341
21387
|
}
|
|
21342
21388
|
}, [enabled, tableActionsRef, tableWrapperRef]);
|
|
21343
|
-
(0,
|
|
21389
|
+
(0, import_utils125.useResizeObserver)({
|
|
21344
21390
|
ref: tableActionsRef,
|
|
21345
21391
|
onResize: enabled ? syncHeightVar : noop
|
|
21346
21392
|
});
|
|
@@ -21977,7 +22023,7 @@ var import_react118 = require("react");
|
|
|
21977
22023
|
var import_react_aria50 = require("react-aria");
|
|
21978
22024
|
|
|
21979
22025
|
// src/components/Tag.tsx
|
|
21980
|
-
var
|
|
22026
|
+
var import_utils133 = require("@react-aria/utils");
|
|
21981
22027
|
var import_react117 = require("react");
|
|
21982
22028
|
var import_runtime85 = require("@homebound/truss/runtime");
|
|
21983
22029
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
@@ -22002,7 +22048,7 @@ function Tag(props) {
|
|
|
22002
22048
|
const tid = useTestIds(otherProps);
|
|
22003
22049
|
const [showTooltip, setShowTooltip] = (0, import_react117.useState)(false);
|
|
22004
22050
|
const ref = (0, import_react117.useRef)(null);
|
|
22005
|
-
(0,
|
|
22051
|
+
(0, import_utils133.useResizeObserver)({
|
|
22006
22052
|
ref,
|
|
22007
22053
|
onResize: () => {
|
|
22008
22054
|
if (!isIconOnly && ref.current) {
|
|
@@ -22950,7 +22996,7 @@ function HomeboundLogo(props) {
|
|
|
22950
22996
|
}
|
|
22951
22997
|
|
|
22952
22998
|
// src/components/MaxLines.tsx
|
|
22953
|
-
var
|
|
22999
|
+
var import_utils142 = require("@react-aria/utils");
|
|
22954
23000
|
var import_react127 = require("react");
|
|
22955
23001
|
var import_runtime95 = require("@homebound/truss/runtime");
|
|
22956
23002
|
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
@@ -22961,7 +23007,7 @@ function MaxLines({
|
|
|
22961
23007
|
const elRef = (0, import_react127.useRef)(null);
|
|
22962
23008
|
const [hasMore, setHasMore] = (0, import_react127.useState)(false);
|
|
22963
23009
|
const [expanded, setExpanded] = (0, import_react127.useState)(false);
|
|
22964
|
-
(0,
|
|
23010
|
+
(0, import_utils142.useLayoutEffect)(() => {
|
|
22965
23011
|
if (!elRef.current) return;
|
|
22966
23012
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
22967
23013
|
}, []);
|
|
@@ -22972,7 +23018,7 @@ function MaxLines({
|
|
|
22972
23018
|
if (!elRef.current) return;
|
|
22973
23019
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
22974
23020
|
}, [expanded]);
|
|
22975
|
-
(0,
|
|
23021
|
+
(0, import_utils142.useResizeObserver)({
|
|
22976
23022
|
ref: elRef,
|
|
22977
23023
|
onResize
|
|
22978
23024
|
});
|
|
@@ -22996,7 +23042,7 @@ function MaxLines({
|
|
|
22996
23042
|
var import_change_case8 = require("change-case");
|
|
22997
23043
|
|
|
22998
23044
|
// src/components/AppNav/AppNavGroup.tsx
|
|
22999
|
-
var
|
|
23045
|
+
var import_utils144 = require("@react-aria/utils");
|
|
23000
23046
|
var import_change_case7 = require("change-case");
|
|
23001
23047
|
var import_react130 = require("react");
|
|
23002
23048
|
|
|
@@ -23239,7 +23285,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
23239
23285
|
setContentHeight(`${contentEl.scrollHeight}px`);
|
|
23240
23286
|
}
|
|
23241
23287
|
}, [expanded, contentEl]);
|
|
23242
|
-
(0,
|
|
23288
|
+
(0, import_utils144.useResizeObserver)({
|
|
23243
23289
|
ref: contentRef,
|
|
23244
23290
|
onResize
|
|
23245
23291
|
});
|
|
@@ -23941,7 +23987,7 @@ function toPageNumberSize(page) {
|
|
|
23941
23987
|
}
|
|
23942
23988
|
|
|
23943
23989
|
// src/components/ScrollShadows.tsx
|
|
23944
|
-
var
|
|
23990
|
+
var import_utils153 = require("@react-aria/utils");
|
|
23945
23991
|
var import_react134 = require("react");
|
|
23946
23992
|
var import_runtime103 = require("@homebound/truss/runtime");
|
|
23947
23993
|
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
@@ -24030,7 +24076,7 @@ function ScrollShadows(props) {
|
|
|
24030
24076
|
setShowEndShadow(start + boxSize < end);
|
|
24031
24077
|
}, [horizontal]);
|
|
24032
24078
|
const onResize = (0, import_react134.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
24033
|
-
(0,
|
|
24079
|
+
(0, import_utils153.useResizeObserver)({
|
|
24034
24080
|
ref: scrollRef,
|
|
24035
24081
|
onResize
|
|
24036
24082
|
});
|
|
@@ -25018,7 +25064,7 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
25018
25064
|
}
|
|
25019
25065
|
|
|
25020
25066
|
// src/layouts/useMeasuredHeight.ts
|
|
25021
|
-
var
|
|
25067
|
+
var import_utils162 = require("@react-aria/utils");
|
|
25022
25068
|
var import_react142 = require("react");
|
|
25023
25069
|
function useMeasuredHeight(ref, enabled) {
|
|
25024
25070
|
const [height, setHeight] = (0, import_react142.useState)(0);
|
|
@@ -25027,7 +25073,7 @@ function useMeasuredHeight(ref, enabled) {
|
|
|
25027
25073
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
25028
25074
|
setHeight((prev) => prev === next ? prev : next);
|
|
25029
25075
|
}, [ref]);
|
|
25030
|
-
(0,
|
|
25076
|
+
(0, import_utils162.useResizeObserver)({ ref, onResize: syncElementHeight });
|
|
25031
25077
|
(0, import_react142.useLayoutEffect)(() => {
|
|
25032
25078
|
syncElementHeight();
|
|
25033
25079
|
}, [enabled, syncElementHeight]);
|
|
@@ -25265,7 +25311,6 @@ function PageHeaderLayout(props) {
|
|
|
25265
25311
|
EnvironmentBannerLayout,
|
|
25266
25312
|
ErrorMessage,
|
|
25267
25313
|
FieldGroup,
|
|
25268
|
-
FilterDropdownMenu,
|
|
25269
25314
|
FilterModal,
|
|
25270
25315
|
Filters,
|
|
25271
25316
|
FormDivider,
|