@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.js
CHANGED
|
@@ -1753,6 +1753,32 @@ var CssBuilder = class _CssBuilder {
|
|
|
1753
1753
|
position(value) {
|
|
1754
1754
|
return this.add("position", value);
|
|
1755
1755
|
}
|
|
1756
|
+
// scrollSnap
|
|
1757
|
+
/** Sets `scrollSnapAlign: value`. */
|
|
1758
|
+
ssa(value) {
|
|
1759
|
+
return this.add("scrollSnapAlign", value);
|
|
1760
|
+
}
|
|
1761
|
+
/** Sets `scrollSnapType: value`. */
|
|
1762
|
+
sst(value) {
|
|
1763
|
+
return this.add("scrollSnapType", value);
|
|
1764
|
+
}
|
|
1765
|
+
// scrollbarWidth
|
|
1766
|
+
/** Sets `scrollbarWidth: "auto"`. */
|
|
1767
|
+
get sbwa() {
|
|
1768
|
+
return this.add("scrollbarWidth", "auto");
|
|
1769
|
+
}
|
|
1770
|
+
/** Sets `scrollbarWidth: "thin"`. */
|
|
1771
|
+
get sbwt() {
|
|
1772
|
+
return this.add("scrollbarWidth", "thin");
|
|
1773
|
+
}
|
|
1774
|
+
/** Sets `scrollbarWidth: "none"`. */
|
|
1775
|
+
get sbwn() {
|
|
1776
|
+
return this.add("scrollbarWidth", "none");
|
|
1777
|
+
}
|
|
1778
|
+
/** Sets `scrollbarWidth: value`. */
|
|
1779
|
+
sbw(value) {
|
|
1780
|
+
return this.add("scrollbarWidth", value);
|
|
1781
|
+
}
|
|
1756
1782
|
// skins
|
|
1757
1783
|
/** Sets `color: "rgba(255, 255, 255, 1)"`. */
|
|
1758
1784
|
get white() {
|
|
@@ -19632,7 +19658,7 @@ function invertSpacing(value) {
|
|
|
19632
19658
|
|
|
19633
19659
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
19634
19660
|
import { useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
19635
|
-
import React17, { useCallback as useCallback27, useEffect as
|
|
19661
|
+
import React17, { useCallback as useCallback27, useEffect as useEffect28, useLayoutEffect as useLayoutEffect6, useMemo as useMemo40, useRef as useRef48, useState as useState46 } from "react";
|
|
19636
19662
|
|
|
19637
19663
|
// src/components/ButtonMenu.tsx
|
|
19638
19664
|
import { useRef as useRef46 } from "react";
|
|
@@ -19671,8 +19697,26 @@ function isSelectionButtonMenuProps(props) {
|
|
|
19671
19697
|
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
19672
19698
|
}
|
|
19673
19699
|
|
|
19674
|
-
// src/components/Filters/
|
|
19675
|
-
|
|
19700
|
+
// src/components/Filters/utils.tsx
|
|
19701
|
+
function getActiveFilterCount(filter) {
|
|
19702
|
+
return safeKeys(filter).filter((key) => isDefined(filter[key])).length;
|
|
19703
|
+
}
|
|
19704
|
+
function updateFilter(currentFilter, key, value) {
|
|
19705
|
+
if (value === void 0) {
|
|
19706
|
+
return omitKey(key, currentFilter);
|
|
19707
|
+
} else {
|
|
19708
|
+
return { ...currentFilter, [key]: value };
|
|
19709
|
+
}
|
|
19710
|
+
}
|
|
19711
|
+
var filterTestIdPrefix = "filter";
|
|
19712
|
+
|
|
19713
|
+
// src/components/Layout/layoutTypes.ts
|
|
19714
|
+
function isGridTableProps(props) {
|
|
19715
|
+
return "rows" in props;
|
|
19716
|
+
}
|
|
19717
|
+
|
|
19718
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
19719
|
+
import { memo as memo2, useMemo as useMemo38, useState as useState44 } from "react";
|
|
19676
19720
|
|
|
19677
19721
|
// src/components/CountBadge.tsx
|
|
19678
19722
|
import { trussProps as trussProps68, maybeCssVar as maybeCssVar41 } from "@homebound/truss/runtime";
|
|
@@ -19718,6 +19762,114 @@ function CountBadge(props) {
|
|
|
19718
19762
|
}), children: count });
|
|
19719
19763
|
}
|
|
19720
19764
|
|
|
19765
|
+
// src/components/Table/components/EditColumnsButton.tsx
|
|
19766
|
+
import { Fragment as Fragment29, useCallback as useCallback25, useMemo as useMemo36, useRef as useRef47 } from "react";
|
|
19767
|
+
import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
|
|
19768
|
+
import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
|
|
19769
|
+
import { trussProps as trussProps69 } from "@homebound/truss/runtime";
|
|
19770
|
+
import { jsx as jsx134, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
19771
|
+
function EditColumnsButton(props) {
|
|
19772
|
+
const {
|
|
19773
|
+
defaultOpen,
|
|
19774
|
+
disabled,
|
|
19775
|
+
columns,
|
|
19776
|
+
api
|
|
19777
|
+
} = props;
|
|
19778
|
+
const state = useMenuTriggerState3({
|
|
19779
|
+
isOpen: defaultOpen
|
|
19780
|
+
});
|
|
19781
|
+
const buttonRef = useRef47(null);
|
|
19782
|
+
const {
|
|
19783
|
+
menuTriggerProps
|
|
19784
|
+
} = useMenuTrigger3({
|
|
19785
|
+
isDisabled: !!disabled
|
|
19786
|
+
}, state, buttonRef);
|
|
19787
|
+
const tid = useTestIds(props, "columns");
|
|
19788
|
+
const {
|
|
19789
|
+
sm
|
|
19790
|
+
} = useBreakpoint();
|
|
19791
|
+
const options = useMemo36(() => columns.filter((column2) => column2.canHide).filter((column2) => {
|
|
19792
|
+
if (!column2.name || column2.name.length === 0 || !column2.id || column2.id.length === 0) {
|
|
19793
|
+
console.warn("Column is missing 'name' and/or 'id' property required by the Edit Columns button", column2);
|
|
19794
|
+
return false;
|
|
19795
|
+
}
|
|
19796
|
+
return true;
|
|
19797
|
+
}).map((column2) => ({
|
|
19798
|
+
label: column2.name,
|
|
19799
|
+
value: column2.id
|
|
19800
|
+
})), [columns]);
|
|
19801
|
+
const selectedValues = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
19802
|
+
const setSelectedValues = useCallback25((ids) => {
|
|
19803
|
+
api.resetColumnWidths();
|
|
19804
|
+
api.setVisibleColumns(columns.filter((column2) => column2.canHide ? ids.includes(column2.id) : true).map((c) => c.id));
|
|
19805
|
+
}, [columns, api]);
|
|
19806
|
+
const hasHiddenColumn = useMemo36(() => {
|
|
19807
|
+
const selectableOptionValues = options.map((option) => option.value);
|
|
19808
|
+
return selectableOptionValues.some((option) => !selectedValues.includes(option));
|
|
19809
|
+
}, [options, selectedValues]);
|
|
19810
|
+
return /* @__PURE__ */ jsx134(OverlayTrigger, { ...props, trigger: sm ? {
|
|
19811
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
19812
|
+
variant: "outline"
|
|
19813
|
+
} : {
|
|
19814
|
+
icon: hasHiddenColumn ? "columnsBadged" : "columns",
|
|
19815
|
+
label: "",
|
|
19816
|
+
size: "md",
|
|
19817
|
+
variant: "secondaryBlack"
|
|
19818
|
+
}, menuTriggerProps, state, buttonRef, ...tid, children: /* @__PURE__ */ jsxs68("div", { ...trussProps69({
|
|
19819
|
+
display: "df",
|
|
19820
|
+
flexDirection: "fdc",
|
|
19821
|
+
backgroundColor: ["bgColor_var", {
|
|
19822
|
+
"--backgroundColor": "var(--b-surface)"
|
|
19823
|
+
}],
|
|
19824
|
+
maxWidth: "maxw_326px",
|
|
19825
|
+
maxHeight: "maxh_512px",
|
|
19826
|
+
boxShadow: "h_bshHover"
|
|
19827
|
+
}), children: [
|
|
19828
|
+
/* @__PURE__ */ jsx134("div", { className: "dg gtc_1fr_auto gap2 pt2 pb2 pr2 pl2 fg1 mh0 oya", children: options.map((option) => /* @__PURE__ */ jsxs68(Fragment29, { children: [
|
|
19829
|
+
/* @__PURE__ */ jsx134("div", { className: "fw4 fz_14px lh_20px wsnw oh to_ellipsis pr1", children: option.label }),
|
|
19830
|
+
/* @__PURE__ */ jsx134(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}`] })
|
|
19831
|
+
] }, option.value)) }),
|
|
19832
|
+
/* @__PURE__ */ jsx134("div", { ...trussProps69({
|
|
19833
|
+
display: "df",
|
|
19834
|
+
justifyContent: "jcc",
|
|
19835
|
+
paddingTop: "pt2",
|
|
19836
|
+
paddingBottom: "pb2",
|
|
19837
|
+
paddingRight: "pr2",
|
|
19838
|
+
paddingLeft: "pl2",
|
|
19839
|
+
borderTopStyle: "bts_solid",
|
|
19840
|
+
borderTopWidth: "btw_1px",
|
|
19841
|
+
borderColor: ["bc_var", {
|
|
19842
|
+
"--borderColor": "var(--b-surface-separator)"
|
|
19843
|
+
}]
|
|
19844
|
+
}), children: /* @__PURE__ */ jsx134(Button, { variant: "tertiary", label: "Reset Column Widths", onClick: () => api.resetColumnWidths() }) })
|
|
19845
|
+
] }) });
|
|
19846
|
+
}
|
|
19847
|
+
|
|
19848
|
+
// src/components/Table/components/ViewToggleButton.tsx
|
|
19849
|
+
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
19850
|
+
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
19851
|
+
const { sm } = useBreakpoint();
|
|
19852
|
+
const tid = useTestIds({}, "viewToggleButton");
|
|
19853
|
+
const menuItems = [
|
|
19854
|
+
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
19855
|
+
{ label: "Card", icon: "tile", onClick: () => onChange("card") }
|
|
19856
|
+
];
|
|
19857
|
+
const icon = view === "list" ? "projects" : "tile";
|
|
19858
|
+
return /* @__PURE__ */ jsx135(
|
|
19859
|
+
ButtonMenu,
|
|
19860
|
+
{
|
|
19861
|
+
trigger: sm ? { icon, variant: "outline" } : { icon, label: "", size: "md", variant: "secondaryBlack" },
|
|
19862
|
+
items: menuItems,
|
|
19863
|
+
defaultOpen,
|
|
19864
|
+
...tid
|
|
19865
|
+
}
|
|
19866
|
+
);
|
|
19867
|
+
}
|
|
19868
|
+
|
|
19869
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
19870
|
+
import { useDebouncedCallback as useDebouncedCallback6 } from "use-debounce";
|
|
19871
|
+
import { StringParam as StringParam2, useQueryParams as useQueryParams3 } from "use-query-params";
|
|
19872
|
+
|
|
19721
19873
|
// src/components/Filters/BaseFilter.ts
|
|
19722
19874
|
var BaseFilter = class {
|
|
19723
19875
|
constructor(key, props) {
|
|
@@ -19736,7 +19888,7 @@ var BaseFilter = class {
|
|
|
19736
19888
|
};
|
|
19737
19889
|
|
|
19738
19890
|
// src/components/Filters/DateFilter.tsx
|
|
19739
|
-
import { Fragment as
|
|
19891
|
+
import { Fragment as Fragment30, jsx as jsx136, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
19740
19892
|
function dateFilter(props) {
|
|
19741
19893
|
return (key) => new DateFilter(key, props);
|
|
19742
19894
|
}
|
|
@@ -19758,10 +19910,10 @@ var DateFilter = class extends BaseFilter {
|
|
|
19758
19910
|
}
|
|
19759
19911
|
render(value, setValue, tid, inModal, vertical) {
|
|
19760
19912
|
const { label, operations, getOperationValue, getOperationLabel, defaultValue } = this.props;
|
|
19761
|
-
return /* @__PURE__ */
|
|
19762
|
-
vertical && /* @__PURE__ */
|
|
19763
|
-
/* @__PURE__ */
|
|
19764
|
-
/* @__PURE__ */
|
|
19913
|
+
return /* @__PURE__ */ jsxs69(Fragment30, { children: [
|
|
19914
|
+
vertical && /* @__PURE__ */ jsx136(Label, { label }),
|
|
19915
|
+
/* @__PURE__ */ jsxs69(CompoundField, { children: [
|
|
19916
|
+
/* @__PURE__ */ jsx136(
|
|
19765
19917
|
SelectField,
|
|
19766
19918
|
{
|
|
19767
19919
|
sizeToContent: true,
|
|
@@ -19783,7 +19935,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
19783
19935
|
...tid[`${defaultTestId(this.label)}_dateOperation`]
|
|
19784
19936
|
}
|
|
19785
19937
|
),
|
|
19786
|
-
/* @__PURE__ */
|
|
19938
|
+
/* @__PURE__ */ jsx136(
|
|
19787
19939
|
DateField,
|
|
19788
19940
|
{
|
|
19789
19941
|
labelStyle: "inline",
|
|
@@ -19807,7 +19959,7 @@ function isDateFilterValue(value) {
|
|
|
19807
19959
|
}
|
|
19808
19960
|
|
|
19809
19961
|
// src/components/Filters/DateRangeFilter.tsx
|
|
19810
|
-
import { Fragment as
|
|
19962
|
+
import { Fragment as Fragment31, jsx as jsx137, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
19811
19963
|
function dateRangeFilter(props) {
|
|
19812
19964
|
return (key) => new DateRangeFilter(key, props);
|
|
19813
19965
|
}
|
|
@@ -19829,9 +19981,9 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
19829
19981
|
}
|
|
19830
19982
|
render(value, setValue, tid, inModal, vertical) {
|
|
19831
19983
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
19832
|
-
return /* @__PURE__ */
|
|
19833
|
-
vertical && /* @__PURE__ */
|
|
19834
|
-
/* @__PURE__ */
|
|
19984
|
+
return /* @__PURE__ */ jsxs70(Fragment31, { children: [
|
|
19985
|
+
vertical && /* @__PURE__ */ jsx137(Label, { label }),
|
|
19986
|
+
/* @__PURE__ */ jsx137(
|
|
19835
19987
|
DateRangeField,
|
|
19836
19988
|
{
|
|
19837
19989
|
labelStyle: "inline",
|
|
@@ -19887,7 +20039,7 @@ function resolveNestedOptions(optionsOrLoad) {
|
|
|
19887
20039
|
}
|
|
19888
20040
|
|
|
19889
20041
|
// src/components/Filters/MultiFilter.tsx
|
|
19890
|
-
import { jsx as
|
|
20042
|
+
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
19891
20043
|
function multiFilter(props) {
|
|
19892
20044
|
return (key) => new MultiFilter(key, props);
|
|
19893
20045
|
}
|
|
@@ -19901,7 +20053,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
19901
20053
|
const { disabledOptions } = this.props;
|
|
19902
20054
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
19903
20055
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
19904
|
-
return /* @__PURE__ */
|
|
20056
|
+
return /* @__PURE__ */ jsx138(
|
|
19905
20057
|
ToggleChipGroup,
|
|
19906
20058
|
{
|
|
19907
20059
|
label: this.label,
|
|
@@ -19925,7 +20077,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
19925
20077
|
);
|
|
19926
20078
|
}
|
|
19927
20079
|
const { defaultValue, nothingSelectedText, ...props } = this.props;
|
|
19928
|
-
return /* @__PURE__ */
|
|
20080
|
+
return /* @__PURE__ */ jsx138(
|
|
19929
20081
|
MultiSelectField,
|
|
19930
20082
|
{
|
|
19931
20083
|
...props,
|
|
@@ -19944,7 +20096,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
19944
20096
|
};
|
|
19945
20097
|
|
|
19946
20098
|
// src/components/Filters/NumberRangeFilter.tsx
|
|
19947
|
-
import { Fragment as
|
|
20099
|
+
import { Fragment as Fragment32, jsx as jsx139, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
19948
20100
|
function numberRangeFilter(props) {
|
|
19949
20101
|
return (key) => new NumberRangeFilter(key, props);
|
|
19950
20102
|
}
|
|
@@ -19961,10 +20113,10 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
19961
20113
|
} = this.props;
|
|
19962
20114
|
const min = value?.min ?? void 0;
|
|
19963
20115
|
const max = value?.max ?? void 0;
|
|
19964
|
-
return /* @__PURE__ */
|
|
19965
|
-
vertical && /* @__PURE__ */
|
|
19966
|
-
/* @__PURE__ */
|
|
19967
|
-
/* @__PURE__ */
|
|
20116
|
+
return /* @__PURE__ */ jsxs71(Fragment32, { children: [
|
|
20117
|
+
vertical && /* @__PURE__ */ jsxs71("div", { ...tid, children: [
|
|
20118
|
+
/* @__PURE__ */ jsx139(Label, { label }),
|
|
20119
|
+
/* @__PURE__ */ jsx139("div", { className: "pb1", children: /* @__PURE__ */ jsx139(NumberField, { labelStyle: "inline", clearable: true, label: "Min", value: min, type: numberFieldType, numberFormatOptions, onChange: (minVal) => {
|
|
19968
20120
|
const maxValue = max ? {
|
|
19969
20121
|
max
|
|
19970
20122
|
} : {};
|
|
@@ -19973,7 +20125,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
19973
20125
|
...maxValue
|
|
19974
20126
|
} : void 0);
|
|
19975
20127
|
}, ...tid[`${defaultTestId(label)}_min_vertical`] }) }),
|
|
19976
|
-
/* @__PURE__ */
|
|
20128
|
+
/* @__PURE__ */ jsx139(NumberField, { labelStyle: "inline", clearable: true, label: "Max", value: max, type: numberFieldType, numberFormatOptions, onChange: (maxVal) => {
|
|
19977
20129
|
const minValue = min ? {
|
|
19978
20130
|
min
|
|
19979
20131
|
} : {};
|
|
@@ -19983,8 +20135,8 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
19983
20135
|
} : void 0);
|
|
19984
20136
|
}, ...tid[`${defaultTestId(label)}_max_vertical`] })
|
|
19985
20137
|
] }),
|
|
19986
|
-
!vertical && /* @__PURE__ */
|
|
19987
|
-
/* @__PURE__ */
|
|
20138
|
+
!vertical && /* @__PURE__ */ jsxs71(CompoundField, { ...tid, children: [
|
|
20139
|
+
/* @__PURE__ */ jsx139(
|
|
19988
20140
|
NumberField,
|
|
19989
20141
|
{
|
|
19990
20142
|
sizeToContent: !inModal,
|
|
@@ -20006,7 +20158,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20006
20158
|
...tid[`${defaultTestId(label)}_min`]
|
|
20007
20159
|
}
|
|
20008
20160
|
),
|
|
20009
|
-
/* @__PURE__ */
|
|
20161
|
+
/* @__PURE__ */ jsx139(NumberField, { sizeToContent: !inModal, labelStyle: "inline", clearable: true, label: !inModal ? `${label} Max` : "Max", value: max, type: numberFieldType, numberFormatOptions, onChange: (maxVal) => {
|
|
20010
20162
|
const minValue = min ? {
|
|
20011
20163
|
min
|
|
20012
20164
|
} : {};
|
|
@@ -20021,7 +20173,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
20021
20173
|
};
|
|
20022
20174
|
|
|
20023
20175
|
// src/components/Filters/SingleFilter.tsx
|
|
20024
|
-
import { jsx as
|
|
20176
|
+
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
20025
20177
|
function singleFilter(props) {
|
|
20026
20178
|
return (key) => new SingleFilter(key, props);
|
|
20027
20179
|
}
|
|
@@ -20042,7 +20194,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20042
20194
|
...props
|
|
20043
20195
|
} = this.props;
|
|
20044
20196
|
const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
|
|
20045
|
-
return /* @__PURE__ */
|
|
20197
|
+
return /* @__PURE__ */ jsx140(
|
|
20046
20198
|
SelectField,
|
|
20047
20199
|
{
|
|
20048
20200
|
...props,
|
|
@@ -20062,7 +20214,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
20062
20214
|
};
|
|
20063
20215
|
|
|
20064
20216
|
// src/components/Filters/TreeFilter.tsx
|
|
20065
|
-
import { jsx as
|
|
20217
|
+
import { jsx as jsx141 } from "react/jsx-runtime";
|
|
20066
20218
|
function treeFilter(props) {
|
|
20067
20219
|
return (key) => new TreeFilter(key, props);
|
|
20068
20220
|
}
|
|
@@ -20073,7 +20225,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20073
20225
|
}
|
|
20074
20226
|
render(value, setValue, tid, inModal, vertical) {
|
|
20075
20227
|
const { defaultValue, nothingSelectedText, filterBy = "root", ...props } = this.props;
|
|
20076
|
-
return /* @__PURE__ */
|
|
20228
|
+
return /* @__PURE__ */ jsx141(
|
|
20077
20229
|
TreeSelectField,
|
|
20078
20230
|
{
|
|
20079
20231
|
...props,
|
|
@@ -20093,7 +20245,7 @@ var TreeFilter = class extends BaseFilter {
|
|
|
20093
20245
|
};
|
|
20094
20246
|
|
|
20095
20247
|
// src/components/Filters/BooleanFilter.tsx
|
|
20096
|
-
import { jsx as
|
|
20248
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
20097
20249
|
function booleanFilter(props) {
|
|
20098
20250
|
return (key) => new BooleanFilter(key, props);
|
|
20099
20251
|
}
|
|
@@ -20105,7 +20257,7 @@ var BooleanFilter = class extends BaseFilter {
|
|
|
20105
20257
|
}
|
|
20106
20258
|
render(value, setValue, tid, inModal, vertical) {
|
|
20107
20259
|
const { options = defaultBooleanOptions, label, defaultValue, ...props } = this.props;
|
|
20108
|
-
return /* @__PURE__ */
|
|
20260
|
+
return /* @__PURE__ */ jsx142(
|
|
20109
20261
|
SelectField,
|
|
20110
20262
|
{
|
|
20111
20263
|
...props,
|
|
@@ -20132,7 +20284,7 @@ var defaultBooleanOptions = [
|
|
|
20132
20284
|
];
|
|
20133
20285
|
|
|
20134
20286
|
// src/components/Filters/CheckboxFilter.tsx
|
|
20135
|
-
import { jsx as
|
|
20287
|
+
import { jsx as jsx143 } from "react/jsx-runtime";
|
|
20136
20288
|
function checkboxFilter(props) {
|
|
20137
20289
|
return (key) => new CheckboxFilter(key, {
|
|
20138
20290
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20147,7 +20299,7 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
20147
20299
|
}
|
|
20148
20300
|
render(value, setValue, tid, inModal, vertical) {
|
|
20149
20301
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20150
|
-
return /* @__PURE__ */
|
|
20302
|
+
return /* @__PURE__ */ jsx143(
|
|
20151
20303
|
Checkbox,
|
|
20152
20304
|
{
|
|
20153
20305
|
...props,
|
|
@@ -20170,7 +20322,7 @@ import { useState as useState43 } from "react";
|
|
|
20170
20322
|
|
|
20171
20323
|
// src/components/Modal/OpenModal.tsx
|
|
20172
20324
|
import { useEffect as useEffect27 } from "react";
|
|
20173
|
-
import { jsx as
|
|
20325
|
+
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
20174
20326
|
function OpenModal(props) {
|
|
20175
20327
|
const { openModal } = useModal();
|
|
20176
20328
|
const { size, children, keepOpen } = props;
|
|
@@ -20180,15 +20332,15 @@ function OpenModal(props) {
|
|
|
20180
20332
|
}
|
|
20181
20333
|
}, [keepOpen, openModal, size, children]);
|
|
20182
20334
|
if (keepOpen) {
|
|
20183
|
-
return /* @__PURE__ */
|
|
20335
|
+
return /* @__PURE__ */ jsx144(Modal, { size, content: children });
|
|
20184
20336
|
} else {
|
|
20185
|
-
return /* @__PURE__ */
|
|
20337
|
+
return /* @__PURE__ */ jsx144("div", { children: "dummy content" });
|
|
20186
20338
|
}
|
|
20187
20339
|
}
|
|
20188
20340
|
|
|
20189
20341
|
// src/components/Filters/FilterModal.tsx
|
|
20190
|
-
import { trussProps as
|
|
20191
|
-
import { Fragment as
|
|
20342
|
+
import { trussProps as trussProps70 } from "@homebound/truss/runtime";
|
|
20343
|
+
import { Fragment as Fragment33, jsx as jsx145, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
20192
20344
|
function FilterModal(props) {
|
|
20193
20345
|
const {
|
|
20194
20346
|
filter,
|
|
@@ -20200,19 +20352,19 @@ function FilterModal(props) {
|
|
|
20200
20352
|
closeModal
|
|
20201
20353
|
} = useModal();
|
|
20202
20354
|
const [modalFilter, setModalFilter] = useState43(filter);
|
|
20203
|
-
return /* @__PURE__ */
|
|
20204
|
-
/* @__PURE__ */
|
|
20205
|
-
/* @__PURE__ */
|
|
20206
|
-
/* @__PURE__ */
|
|
20355
|
+
return /* @__PURE__ */ jsxs72(Fragment33, { children: [
|
|
20356
|
+
/* @__PURE__ */ jsx145(ModalHeader, { children: "More Filters" }),
|
|
20357
|
+
/* @__PURE__ */ jsx145(ModalBody, { children: /* @__PURE__ */ jsx145("div", { className: "df fdc", children: safeEntries(filters).map(([key, f]) => /* @__PURE__ */ jsx145(ModalFilterItem, { label: f.hideLabelInModal ? void 0 : f.label, children: f.render(modalFilter[key], (value) => setModalFilter(updateFilter(modalFilter, key, value)), testId, true, false) }, key)) }) }),
|
|
20358
|
+
/* @__PURE__ */ jsxs72(ModalFooter, { xss: {
|
|
20207
20359
|
justifyContent: "jcsb"
|
|
20208
20360
|
}, children: [
|
|
20209
|
-
/* @__PURE__ */
|
|
20361
|
+
/* @__PURE__ */ jsx145(Button, { label: "Clear", variant: "tertiary", disabled: safeKeys(filters).filter((fk) => modalFilter[fk] !== void 0).length === 0, onClick: () => (
|
|
20210
20362
|
// Only remove the filters keys that exist in the modal.
|
|
20211
20363
|
setModalFilter(safeKeys(filters).reduce((acc, fk) => omitKey(fk, acc), modalFilter))
|
|
20212
20364
|
), ...testId.modalClear }),
|
|
20213
|
-
/* @__PURE__ */
|
|
20214
|
-
/* @__PURE__ */
|
|
20215
|
-
/* @__PURE__ */
|
|
20365
|
+
/* @__PURE__ */ jsxs72("div", { className: "df gap1", children: [
|
|
20366
|
+
/* @__PURE__ */ jsx145(Button, { label: "Cancel", variant: "quaternary", onClick: closeModal, ...testId.modalClose }),
|
|
20367
|
+
/* @__PURE__ */ jsx145(Button, { label: "Apply", onClick: () => {
|
|
20216
20368
|
onApply(modalFilter);
|
|
20217
20369
|
closeModal();
|
|
20218
20370
|
}, ...testId.modalApply })
|
|
@@ -20224,7 +20376,7 @@ function ModalFilterItem({
|
|
|
20224
20376
|
label,
|
|
20225
20377
|
children
|
|
20226
20378
|
}) {
|
|
20227
|
-
return /* @__PURE__ */
|
|
20379
|
+
return /* @__PURE__ */ jsxs72("div", { ...trussProps70({
|
|
20228
20380
|
marginBottom: "mb4",
|
|
20229
20381
|
...!label ? {
|
|
20230
20382
|
borderTopStyle: "bts_solid",
|
|
@@ -20232,8 +20384,8 @@ function ModalFilterItem({
|
|
|
20232
20384
|
borderColor: "bcGray200"
|
|
20233
20385
|
} : {}
|
|
20234
20386
|
}), children: [
|
|
20235
|
-
label && /* @__PURE__ */
|
|
20236
|
-
/* @__PURE__ */
|
|
20387
|
+
label && /* @__PURE__ */ jsx145("h2", { className: "fw4 fz_16px lh_24px mb2", children: label }),
|
|
20388
|
+
/* @__PURE__ */ jsx145("div", { ...trussProps70({
|
|
20237
20389
|
...!label ? {
|
|
20238
20390
|
paddingTop: "pt3"
|
|
20239
20391
|
} : {}
|
|
@@ -20242,9 +20394,9 @@ function ModalFilterItem({
|
|
|
20242
20394
|
}
|
|
20243
20395
|
|
|
20244
20396
|
// src/components/Filters/Filters.tsx
|
|
20245
|
-
import { memo, useMemo as
|
|
20246
|
-
import { trussProps as
|
|
20247
|
-
import { jsx as
|
|
20397
|
+
import { memo, useMemo as useMemo37 } from "react";
|
|
20398
|
+
import { trussProps as trussProps71 } from "@homebound/truss/runtime";
|
|
20399
|
+
import { jsx as jsx146, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
20248
20400
|
function Filters(props) {
|
|
20249
20401
|
const {
|
|
20250
20402
|
filter,
|
|
@@ -20258,7 +20410,7 @@ function Filters(props) {
|
|
|
20258
20410
|
const {
|
|
20259
20411
|
openModal
|
|
20260
20412
|
} = useModal();
|
|
20261
|
-
const [pageFilters, modalFilters] =
|
|
20413
|
+
const [pageFilters, modalFilters] = useMemo37(() => {
|
|
20262
20414
|
const impls = safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]);
|
|
20263
20415
|
if (!vertical && impls.length > numberOfInlineFilters) {
|
|
20264
20416
|
return [Object.fromEntries(impls.slice(0, numberOfInlineFilters - 1)), Object.fromEntries(impls.slice(numberOfInlineFilters - 1))];
|
|
@@ -20266,8 +20418,8 @@ function Filters(props) {
|
|
|
20266
20418
|
return [Object.fromEntries(impls), {}];
|
|
20267
20419
|
}, [numberOfInlineFilters, vertical, filterDefs]);
|
|
20268
20420
|
const numModalFilters = safeKeys(modalFilters).filter((fk) => filter[fk] !== void 0).length;
|
|
20269
|
-
const maybeGroupByField = groupBy ? /* @__PURE__ */
|
|
20270
|
-
return /* @__PURE__ */
|
|
20421
|
+
const maybeGroupByField = groupBy ? /* @__PURE__ */ jsx146("div", { children: /* @__PURE__ */ jsx146(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;
|
|
20422
|
+
return /* @__PURE__ */ jsxs73("div", { ...trussProps71({
|
|
20271
20423
|
...vertical ? {
|
|
20272
20424
|
display: "df",
|
|
20273
20425
|
flexDirection: "fdc",
|
|
@@ -20279,18 +20431,18 @@ function Filters(props) {
|
|
|
20279
20431
|
}
|
|
20280
20432
|
}), ...testId, children: [
|
|
20281
20433
|
maybeGroupByField,
|
|
20282
|
-
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */
|
|
20283
|
-
Object.keys(modalFilters).length > 0 && /* @__PURE__ */
|
|
20434
|
+
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ jsx146("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, vertical) }, key)),
|
|
20435
|
+
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ jsx146(Button, { label: "More Filters", endAdornment: /* @__PURE__ */ jsx146(CountBadge, { count: numModalFilters, hideIfZero: true }), variant: "secondary", onClick: () => openModal({
|
|
20284
20436
|
// Spreading `props` to pass along `data-testid`
|
|
20285
|
-
content: /* @__PURE__ */
|
|
20437
|
+
content: /* @__PURE__ */ jsx146(FilterModal, { ...props, filter, onApply: onChange, filters: modalFilters })
|
|
20286
20438
|
}), ...testId.moreFiltersBtn }),
|
|
20287
|
-
Object.keys(filter).length > 0 && /* @__PURE__ */
|
|
20439
|
+
Object.keys(filter).length > 0 && /* @__PURE__ */ jsx146("div", { children: /* @__PURE__ */ jsx146(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn }) })
|
|
20288
20440
|
] });
|
|
20289
20441
|
}
|
|
20290
20442
|
var _Filters = memo(Filters);
|
|
20291
20443
|
|
|
20292
20444
|
// src/components/Filters/ToggleFilter.tsx
|
|
20293
|
-
import { jsx as
|
|
20445
|
+
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
20294
20446
|
function toggleFilter(props) {
|
|
20295
20447
|
return (key) => new ToggleFilter(key, {
|
|
20296
20448
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -20305,7 +20457,7 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20305
20457
|
}
|
|
20306
20458
|
render(value, setValue, tid, inModal, vertical) {
|
|
20307
20459
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
20308
|
-
return /* @__PURE__ */
|
|
20460
|
+
return /* @__PURE__ */ jsx147(
|
|
20309
20461
|
Switch,
|
|
20310
20462
|
{
|
|
20311
20463
|
...props,
|
|
@@ -20324,126 +20476,83 @@ var ToggleFilter = class extends BaseFilter {
|
|
|
20324
20476
|
}
|
|
20325
20477
|
};
|
|
20326
20478
|
|
|
20327
|
-
// src/components/
|
|
20328
|
-
|
|
20329
|
-
|
|
20330
|
-
|
|
20331
|
-
|
|
20332
|
-
if (value === void 0) {
|
|
20333
|
-
return omitKey(key, currentFilter);
|
|
20334
|
-
} else {
|
|
20335
|
-
return { ...currentFilter, [key]: value };
|
|
20336
|
-
}
|
|
20479
|
+
// src/components/Layout/GridTableLayout/FilterPanel.tsx
|
|
20480
|
+
import { trussProps as trussProps72 } from "@homebound/truss/runtime";
|
|
20481
|
+
import { jsx as jsx148, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
20482
|
+
function FilterPanel(props) {
|
|
20483
|
+
return props.isOpen ? /* @__PURE__ */ jsx148(FilterPanelOpen, { ...props }) : /* @__PURE__ */ jsx148(FilterPanelClosed, { ...props });
|
|
20337
20484
|
}
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
|
|
20341
|
-
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
const
|
|
20347
|
-
|
|
20348
|
-
|
|
20349
|
-
|
|
20350
|
-
|
|
20351
|
-
|
|
20352
|
-
|
|
20353
|
-
|
|
20354
|
-
|
|
20355
|
-
|
|
20356
|
-
|
|
20357
|
-
|
|
20358
|
-
|
|
20359
|
-
|
|
20360
|
-
|
|
20361
|
-
|
|
20362
|
-
|
|
20363
|
-
|
|
20364
|
-
|
|
20365
|
-
|
|
20366
|
-
|
|
20367
|
-
if (searchProps) {
|
|
20368
|
-
searchProps.onSearch(debouncedSearch);
|
|
20369
|
-
setQueryParams({
|
|
20370
|
-
search: debouncedSearch || void 0
|
|
20371
|
-
}, "replaceIn");
|
|
20372
|
-
}
|
|
20373
|
-
}, [debouncedSearch, searchProps, setQueryParams]);
|
|
20374
|
-
const hasSearch = !!searchProps;
|
|
20375
|
-
const hasFilters = !!filterDefs && Object.keys(filterDefs ?? {}).length > 0;
|
|
20376
|
-
const activeFilterCount = useMemo37(() => filter ? getActiveFilterCount(filter) : 0, [filter]);
|
|
20377
|
-
const filterImpls = useMemo37(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
20378
|
-
const renderFilters = () => {
|
|
20379
|
-
if (!filter || !onChange) return null;
|
|
20380
|
-
const entries = safeEntries(filterImpls);
|
|
20381
|
-
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
20382
|
-
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
20383
|
-
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ jsx146("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
20384
|
-
};
|
|
20385
|
-
const searchTextField = /* @__PURE__ */ jsx146(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => setSearchValue(v ?? ""), placeholder: "Search", clearable: true, startAdornment: /* @__PURE__ */ jsx146(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ }) });
|
|
20386
|
-
return /* @__PURE__ */ jsxs73(Fragment33, { children: [
|
|
20387
|
-
hasSearch && /* @__PURE__ */ jsx146("div", { ...trussProps71({
|
|
20388
|
-
width: "w_244px",
|
|
20389
|
-
...sm ? {
|
|
20390
|
-
position: "absolute",
|
|
20391
|
-
overflow: "oh",
|
|
20392
|
-
clip: "cli_inset_50",
|
|
20393
|
-
clipPath: "clp_none",
|
|
20394
|
-
border: "bd_0",
|
|
20395
|
-
height: "h_1px",
|
|
20396
|
-
margin: "m_neg1px",
|
|
20397
|
-
width: "w_1px",
|
|
20398
|
-
padding: "p_0",
|
|
20399
|
-
whiteSpace: "wsnw",
|
|
20400
|
-
opacity: "o0"
|
|
20401
|
-
} : {}
|
|
20402
|
-
}), children: searchTextField }),
|
|
20403
|
-
sm && hasSearch && /* @__PURE__ */ jsx146(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setSearchIsOpen(!searchIsOpen), active: searchIsOpen, ...testId.searchButton }),
|
|
20404
|
-
sm && hasFilters && /* @__PURE__ */ jsx146(IconButton, { variant: "outline", icon: activeFilterCount > 0 ? "filterBadged" : "filter", label: "Filter", active: isOpen, onClick: () => setIsOpen(!isOpen), ...testId.button }),
|
|
20405
|
-
!sm && hasFilters && /* @__PURE__ */ jsx146(Button, { label: "Filter", icon: "filter", size: "md", endAdornment: /* @__PURE__ */ jsxs73("div", { className: "df aic gap1", children: [
|
|
20406
|
-
activeFilterCount > 0 && /* @__PURE__ */ jsx146(CountBadge, { count: activeFilterCount }),
|
|
20407
|
-
/* @__PURE__ */ jsx146(Icon, { icon: isOpen ? "chevronUp" : "chevronDown" })
|
|
20408
|
-
] }), variant: "secondaryBlack", onClick: () => setIsOpen(!isOpen), active: isOpen, ...testId.button }),
|
|
20409
|
-
searchIsOpen && /* @__PURE__ */ jsx146("div", { ...trussProps71({
|
|
20410
|
-
width: "w100",
|
|
20411
|
-
...!sm ? {
|
|
20412
|
-
position: "absolute",
|
|
20413
|
-
overflow: "oh",
|
|
20414
|
-
clip: "cli_inset_50",
|
|
20415
|
-
clipPath: "clp_none",
|
|
20416
|
-
border: "bd_0",
|
|
20417
|
-
height: "h_1px",
|
|
20418
|
-
margin: "m_neg1px",
|
|
20419
|
-
width: "w_1px",
|
|
20420
|
-
padding: "p_0",
|
|
20421
|
-
whiteSpace: "wsnw",
|
|
20422
|
-
opacity: "o0"
|
|
20485
|
+
function FilterPanelOpen({
|
|
20486
|
+
groupBy,
|
|
20487
|
+
filterImpls,
|
|
20488
|
+
filter,
|
|
20489
|
+
setFilter,
|
|
20490
|
+
onClear
|
|
20491
|
+
}) {
|
|
20492
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20493
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20494
|
+
const activeFilterCount = getActiveFilterCount(filter ?? {});
|
|
20495
|
+
const filterControls = filter && setFilter ? buildFilterControls(filterImpls, filter, setFilter, tid) : null;
|
|
20496
|
+
return /* @__PURE__ */ jsxs74("div", { ...trussProps72({
|
|
20497
|
+
...{
|
|
20498
|
+
display: "df",
|
|
20499
|
+
alignItems: "aic",
|
|
20500
|
+
gap: "gap1",
|
|
20501
|
+
scrollbarWidth: "sbwn"
|
|
20502
|
+
},
|
|
20503
|
+
...{
|
|
20504
|
+
overflowX: "sm_oxa",
|
|
20505
|
+
minWidth: "sm_mw0"
|
|
20506
|
+
},
|
|
20507
|
+
...{
|
|
20508
|
+
flexWrap: "mdandup_fww"
|
|
20509
|
+
},
|
|
20510
|
+
...{
|
|
20511
|
+
...inDocumentScrollLayout ? {
|
|
20512
|
+
paddingLeft: "pl3",
|
|
20513
|
+
paddingRight: "pr3"
|
|
20423
20514
|
} : {}
|
|
20424
|
-
}
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
] }),
|
|
20430
|
-
hasFilters && !isOpen && filter && onChange && /* @__PURE__ */ jsx146(FilterChips, { filter, filterImpls, onChange, onClear: () => onChange({}), testId })
|
|
20515
|
+
}
|
|
20516
|
+
}), children: [
|
|
20517
|
+
groupBy && /* @__PURE__ */ jsx148(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) }),
|
|
20518
|
+
filterControls,
|
|
20519
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsx148(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20431
20520
|
] });
|
|
20432
20521
|
}
|
|
20433
|
-
function
|
|
20434
|
-
filter,
|
|
20522
|
+
function FilterPanelClosed({
|
|
20435
20523
|
filterImpls,
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20524
|
+
filter,
|
|
20525
|
+
setFilter,
|
|
20526
|
+
onClear
|
|
20439
20527
|
}) {
|
|
20440
|
-
const
|
|
20528
|
+
const tid = useTestIds({}, filterTestIdPrefix);
|
|
20529
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20530
|
+
if (!filter || !setFilter) return null;
|
|
20531
|
+
const chips = safeEntries(filterImpls).flatMap(([key, f]) => chipsForFilterKey(key, f, filter, setFilter, tid));
|
|
20441
20532
|
if (chips.length === 0) return null;
|
|
20442
|
-
return /* @__PURE__ */
|
|
20533
|
+
return /* @__PURE__ */ jsxs74("div", { ...trussProps72({
|
|
20534
|
+
display: "df",
|
|
20535
|
+
gap: "gap1",
|
|
20536
|
+
alignItems: "aic",
|
|
20537
|
+
minWidth: "mw0",
|
|
20538
|
+
flexWrap: "fww",
|
|
20539
|
+
...inDocumentScrollLayout ? {
|
|
20540
|
+
paddingLeft: "pl3"
|
|
20541
|
+
} : {}
|
|
20542
|
+
}), children: [
|
|
20443
20543
|
chips,
|
|
20444
|
-
/* @__PURE__ */
|
|
20544
|
+
/* @__PURE__ */ jsx148(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...tid.clearBtn })
|
|
20445
20545
|
] });
|
|
20446
20546
|
}
|
|
20547
|
+
function buildFilterControls(filterImpls, filter, setFilter, testId) {
|
|
20548
|
+
const entries = safeEntries(filterImpls);
|
|
20549
|
+
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
20550
|
+
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
20551
|
+
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ jsx148("div", { children: f.render(filter[key], (value) => setFilter(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
20552
|
+
}
|
|
20553
|
+
function buildFilterImpls(filterDefs) {
|
|
20554
|
+
return Object.fromEntries(safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]));
|
|
20555
|
+
}
|
|
20447
20556
|
function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
20448
20557
|
const value = filter[key];
|
|
20449
20558
|
if (!isDefined(value)) return [];
|
|
@@ -20453,143 +20562,90 @@ function chipsForFilterKey(key, f, filter, onChange, testId) {
|
|
|
20453
20562
|
if (!isDefined(label2)) return [];
|
|
20454
20563
|
const chipKey = `${String(key)}_${item}`;
|
|
20455
20564
|
const newArray = value.filter((v) => v !== item);
|
|
20456
|
-
return /* @__PURE__ */
|
|
20565
|
+
return /* @__PURE__ */ jsx148(ToggleChip, { text: label2, onClick: () => onChange(updateFilter(filter, key, newArray.length > 0 ? newArray : void 0)), ...testId[`chip_${chipKey}`] }, chipKey);
|
|
20457
20566
|
});
|
|
20458
20567
|
}
|
|
20459
20568
|
const label = f.formatSelectedFilterLabel(value);
|
|
20460
20569
|
if (!isDefined(label)) return [];
|
|
20461
|
-
return /* @__PURE__ */
|
|
20462
|
-
}
|
|
20463
|
-
function buildFilterImpls(filterDefs) {
|
|
20464
|
-
return Object.fromEntries(safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]));
|
|
20570
|
+
return /* @__PURE__ */ jsx148(ToggleChip, { text: label, onClick: () => onChange(updateFilter(filter, key, void 0)), ...testId[`chip_${String(key)}`] }, String(key));
|
|
20465
20571
|
}
|
|
20466
|
-
var _FilterDropdownMenu = memo2(FilterDropdownMenu);
|
|
20467
20572
|
|
|
20468
|
-
// src/components/
|
|
20469
|
-
import {
|
|
20470
|
-
import {
|
|
20471
|
-
|
|
20472
|
-
import { trussProps as trussProps72 } from "@homebound/truss/runtime";
|
|
20473
|
-
import { jsx as jsx147, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
20474
|
-
function EditColumnsButton(props) {
|
|
20573
|
+
// src/components/Layout/GridTableLayout/GridTableLayoutActions.tsx
|
|
20574
|
+
import { trussProps as trussProps73 } from "@homebound/truss/runtime";
|
|
20575
|
+
import { jsx as jsx149, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
20576
|
+
function GridTableLayoutActionsComponent(props) {
|
|
20475
20577
|
const {
|
|
20476
|
-
|
|
20477
|
-
|
|
20578
|
+
filter,
|
|
20579
|
+
setFilter,
|
|
20580
|
+
filterDefs,
|
|
20581
|
+
groupBy,
|
|
20582
|
+
searchProps,
|
|
20583
|
+
hasHideableColumns,
|
|
20478
20584
|
columns,
|
|
20479
|
-
api
|
|
20585
|
+
api,
|
|
20586
|
+
withCardView,
|
|
20587
|
+
view,
|
|
20588
|
+
setView
|
|
20480
20589
|
} = props;
|
|
20481
|
-
const
|
|
20482
|
-
isOpen: defaultOpen
|
|
20483
|
-
});
|
|
20484
|
-
const buttonRef = useRef47(null);
|
|
20485
|
-
const {
|
|
20486
|
-
menuTriggerProps
|
|
20487
|
-
} = useMenuTrigger3({
|
|
20488
|
-
isDisabled: !!disabled
|
|
20489
|
-
}, state, buttonRef);
|
|
20490
|
-
const tid = useTestIds(props, "columns");
|
|
20590
|
+
const testId = useTestIds(props, "gridTableLayoutActions");
|
|
20491
20591
|
const {
|
|
20492
20592
|
sm
|
|
20493
20593
|
} = useBreakpoint();
|
|
20494
|
-
const
|
|
20495
|
-
|
|
20496
|
-
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20504
|
-
|
|
20505
|
-
|
|
20506
|
-
|
|
20507
|
-
|
|
20508
|
-
|
|
20509
|
-
return /* @__PURE__ */ jsx147(OverlayTrigger, { ...props, trigger: {
|
|
20510
|
-
icon: "columns",
|
|
20511
|
-
size: "md",
|
|
20512
|
-
label: "",
|
|
20513
|
-
variant: "secondaryBlack"
|
|
20514
|
-
}, menuTriggerProps, state, buttonRef, hideEndAdornment: sm, ...tid, children: /* @__PURE__ */ jsxs74("div", { ...trussProps72({
|
|
20515
|
-
display: "df",
|
|
20516
|
-
flexDirection: "fdc",
|
|
20517
|
-
backgroundColor: ["bgColor_var", {
|
|
20518
|
-
"--backgroundColor": "var(--b-surface)"
|
|
20519
|
-
}],
|
|
20520
|
-
maxWidth: "maxw_326px",
|
|
20521
|
-
maxHeight: "maxh_512px",
|
|
20522
|
-
boxShadow: "h_bshHover"
|
|
20523
|
-
}), children: [
|
|
20524
|
-
/* @__PURE__ */ jsx147("div", { className: "dg gtc_1fr_auto gap2 pt2 pb2 pr2 pl2 fg1 mh0 oya", children: options.map((option) => /* @__PURE__ */ jsxs74(Fragment34, { children: [
|
|
20525
|
-
/* @__PURE__ */ jsx147("div", { className: "fw4 fz_14px lh_20px wsnw oh to_ellipsis pr1", children: option.label }),
|
|
20526
|
-
/* @__PURE__ */ jsx147(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}`] })
|
|
20527
|
-
] }, option.value)) }),
|
|
20528
|
-
/* @__PURE__ */ jsx147("div", { ...trussProps72({
|
|
20529
|
-
display: "df",
|
|
20530
|
-
justifyContent: "jcc",
|
|
20531
|
-
paddingTop: "pt2",
|
|
20532
|
-
paddingBottom: "pb2",
|
|
20533
|
-
paddingRight: "pr2",
|
|
20534
|
-
paddingLeft: "pl2",
|
|
20535
|
-
borderTopStyle: "bts_solid",
|
|
20536
|
-
borderTopWidth: "btw_1px",
|
|
20537
|
-
borderColor: ["bc_var", {
|
|
20538
|
-
"--borderColor": "var(--b-surface-separator)"
|
|
20539
|
-
}]
|
|
20540
|
-
}), children: /* @__PURE__ */ jsx147(Button, { variant: "tertiary", label: "Reset Column Widths", onClick: () => api.resetColumnWidths() }) })
|
|
20541
|
-
] }) });
|
|
20542
|
-
}
|
|
20543
|
-
|
|
20544
|
-
// src/components/Table/components/ViewToggleButton.tsx
|
|
20545
|
-
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
20546
|
-
function ViewToggleButton({ view, onChange, defaultOpen }) {
|
|
20547
|
-
const { sm } = useBreakpoint();
|
|
20548
|
-
const tid = useTestIds({}, "viewToggleButton");
|
|
20549
|
-
const menuItems = [
|
|
20550
|
-
{ label: "List", icon: "projects", onClick: () => onChange("list") },
|
|
20551
|
-
{ label: "Card", icon: "tile", onClick: () => onChange("card") }
|
|
20552
|
-
];
|
|
20553
|
-
return /* @__PURE__ */ jsx148(
|
|
20554
|
-
ButtonMenu,
|
|
20555
|
-
{
|
|
20556
|
-
trigger: { icon: view === "list" ? "projects" : "tile", label: "", size: "md", variant: "secondaryBlack" },
|
|
20557
|
-
items: menuItems,
|
|
20558
|
-
hideEndAdornment: sm,
|
|
20559
|
-
defaultOpen,
|
|
20560
|
-
...tid
|
|
20594
|
+
const inDocumentScrollLayout = useDocumentScrollLayout();
|
|
20595
|
+
const [showSearch, setShowSearch] = useState44(false);
|
|
20596
|
+
const [showFilters, setShowFilters] = useState44(false);
|
|
20597
|
+
const [{
|
|
20598
|
+
search: initialValue
|
|
20599
|
+
}, setQueryParams] = useQueryParams3({
|
|
20600
|
+
search: StringParam2
|
|
20601
|
+
});
|
|
20602
|
+
const [searchValue, setSearchValue] = useState44(initialValue || "");
|
|
20603
|
+
const handleSearchDebounced = useDebouncedCallback6((value) => {
|
|
20604
|
+
if (searchProps) {
|
|
20605
|
+
searchProps.onSearch(value);
|
|
20606
|
+
setQueryParams({
|
|
20607
|
+
search: value || void 0
|
|
20608
|
+
}, "replaceIn");
|
|
20561
20609
|
}
|
|
20562
|
-
);
|
|
20563
|
-
|
|
20564
|
-
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
20568
|
-
|
|
20569
|
-
|
|
20570
|
-
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
} = props;
|
|
20574
|
-
return /* @__PURE__ */ jsxs75("div", { ...trussProps73({
|
|
20575
|
-
...{
|
|
20610
|
+
}, 300);
|
|
20611
|
+
const hasSearch = !!searchProps;
|
|
20612
|
+
const hasFilters = !!filterDefs && Object.keys(filterDefs ?? {}).length > 0;
|
|
20613
|
+
const activeFilterCount = useMemo38(() => filter ? getActiveFilterCount(filter) : 0, [filter]);
|
|
20614
|
+
const filterImpls = useMemo38(() => filterDefs ? buildFilterImpls(filterDefs) : {}, [filterDefs]);
|
|
20615
|
+
const searchTextField = /* @__PURE__ */ jsx149(TextField, { label: "Search", labelStyle: "hidden", value: searchValue, onChange: (v) => {
|
|
20616
|
+
setSearchValue(v ?? "");
|
|
20617
|
+
handleSearchDebounced(v ?? "");
|
|
20618
|
+
}, placeholder: "Search", clearable: true, fullWidth: true, startAdornment: /* @__PURE__ */ jsx149(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ }) });
|
|
20619
|
+
return /* @__PURE__ */ jsxs75("div", { className: "df fdc gap1 pb2", children: [
|
|
20620
|
+
/* @__PURE__ */ jsxs75("div", { ...trussProps73({
|
|
20576
20621
|
display: "df",
|
|
20577
20622
|
gap: "gap1",
|
|
20578
|
-
alignItems: "aifs",
|
|
20579
20623
|
justifyContent: "jcsb",
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20624
|
+
paddingTop: "pt3",
|
|
20625
|
+
...inDocumentScrollLayout ? {
|
|
20626
|
+
paddingLeft: "pl3",
|
|
20627
|
+
paddingRight: "pr3"
|
|
20628
|
+
} : {}
|
|
20629
|
+
}), children: [
|
|
20630
|
+
/* @__PURE__ */ jsxs75("div", { className: "df gap1 aic", children: [
|
|
20631
|
+
!sm && hasSearch && /* @__PURE__ */ jsx149("div", { className: "w_244px", children: searchTextField }),
|
|
20632
|
+
sm && hasSearch && /* @__PURE__ */ jsx149(IconButton, { variant: "outline", icon: searchValue ? "searchBadged" : "search", label: "Search", onClick: () => setShowSearch(!showSearch), active: showSearch, ...testId.searchButton }),
|
|
20633
|
+
sm && hasFilters && /* @__PURE__ */ jsx149(IconButton, { variant: "outline", icon: activeFilterCount > 0 ? "filterBadged" : "filter", label: "Filter", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterSmallButton }),
|
|
20634
|
+
!sm && hasFilters && /* @__PURE__ */ jsx149(Button, { label: "Filter", icon: "filter", size: "md", endAdornment: /* @__PURE__ */ jsxs75("div", { className: "df aic gap1", children: [
|
|
20635
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsx149(CountBadge, { count: activeFilterCount }),
|
|
20636
|
+
/* @__PURE__ */ jsx149(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
|
|
20637
|
+
] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton })
|
|
20638
|
+
] }),
|
|
20639
|
+
(hasHideableColumns || withCardView) && /* @__PURE__ */ jsxs75("div", { className: "df gap1", children: [
|
|
20640
|
+
hasHideableColumns && view === "list" && columns && api && /* @__PURE__ */ jsx149(EditColumnsButton, { columns, api, tooltip: "Display columns" }),
|
|
20641
|
+
withCardView && view !== void 0 && setView && /* @__PURE__ */ jsx149(ViewToggleButton, { view, onChange: setView })
|
|
20642
|
+
] })
|
|
20643
|
+
] }),
|
|
20644
|
+
sm && showSearch && /* @__PURE__ */ jsx149("div", { className: "pl3 pr3", children: searchTextField }),
|
|
20645
|
+
hasFilters && /* @__PURE__ */ jsx149(FilterPanel, { isOpen: showFilters, groupBy, filterImpls, filter, setFilter, onClear: () => setFilter?.({}) })
|
|
20586
20646
|
] });
|
|
20587
20647
|
}
|
|
20588
|
-
|
|
20589
|
-
// src/components/Layout/layoutTypes.ts
|
|
20590
|
-
function isGridTableProps(props) {
|
|
20591
|
-
return "rows" in props;
|
|
20592
|
-
}
|
|
20648
|
+
var _GridTableLayoutActions = memo2(GridTableLayoutActionsComponent);
|
|
20593
20649
|
|
|
20594
20650
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
20595
20651
|
import { useMemo as useMemo39 } from "react";
|
|
@@ -20640,7 +20696,7 @@ var sizeToPixels2 = {
|
|
|
20640
20696
|
};
|
|
20641
20697
|
|
|
20642
20698
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
20643
|
-
import { Fragment as
|
|
20699
|
+
import { Fragment as Fragment34, jsx as jsx151, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
20644
20700
|
function QueryTable(props) {
|
|
20645
20701
|
const {
|
|
20646
20702
|
emptyFallback,
|
|
@@ -20664,7 +20720,7 @@ function QueryTable(props) {
|
|
|
20664
20720
|
}
|
|
20665
20721
|
function LoadingTable(props) {
|
|
20666
20722
|
const { columns } = props;
|
|
20667
|
-
return /* @__PURE__ */ jsxs76(
|
|
20723
|
+
return /* @__PURE__ */ jsxs76(Fragment34, { children: [
|
|
20668
20724
|
/* @__PURE__ */ jsx151(LoadingSkeleton, { rows: 1, columns: 1 }),
|
|
20669
20725
|
/* @__PURE__ */ jsx151(LoadingSkeleton, { rows: 5, columns: columns ?? 5 })
|
|
20670
20726
|
] });
|
|
@@ -20705,7 +20761,7 @@ function parseStoredTableView(raw) {
|
|
|
20705
20761
|
|
|
20706
20762
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
20707
20763
|
import { trussProps as trussProps75, maybeCssVar as maybeCssVar43 } from "@homebound/truss/runtime";
|
|
20708
|
-
import { Fragment as
|
|
20764
|
+
import { Fragment as Fragment35, jsx as jsx152, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
20709
20765
|
var __maybeInc15 = (inc) => {
|
|
20710
20766
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
20711
20767
|
};
|
|
@@ -20741,7 +20797,7 @@ function GridTableLayoutComponent(props) {
|
|
|
20741
20797
|
const tableWrapperRef = useRef48(null);
|
|
20742
20798
|
useSetTableActionsHeight(tableWrapperRef, tableActionsRef, inDocumentScrollLayout && showTableActions);
|
|
20743
20799
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
20744
|
-
|
|
20800
|
+
useEffect28(() => {
|
|
20745
20801
|
if (layoutState?.setVisibleColumnIds) {
|
|
20746
20802
|
layoutState.setVisibleColumnIds(visibleColumnIds);
|
|
20747
20803
|
}
|
|
@@ -20751,18 +20807,9 @@ function GridTableLayoutComponent(props) {
|
|
|
20751
20807
|
onSearch: layoutState.setSearchString
|
|
20752
20808
|
} : void 0, [layoutState?.search, layoutState?.setSearchString]);
|
|
20753
20809
|
const emptyState = useMemo40(() => composeEmptyState(tableProps, layoutState, layoutEmptyFallback), [layoutEmptyFallback, layoutState, tableProps]);
|
|
20754
|
-
const tableActionsEl = /* @__PURE__ */ jsx152(
|
|
20755
|
-
hasHideableColumns && view === "list" && /* @__PURE__ */ jsx152(EditColumnsButton, { columns, api, tooltip: "Display columns", ...tid.editColumnsButton }),
|
|
20756
|
-
withCardView && /* @__PURE__ */ jsx152(ViewToggleButton, { view, onChange: setView })
|
|
20757
|
-
] }), xss: {
|
|
20758
|
-
paddingTop: "pt3",
|
|
20759
|
-
...inDocumentScrollLayout ? {
|
|
20760
|
-
paddingLeft: "pl3",
|
|
20761
|
-
paddingRight: "pr3"
|
|
20762
|
-
} : {}
|
|
20763
|
-
}, children: layoutState && (layoutState.filterDefs || layoutState.search) && /* @__PURE__ */ jsx152(_FilterDropdownMenu, { filterDefs: layoutState.filterDefs, filter: layoutState.filter, onChange: layoutState.setFilter, groupBy: layoutState.groupBy, searchProps: filterSearchProps }) });
|
|
20810
|
+
const tableActionsEl = /* @__PURE__ */ jsx152(_GridTableLayoutActions, { filterDefs: layoutState?.filterDefs, filter: layoutState?.filter, setFilter: layoutState?.setFilter, groupBy: layoutState?.groupBy, searchProps: filterSearchProps, hasHideableColumns, columns, api, withCardView, view, setView });
|
|
20764
20811
|
const cardAs = withCardView && view === "card" ? "card" : void 0;
|
|
20765
|
-
const tableBody = /* @__PURE__ */ jsx152(
|
|
20812
|
+
const tableBody = /* @__PURE__ */ jsx152(Fragment35, { children: isGridTableProps(tableProps) ? /* @__PURE__ */ jsx152(GridTable, { ...tableProps, ...cardAs ? {
|
|
20766
20813
|
as: cardAs
|
|
20767
20814
|
} : {}, api, emptyState, filter: clientSearch, style: {
|
|
20768
20815
|
allWhite: true,
|
|
@@ -20773,7 +20820,7 @@ function GridTableLayoutComponent(props) {
|
|
|
20773
20820
|
allWhite: true,
|
|
20774
20821
|
roundedHeader: !inDocumentScrollLayout
|
|
20775
20822
|
}, stickyHeader: true, disableColumnResizing: false, visibleColumnsStorageKey, columnGutter: inDocumentScrollLayout }) });
|
|
20776
|
-
const tableScrollContent = /* @__PURE__ */ jsxs77(
|
|
20823
|
+
const tableScrollContent = /* @__PURE__ */ jsxs77(Fragment35, { children: [
|
|
20777
20824
|
showTableActions && /* @__PURE__ */ jsx152("div", { ref: tableActionsRef, ...trussProps75({
|
|
20778
20825
|
...inDocumentScrollLayout ? {
|
|
20779
20826
|
transition: "transitionTop",
|
|
@@ -20797,7 +20844,7 @@ function GridTableLayoutComponent(props) {
|
|
|
20797
20844
|
}), ...tid.stickyContent, children: tableActionsEl }),
|
|
20798
20845
|
inDocumentScrollLayout ? tableBody : /* @__PURE__ */ jsx152(ScrollableContent, { virtualized: isVirtualized, children: tableBody })
|
|
20799
20846
|
] });
|
|
20800
|
-
return /* @__PURE__ */ jsxs77(
|
|
20847
|
+
return /* @__PURE__ */ jsxs77(Fragment35, { children: [
|
|
20801
20848
|
pageTitle && /* @__PURE__ */ jsx152(Header2, { pageTitle, breadCrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu }),
|
|
20802
20849
|
/* @__PURE__ */ jsx152("div", { ref: tableWrapperRef, className: "display_contents", ...tid.tableWrapper, children: tableScrollContent })
|
|
20803
20850
|
] });
|
|
@@ -20976,9 +21023,9 @@ function useRightPaneContext() {
|
|
|
20976
21023
|
|
|
20977
21024
|
// src/components/Layout/RightPaneLayout/RightPaneLayout.tsx
|
|
20978
21025
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
20979
|
-
import { useEffect as
|
|
21026
|
+
import { useEffect as useEffect29 } from "react";
|
|
20980
21027
|
import { trussProps as trussProps76, maybeCssVar as maybeCssVar44 } from "@homebound/truss/runtime";
|
|
20981
|
-
import { Fragment as
|
|
21028
|
+
import { Fragment as Fragment36, jsx as jsx155, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
20982
21029
|
var __maybeInc16 = (inc) => {
|
|
20983
21030
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
20984
21031
|
};
|
|
@@ -20995,8 +21042,8 @@ function RightPaneLayout(props) {
|
|
|
20995
21042
|
clearPane,
|
|
20996
21043
|
closePane
|
|
20997
21044
|
} = useRightPaneContext();
|
|
20998
|
-
|
|
20999
|
-
return /* @__PURE__ */ jsx155("div", { className: "h100 df oxh", children: /* @__PURE__ */ jsxs78(
|
|
21045
|
+
useEffect29(() => closePane, [closePane]);
|
|
21046
|
+
return /* @__PURE__ */ jsx155("div", { className: "h100 df oxh", children: /* @__PURE__ */ jsxs78(Fragment36, { children: [
|
|
21000
21047
|
/* @__PURE__ */ jsx155("div", { ...trussProps76({
|
|
21001
21048
|
...{
|
|
21002
21049
|
width: ["w_var", {
|
|
@@ -21095,19 +21142,19 @@ function useRightPane() {
|
|
|
21095
21142
|
|
|
21096
21143
|
// src/components/Layout/ScrollableFooter.tsx
|
|
21097
21144
|
import { createPortal as createPortal5 } from "react-dom";
|
|
21098
|
-
import { Fragment as
|
|
21145
|
+
import { Fragment as Fragment37, jsx as jsx156 } from "react/jsx-runtime";
|
|
21099
21146
|
function ScrollableFooter(props) {
|
|
21100
21147
|
const { children } = props;
|
|
21101
21148
|
const { footerEl } = useScrollableParent();
|
|
21102
21149
|
if (!footerEl) {
|
|
21103
|
-
return /* @__PURE__ */ jsx156(
|
|
21150
|
+
return /* @__PURE__ */ jsx156(Fragment37, { children });
|
|
21104
21151
|
}
|
|
21105
|
-
return createPortal5(/* @__PURE__ */ jsx156(
|
|
21152
|
+
return createPortal5(/* @__PURE__ */ jsx156(Fragment37, { children }), footerEl);
|
|
21106
21153
|
}
|
|
21107
21154
|
|
|
21108
21155
|
// src/components/Layout/TableReviewLayout/TableReviewLayout.tsx
|
|
21109
21156
|
import { AnimatePresence as AnimatePresence4, motion as motion4 } from "framer-motion";
|
|
21110
|
-
import { useEffect as
|
|
21157
|
+
import { useEffect as useEffect30, useState as useState48 } from "react";
|
|
21111
21158
|
|
|
21112
21159
|
// src/components/Layout/TableReviewLayout/SidePanel.tsx
|
|
21113
21160
|
import { jsx as jsx157, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
@@ -21148,7 +21195,7 @@ function TableReviewLayout(props) {
|
|
|
21148
21195
|
} = props;
|
|
21149
21196
|
const tid = useTestIds(props, "tableReviewLayout");
|
|
21150
21197
|
const [isPanelVisible, setIsPanelVisible] = useState48(!!panelContent);
|
|
21151
|
-
|
|
21198
|
+
useEffect30(() => {
|
|
21152
21199
|
setIsPanelVisible(!!panelContent);
|
|
21153
21200
|
}, [panelContent]);
|
|
21154
21201
|
function handleClosePanel() {
|
|
@@ -22348,7 +22395,7 @@ function useResponsiveGrid(props) {
|
|
|
22348
22395
|
}
|
|
22349
22396
|
|
|
22350
22397
|
// src/components/Grid/useResponsiveGridItem.ts
|
|
22351
|
-
import { useContext as useContext23, useEffect as
|
|
22398
|
+
import { useContext as useContext23, useEffect as useEffect31, useMemo as useMemo47 } from "react";
|
|
22352
22399
|
var injectedResponsiveGridClasses = /* @__PURE__ */ new Set();
|
|
22353
22400
|
var responsiveGridStyleEl;
|
|
22354
22401
|
function useResponsiveGridItem(props) {
|
|
@@ -22378,7 +22425,7 @@ function useResponsiveGridItem(props) {
|
|
|
22378
22425
|
};
|
|
22379
22426
|
}
|
|
22380
22427
|
function useResponsiveGridItemStyle(className, cssText) {
|
|
22381
|
-
|
|
22428
|
+
useEffect31(
|
|
22382
22429
|
function() {
|
|
22383
22430
|
if (!className || !cssText || typeof document === "undefined") return;
|
|
22384
22431
|
if (!responsiveGridStyleEl) {
|
|
@@ -22487,7 +22534,7 @@ function HomeboundLogo(props) {
|
|
|
22487
22534
|
|
|
22488
22535
|
// src/components/MaxLines.tsx
|
|
22489
22536
|
import { useLayoutEffect as useLayoutEffect7, useResizeObserver as useResizeObserver7 } from "@react-aria/utils";
|
|
22490
|
-
import { useCallback as useCallback30, useEffect as
|
|
22537
|
+
import { useCallback as useCallback30, useEffect as useEffect32, useRef as useRef54, useState as useState50 } from "react";
|
|
22491
22538
|
import { trussProps as trussProps87, maybeCssVar as maybeCssVar49 } from "@homebound/truss/runtime";
|
|
22492
22539
|
import { jsx as jsx172, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
22493
22540
|
function MaxLines({
|
|
@@ -22501,7 +22548,7 @@ function MaxLines({
|
|
|
22501
22548
|
if (!elRef.current) return;
|
|
22502
22549
|
setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
22503
22550
|
}, []);
|
|
22504
|
-
|
|
22551
|
+
useEffect32(() => {
|
|
22505
22552
|
setExpanded(false);
|
|
22506
22553
|
}, [children]);
|
|
22507
22554
|
const onResize = useCallback30(() => {
|
|
@@ -22534,7 +22581,7 @@ import { camelCase as camelCase6 } from "change-case";
|
|
|
22534
22581
|
// src/components/AppNav/AppNavGroup.tsx
|
|
22535
22582
|
import { useResizeObserver as useResizeObserver8 } from "@react-aria/utils";
|
|
22536
22583
|
import { camelCase as camelCase5, kebabCase } from "change-case";
|
|
22537
|
-
import { useCallback as useCallback32, useEffect as
|
|
22584
|
+
import { useCallback as useCallback32, useEffect as useEffect33, useMemo as useMemo50, useState as useState52 } from "react";
|
|
22538
22585
|
|
|
22539
22586
|
// src/components/AppNav/AppNavGroupTrigger.tsx
|
|
22540
22587
|
import { useMemo as useMemo49, useRef as useRef55 } from "react";
|
|
@@ -22737,7 +22784,7 @@ function useAppNavGroupExpanded(linkGroup) {
|
|
|
22737
22784
|
|
|
22738
22785
|
// src/components/AppNav/AppNavGroup.tsx
|
|
22739
22786
|
import { trussProps as trussProps89, maybeCssVar as maybeCssVar50 } from "@homebound/truss/runtime";
|
|
22740
|
-
import { Fragment as
|
|
22787
|
+
import { Fragment as Fragment38, jsx as jsx174, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
22741
22788
|
var __maybeInc19 = (inc) => {
|
|
22742
22789
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
22743
22790
|
};
|
|
@@ -22748,7 +22795,7 @@ function AppNavGroupView(props) {
|
|
|
22748
22795
|
} = props;
|
|
22749
22796
|
const tid = useTestIds(props, "linkGroup");
|
|
22750
22797
|
if (panelCollapsed) {
|
|
22751
|
-
return /* @__PURE__ */ jsx174(
|
|
22798
|
+
return /* @__PURE__ */ jsx174(Fragment38, { children: appNavLinkGroupLinks(linkGroup).map((link) => /* @__PURE__ */ jsx174(NavLink, { variant: "side", ...link, iconOnly: !!link.icon, ...tid[`link_${camelCase5(link.label)}`] }, link.label)) });
|
|
22752
22799
|
}
|
|
22753
22800
|
return /* @__PURE__ */ jsx174(AppNavGroupDisclosure, { ...props });
|
|
22754
22801
|
}
|
|
@@ -22767,7 +22814,7 @@ function AppNavGroupDisclosure(props) {
|
|
|
22767
22814
|
current: contentEl
|
|
22768
22815
|
}), [contentEl]);
|
|
22769
22816
|
const [contentHeight, setContentHeight] = useState52(expanded ? "auto" : "0");
|
|
22770
|
-
|
|
22817
|
+
useEffect33(() => {
|
|
22771
22818
|
setContentHeight(expanded && contentEl ? `${contentEl.scrollHeight}px` : "0");
|
|
22772
22819
|
}, [expanded, contentEl]);
|
|
22773
22820
|
const onResize = useCallback32(() => {
|
|
@@ -22864,11 +22911,11 @@ function AppNavSectionView(props) {
|
|
|
22864
22911
|
}
|
|
22865
22912
|
|
|
22866
22913
|
// src/components/AppNav/AppNavItems.tsx
|
|
22867
|
-
import { Fragment as
|
|
22914
|
+
import { Fragment as Fragment39, jsx as jsx177 } from "react/jsx-runtime";
|
|
22868
22915
|
function AppNavItems(props) {
|
|
22869
22916
|
const { items, variant = "side", panelCollapsed = false } = props;
|
|
22870
22917
|
const tid = useTestIds(props, "appNav");
|
|
22871
|
-
return /* @__PURE__ */ jsx177(
|
|
22918
|
+
return /* @__PURE__ */ jsx177(Fragment39, { children: items.map((item, idx) => {
|
|
22872
22919
|
if (isAppNavLink(item)) {
|
|
22873
22920
|
return /* @__PURE__ */ jsx177(
|
|
22874
22921
|
NavLink,
|
|
@@ -22911,7 +22958,7 @@ function AppNavItems(props) {
|
|
|
22911
22958
|
|
|
22912
22959
|
// src/components/Navbar/NavbarMobileMenu.tsx
|
|
22913
22960
|
import { AnimatePresence as AnimatePresence5, motion as motion5 } from "framer-motion";
|
|
22914
|
-
import { useEffect as
|
|
22961
|
+
import { useEffect as useEffect34, useState as useState53 } from "react";
|
|
22915
22962
|
import { FocusScope as FocusScope5, usePreventScroll as usePreventScroll2 } from "react-aria";
|
|
22916
22963
|
import { createPortal as createPortal6 } from "react-dom";
|
|
22917
22964
|
import { useLocation } from "react-router-dom";
|
|
@@ -22929,7 +22976,7 @@ function useEnvironmentBannerLayoutHeight() {
|
|
|
22929
22976
|
|
|
22930
22977
|
// src/components/Navbar/NavbarMobileMenu.tsx
|
|
22931
22978
|
import { mergeProps as mergeProps28, maybeCssVar as maybeCssVar51 } from "@homebound/truss/runtime";
|
|
22932
|
-
import { Fragment as
|
|
22979
|
+
import { Fragment as Fragment40, jsx as jsx179, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
22933
22980
|
function NavbarMobileMenu(props) {
|
|
22934
22981
|
const {
|
|
22935
22982
|
items
|
|
@@ -22943,11 +22990,11 @@ function NavbarMobileMenu(props) {
|
|
|
22943
22990
|
usePreventScroll2({
|
|
22944
22991
|
isDisabled: !isOpen
|
|
22945
22992
|
});
|
|
22946
|
-
|
|
22993
|
+
useEffect34(() => {
|
|
22947
22994
|
setIsOpen(false);
|
|
22948
22995
|
}, [pathname, search]);
|
|
22949
22996
|
const close = () => setIsOpen(false);
|
|
22950
|
-
return /* @__PURE__ */ jsxs91(
|
|
22997
|
+
return /* @__PURE__ */ jsxs91(Fragment40, { children: [
|
|
22951
22998
|
/* @__PURE__ */ jsx179(IconButton, { icon: isOpen ? "menuClose" : "menu", color: "--b-on-surface-muted" /* OnSurfaceMuted */, label: isOpen ? "Close navigation" : "Open navigation", onClick: () => setIsOpen((open) => !open), ...tid.mobileMenu }),
|
|
22952
22999
|
createPortal6(/* @__PURE__ */ jsx179(ContrastScope, { children: /* @__PURE__ */ jsx179(AnimatePresence5, { children: isOpen && /* @__PURE__ */ jsx179(NavbarMobileDrawer, { items, onClose: close, tid }) }) }), document.body)
|
|
22953
23000
|
] });
|
|
@@ -22961,7 +23008,7 @@ function NavbarMobileDrawer({
|
|
|
22961
23008
|
const overlayTopStyle = {
|
|
22962
23009
|
top: bannerHeightPx
|
|
22963
23010
|
};
|
|
22964
|
-
return /* @__PURE__ */ jsxs91(
|
|
23011
|
+
return /* @__PURE__ */ jsxs91(Fragment40, { children: [
|
|
22965
23012
|
/* @__PURE__ */ jsx179(motion5.div, { ...mergeProps28(void 0, overlayTopStyle, {
|
|
22966
23013
|
position: "fixed",
|
|
22967
23014
|
right: "right0",
|
|
@@ -23105,17 +23152,17 @@ function NavbarUserMenu({
|
|
|
23105
23152
|
|
|
23106
23153
|
// src/components/Tabs.tsx
|
|
23107
23154
|
import { camelCase as camelCase7 } from "change-case";
|
|
23108
|
-
import { useEffect as
|
|
23155
|
+
import { useEffect as useEffect35, useMemo as useMemo51, useRef as useRef56, useState as useState54 } from "react";
|
|
23109
23156
|
import { mergeProps as mergeProps29, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
|
|
23110
23157
|
import { matchPath } from "react-router";
|
|
23111
23158
|
import { Link as Link6, useLocation as useLocation2 } from "react-router-dom";
|
|
23112
23159
|
import { trussProps as trussProps92, maybeCssVar as maybeCssVar52 } from "@homebound/truss/runtime";
|
|
23113
|
-
import { Fragment as
|
|
23160
|
+
import { Fragment as Fragment41, jsx as jsx181, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
23114
23161
|
function TabsWithContent(props) {
|
|
23115
23162
|
const styles = hideTabs(props) ? {} : {
|
|
23116
23163
|
paddingTop: "pt3"
|
|
23117
23164
|
};
|
|
23118
|
-
return /* @__PURE__ */ jsxs93(
|
|
23165
|
+
return /* @__PURE__ */ jsxs93(Fragment41, { children: [
|
|
23119
23166
|
/* @__PURE__ */ jsx181(Tabs, { ...props }),
|
|
23120
23167
|
/* @__PURE__ */ jsx181(TabContent, { ...props, contentXss: {
|
|
23121
23168
|
...styles,
|
|
@@ -23168,7 +23215,7 @@ function Tabs(props) {
|
|
|
23168
23215
|
const tid = useTestIds(others, "tabs");
|
|
23169
23216
|
const [active, setActive] = useState54(selected);
|
|
23170
23217
|
const ref = useRef56(null);
|
|
23171
|
-
|
|
23218
|
+
useEffect35(() => setActive(selected), [selected]);
|
|
23172
23219
|
function onKeyUp(e) {
|
|
23173
23220
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
23174
23221
|
const nextTabValue = getNextTabValue(active, e.key, tabs);
|
|
@@ -23264,7 +23311,7 @@ function TabImpl(props) {
|
|
|
23264
23311
|
onClick: () => onClick(tab.value)
|
|
23265
23312
|
}
|
|
23266
23313
|
});
|
|
23267
|
-
const tabLabel = /* @__PURE__ */ jsxs93(
|
|
23314
|
+
const tabLabel = /* @__PURE__ */ jsxs93(Fragment41, { children: [
|
|
23268
23315
|
label,
|
|
23269
23316
|
(icon || endAdornment) && /* @__PURE__ */ jsx181("span", { className: "ml1", children: icon ? /* @__PURE__ */ jsx181(Icon, { icon }) : endAdornment })
|
|
23270
23317
|
] });
|
|
@@ -23618,7 +23665,7 @@ import {
|
|
|
23618
23665
|
createContext as createContext14,
|
|
23619
23666
|
useCallback as useCallback34,
|
|
23620
23667
|
useContext as useContext26,
|
|
23621
|
-
useEffect as
|
|
23668
|
+
useEffect as useEffect36,
|
|
23622
23669
|
useMemo as useMemo53,
|
|
23623
23670
|
useRef as useRef58,
|
|
23624
23671
|
useState as useState56
|
|
@@ -23652,7 +23699,7 @@ function SideNavLayoutProvider(props) {
|
|
|
23652
23699
|
);
|
|
23653
23700
|
const bp = useBreakpoint();
|
|
23654
23701
|
const prevMdAndUp = useRef58(bp.mdAndUp);
|
|
23655
|
-
|
|
23702
|
+
useEffect36(() => {
|
|
23656
23703
|
if (prevMdAndUp.current && !bp.mdAndUp) {
|
|
23657
23704
|
setNavStateInternal((prev) => prev === "expanded" ? "collapse" : prev);
|
|
23658
23705
|
}
|
|
@@ -23737,7 +23784,7 @@ function SideNav(props) {
|
|
|
23737
23784
|
}
|
|
23738
23785
|
|
|
23739
23786
|
// src/components/Snackbar/useSnackbar.tsx
|
|
23740
|
-
import { useCallback as useCallback35, useEffect as
|
|
23787
|
+
import { useCallback as useCallback35, useEffect as useEffect37 } from "react";
|
|
23741
23788
|
function useSnackbar() {
|
|
23742
23789
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
23743
23790
|
const onClose = useCallback35(
|
|
@@ -23787,7 +23834,7 @@ function useSnackbar() {
|
|
|
23787
23834
|
[onClose, setNotices]
|
|
23788
23835
|
);
|
|
23789
23836
|
const closeNotice = useCallback35((id) => onClose(id), [onClose]);
|
|
23790
|
-
const useSnackbarOffset = ({ bottom }) =>
|
|
23837
|
+
const useSnackbarOffset = ({ bottom }) => useEffect37(() => {
|
|
23791
23838
|
setOffset({ bottom });
|
|
23792
23839
|
return () => setOffset({});
|
|
23793
23840
|
}, [bottom]);
|
|
@@ -24023,14 +24070,14 @@ function isStructuredProps(props) {
|
|
|
24023
24070
|
}
|
|
24024
24071
|
|
|
24025
24072
|
// src/components/SuperDrawer/ConfirmCloseModal.tsx
|
|
24026
|
-
import { Fragment as
|
|
24073
|
+
import { Fragment as Fragment42, jsx as jsx189, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
24027
24074
|
function ConfirmCloseModal(props) {
|
|
24028
24075
|
const { onClose, discardText = "Discard Changes", continueText = "Continue Editing" } = props;
|
|
24029
24076
|
const { modalState } = useBeamContext();
|
|
24030
24077
|
function closeModal() {
|
|
24031
24078
|
modalState.current = void 0;
|
|
24032
24079
|
}
|
|
24033
|
-
return /* @__PURE__ */ jsxs100(
|
|
24080
|
+
return /* @__PURE__ */ jsxs100(Fragment42, { children: [
|
|
24034
24081
|
/* @__PURE__ */ jsx189(ModalHeader, { children: "Are you sure you want to cancel?" }),
|
|
24035
24082
|
/* @__PURE__ */ jsx189(ModalBody, { children: /* @__PURE__ */ jsx189("p", { children: "Any changes you've made so far will be lost." }) }),
|
|
24036
24083
|
/* @__PURE__ */ jsxs100(ModalFooter, { children: [
|
|
@@ -24183,7 +24230,7 @@ function canClose(canCloseCheck) {
|
|
|
24183
24230
|
|
|
24184
24231
|
// src/components/SuperDrawer/SuperDrawerContent.tsx
|
|
24185
24232
|
import { mergeProps as mergeProps30 } from "@homebound/truss/runtime";
|
|
24186
|
-
import { Fragment as
|
|
24233
|
+
import { Fragment as Fragment43, jsx as jsx191, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
24187
24234
|
var SuperDrawerContent = ({
|
|
24188
24235
|
children,
|
|
24189
24236
|
actions
|
|
@@ -24242,7 +24289,7 @@ var SuperDrawerContent = ({
|
|
|
24242
24289
|
}) }, "content");
|
|
24243
24290
|
}
|
|
24244
24291
|
}
|
|
24245
|
-
return /* @__PURE__ */ jsxs101(
|
|
24292
|
+
return /* @__PURE__ */ jsxs101(Fragment43, { children: [
|
|
24246
24293
|
wrapWithMotionAndMaybeBack(children),
|
|
24247
24294
|
actions && /* @__PURE__ */ jsx191("footer", { className: "bts_solid btw_1px bcGray200 pt3 pb3 pr3 pl3 df aic jcfe", children: /* @__PURE__ */ jsx191("div", { className: "df gap1", children: actions.map((buttonProps, i) => /* @__PURE__ */ jsx191(Button, { ...buttonProps }, i)) }) })
|
|
24248
24295
|
] });
|
|
@@ -24808,7 +24855,6 @@ export {
|
|
|
24808
24855
|
EnvironmentBannerLayout,
|
|
24809
24856
|
ErrorMessage,
|
|
24810
24857
|
FieldGroup,
|
|
24811
|
-
_FilterDropdownMenu as FilterDropdownMenu,
|
|
24812
24858
|
FilterModal,
|
|
24813
24859
|
_Filters as Filters,
|
|
24814
24860
|
FormDivider,
|