@homebound/beam 3.2.0-alpha.2 → 3.2.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/index.cjs +153 -373
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -60
- package/dist/index.d.ts +47 -60
- package/dist/index.js +293 -512
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -4902,7 +4902,7 @@ function Chips(props) {
|
|
|
4902
4902
|
// src/components/Table/GridTable.tsx
|
|
4903
4903
|
import memoizeOne from "memoize-one";
|
|
4904
4904
|
import { runInAction } from "mobx";
|
|
4905
|
-
import React13, { useEffect as useEffect19, useMemo as useMemo24, useRef as
|
|
4905
|
+
import React13, { useEffect as useEffect19, useMemo as useMemo24, useRef as useRef38, useState as useState29 } from "react";
|
|
4906
4906
|
import { Virtuoso as Virtuoso2 } from "react-virtuoso";
|
|
4907
4907
|
|
|
4908
4908
|
// src/components/Layout/ScrollableContent.tsx
|
|
@@ -5482,50 +5482,27 @@ function useHover2(props) {
|
|
|
5482
5482
|
}
|
|
5483
5483
|
|
|
5484
5484
|
// src/hooks/usePersistedFilter.ts
|
|
5485
|
-
import { useEffect as useEffect6, useMemo as useMemo8
|
|
5485
|
+
import { useEffect as useEffect6, useMemo as useMemo8 } from "react";
|
|
5486
5486
|
import { JsonParam, useQueryParams as useQueryParams2 } from "use-query-params";
|
|
5487
5487
|
function usePersistedFilter({ storageKey, filterDefs }) {
|
|
5488
|
-
const
|
|
5489
|
-
() => Object.fromEntries(safeEntries(filterDefs).map(([key, def]) => [key, def(key)])),
|
|
5490
|
-
[filterDefs]
|
|
5491
|
-
);
|
|
5492
|
-
const filterKeys = useMemo8(() => Object.keys(filterImpls), [filterImpls]);
|
|
5488
|
+
const filterKeys = Object.keys(filterDefs);
|
|
5493
5489
|
const defaultFilter = useMemo8(
|
|
5494
5490
|
() => Object.fromEntries(
|
|
5495
|
-
safeEntries(
|
|
5491
|
+
safeEntries(filterDefs).filter(([key, def]) => def(key).defaultValue !== void 0).map(([key, def]) => [key, def(key).defaultValue])
|
|
5496
5492
|
),
|
|
5497
|
-
[
|
|
5493
|
+
[filterDefs]
|
|
5498
5494
|
);
|
|
5499
5495
|
const [{ filter: queryParamsFilter }, setQueryParams] = useQueryParams2({ filter: JsonParam });
|
|
5500
|
-
const [storedFilter, setStoredFilter] = useSessionStorage(
|
|
5501
|
-
storageKey,
|
|
5502
|
-
dehydrateFilter(filterImpls, defaultFilter) ?? defaultFilter
|
|
5503
|
-
);
|
|
5496
|
+
const [storedFilter, setStoredFilter] = useSessionStorage(storageKey, queryParamsFilter ?? defaultFilter);
|
|
5504
5497
|
const isQueryParamFilterValid = hasValidFilterKeys(queryParamsFilter, filterKeys);
|
|
5505
|
-
const
|
|
5506
|
-
const
|
|
5507
|
-
const queryParamsFilterSnapshot = useMemo8(
|
|
5508
|
-
() => parseSerializedValue(serializedQueryParamsFilter),
|
|
5509
|
-
[serializedQueryParamsFilter]
|
|
5510
|
-
);
|
|
5511
|
-
const storedFilterSnapshot = useMemo8(() => parseSerializedValue(serializedStoredFilter), [serializedStoredFilter]);
|
|
5512
|
-
const hydratedQueryParamsFilter = useMemo8(
|
|
5513
|
-
() => isQueryParamFilterValid ? hydrateFilter(filterImpls, queryParamsFilterSnapshot) : void 0,
|
|
5514
|
-
[filterImpls, isQueryParamFilterValid, queryParamsFilterSnapshot]
|
|
5515
|
-
);
|
|
5516
|
-
const hydratedStoredFilter = useMemo8(
|
|
5517
|
-
() => hasValidFilterKeys(storedFilterSnapshot, filterKeys) ? hydrateFilter(filterImpls, storedFilterSnapshot) : void 0,
|
|
5518
|
-
[filterImpls, filterKeys, storedFilterSnapshot]
|
|
5519
|
-
);
|
|
5520
|
-
const rawFilter = hydratedQueryParamsFilter ?? hydratedStoredFilter ?? defaultFilter;
|
|
5521
|
-
const filter = useStableValue(rawFilter);
|
|
5522
|
-
const setFilter = (filter2) => setQueryParams({ filter: dehydrateFilter(filterImpls, filter2) });
|
|
5498
|
+
const filter = isQueryParamFilterValid ? queryParamsFilter : storedFilter ?? defaultFilter;
|
|
5499
|
+
const setFilter = (filter2) => setQueryParams({ filter: filter2 });
|
|
5523
5500
|
useEffect6(
|
|
5524
5501
|
() => {
|
|
5525
5502
|
if (queryParamsFilter === void 0) {
|
|
5526
5503
|
setQueryParams({ filter: storedFilter }, "replaceIn");
|
|
5527
5504
|
} else if (!isQueryParamFilterValid) {
|
|
5528
|
-
setQueryParams({ filter:
|
|
5505
|
+
setQueryParams({ filter: defaultFilter }, "replaceIn");
|
|
5529
5506
|
} else if (JSON.stringify(queryParamsFilter) !== JSON.stringify(storedFilter)) {
|
|
5530
5507
|
setStoredFilter(queryParamsFilter);
|
|
5531
5508
|
}
|
|
@@ -5537,46 +5514,7 @@ function usePersistedFilter({ storageKey, filterDefs }) {
|
|
|
5537
5514
|
return { setFilter, filter };
|
|
5538
5515
|
}
|
|
5539
5516
|
function hasValidFilterKeys(queryParamsFilter, definedKeys) {
|
|
5540
|
-
return
|
|
5541
|
-
}
|
|
5542
|
-
function hydrateFilter(filterImpls, value) {
|
|
5543
|
-
if (typeof value !== "object" || value === null) return void 0;
|
|
5544
|
-
const hydratedEntries = [];
|
|
5545
|
-
safeEntries(value).forEach(([key, rawValue]) => {
|
|
5546
|
-
const filter = filterImpls[key];
|
|
5547
|
-
if (!filter) return;
|
|
5548
|
-
const hydratedValue = filter.hydrate ? filter.hydrate(rawValue) : rawValue;
|
|
5549
|
-
if (hydratedValue !== void 0) {
|
|
5550
|
-
hydratedEntries.push([key, hydratedValue]);
|
|
5551
|
-
}
|
|
5552
|
-
});
|
|
5553
|
-
return Object.fromEntries(hydratedEntries);
|
|
5554
|
-
}
|
|
5555
|
-
function dehydrateFilter(filterImpls, value) {
|
|
5556
|
-
if (!value) return value;
|
|
5557
|
-
return Object.fromEntries(
|
|
5558
|
-
safeEntries(value).map(([key, rawValue]) => {
|
|
5559
|
-
const filter = filterImpls[key];
|
|
5560
|
-
return [
|
|
5561
|
-
key,
|
|
5562
|
-
// Let each filter own serialization so persisted state stays stable for non-plain JSON values like PlainDate.
|
|
5563
|
-
filter?.dehydrate ? filter.dehydrate(rawValue) : rawValue
|
|
5564
|
-
];
|
|
5565
|
-
})
|
|
5566
|
-
);
|
|
5567
|
-
}
|
|
5568
|
-
function parseSerializedValue(value) {
|
|
5569
|
-
return value === void 0 ? void 0 : JSON.parse(value);
|
|
5570
|
-
}
|
|
5571
|
-
function useStableValue(value) {
|
|
5572
|
-
const stableValue = useRef6(value);
|
|
5573
|
-
const stableKey = useRef6(JSON.stringify(value));
|
|
5574
|
-
const nextKey = JSON.stringify(value);
|
|
5575
|
-
if (stableKey.current !== nextKey) {
|
|
5576
|
-
stableValue.current = value;
|
|
5577
|
-
stableKey.current = nextKey;
|
|
5578
|
-
}
|
|
5579
|
-
return stableValue.current;
|
|
5517
|
+
return queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
|
|
5580
5518
|
}
|
|
5581
5519
|
|
|
5582
5520
|
// src/hooks/useSessionStorage.ts
|
|
@@ -5999,122 +5937,21 @@ function CollapseToggle(props) {
|
|
|
5999
5937
|
import { useContext as useContext12 } from "react";
|
|
6000
5938
|
|
|
6001
5939
|
// src/inputs/Autocomplete.tsx
|
|
6002
|
-
import { useCallback as useCallback10, useRef as
|
|
5940
|
+
import { useCallback as useCallback10, useRef as useRef23 } from "react";
|
|
6003
5941
|
import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition5 } from "react-aria";
|
|
6004
5942
|
import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stately";
|
|
6005
5943
|
|
|
6006
5944
|
// src/components/internal/DatePicker/DatePicker.tsx
|
|
6007
5945
|
import { DayPicker } from "react-day-picker";
|
|
6008
5946
|
|
|
6009
|
-
// src/utils/plainDate.ts
|
|
6010
|
-
import { Temporal } from "temporal-polyfill";
|
|
6011
|
-
function jsDateToPlainDate(date) {
|
|
6012
|
-
return new Temporal.PlainDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
6013
|
-
}
|
|
6014
|
-
function formatPlainDate(date, format) {
|
|
6015
|
-
switch (format) {
|
|
6016
|
-
case "shortDate":
|
|
6017
|
-
return date.toLocaleString("en-US", { month: "2-digit", day: "2-digit", year: "2-digit" });
|
|
6018
|
-
case "date":
|
|
6019
|
-
return date.toLocaleString("en-US", { month: "2-digit", day: "2-digit", year: "numeric" });
|
|
6020
|
-
case "shortWeekdayMonthDay":
|
|
6021
|
-
return date.toLocaleString("en-US", { weekday: "short", month: "short", day: "numeric" });
|
|
6022
|
-
case "longWeekdayMonthDayYear":
|
|
6023
|
-
return `${date.toLocaleString("en-US", { weekday: "long" })} ${date.toLocaleString("en-US", { month: "long" })} ${date.day}, ${formatYear(date.year)}`;
|
|
6024
|
-
case "monthYear":
|
|
6025
|
-
return date.toLocaleString("en-US", { month: "long", year: "numeric" });
|
|
6026
|
-
case "shortMonth":
|
|
6027
|
-
return date.toLocaleString("en-US", { month: "short" });
|
|
6028
|
-
case "year":
|
|
6029
|
-
return formatYear(date.year);
|
|
6030
|
-
case "weekdayInitial":
|
|
6031
|
-
return date.toLocaleString("en-US", { weekday: "narrow" });
|
|
6032
|
-
case "weekday":
|
|
6033
|
-
return date.toLocaleString("en-US", { weekday: "long" });
|
|
6034
|
-
default:
|
|
6035
|
-
throw new Error(`Unsupported date format: ${format}`);
|
|
6036
|
-
}
|
|
6037
|
-
}
|
|
6038
|
-
function todayPlainDate() {
|
|
6039
|
-
return Temporal.Now.plainDateISO();
|
|
6040
|
-
}
|
|
6041
|
-
function isPlainDate(value) {
|
|
6042
|
-
return value instanceof Temporal.PlainDate;
|
|
6043
|
-
}
|
|
6044
|
-
function parsePersistedPlainDate(value) {
|
|
6045
|
-
if (isPlainDate(value)) return value;
|
|
6046
|
-
if (value instanceof Date && !Number.isNaN(value.getTime())) {
|
|
6047
|
-
return jsDateToPlainDate(value);
|
|
6048
|
-
}
|
|
6049
|
-
if (typeof value !== "string") return void 0;
|
|
6050
|
-
try {
|
|
6051
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
6052
|
-
return Temporal.PlainDate.from(value);
|
|
6053
|
-
}
|
|
6054
|
-
} catch {
|
|
6055
|
-
return void 0;
|
|
6056
|
-
}
|
|
6057
|
-
const date = new Date(value);
|
|
6058
|
-
return Number.isNaN(date.getTime()) ? void 0 : jsDateToPlainDate(date);
|
|
6059
|
-
}
|
|
6060
|
-
function dehydratePlainDate(value) {
|
|
6061
|
-
return value?.toString();
|
|
6062
|
-
}
|
|
6063
|
-
function padNumber(value, length) {
|
|
6064
|
-
return Math.abs(value).toString().padStart(length, "0");
|
|
6065
|
-
}
|
|
6066
|
-
function formatYear(year) {
|
|
6067
|
-
return `${year < 0 ? "-" : ""}${padNumber(year, 4)}`;
|
|
6068
|
-
}
|
|
6069
|
-
|
|
6070
|
-
// src/components/internal/DatePicker/dates.ts
|
|
6071
|
-
function plainDateToJsDate(date) {
|
|
6072
|
-
return new Date(date.year, date.month - 1, date.day, 12);
|
|
6073
|
-
}
|
|
6074
|
-
function dateRangeToJsDateRange(range) {
|
|
6075
|
-
if (!range) return void 0;
|
|
6076
|
-
return {
|
|
6077
|
-
from: range.from ? plainDateToJsDate(range.from) : void 0,
|
|
6078
|
-
to: range.to ? plainDateToJsDate(range.to) : void 0
|
|
6079
|
-
};
|
|
6080
|
-
}
|
|
6081
|
-
function jsDateRangeToDateRange(range) {
|
|
6082
|
-
if (!range) return void 0;
|
|
6083
|
-
return {
|
|
6084
|
-
from: range.from ? jsDateToPlainDate(range.from) : void 0,
|
|
6085
|
-
to: range.to ? jsDateToPlainDate(range.to) : void 0
|
|
6086
|
-
};
|
|
6087
|
-
}
|
|
6088
|
-
function dateMatcherToDayPickerMatcher(matcher) {
|
|
6089
|
-
if (typeof matcher === "function") {
|
|
6090
|
-
return function dayPickerMatcher(date) {
|
|
6091
|
-
return matcher(jsDateToPlainDate(date));
|
|
6092
|
-
};
|
|
6093
|
-
}
|
|
6094
|
-
if (Array.isArray(matcher)) {
|
|
6095
|
-
return matcher.map(plainDateToJsDate);
|
|
6096
|
-
}
|
|
6097
|
-
if (isPlainDate(matcher)) {
|
|
6098
|
-
return plainDateToJsDate(matcher);
|
|
6099
|
-
}
|
|
6100
|
-
return {
|
|
6101
|
-
from: matcher.from ? plainDateToJsDate(matcher.from) : void 0,
|
|
6102
|
-
to: matcher.to ? plainDateToJsDate(matcher.to) : void 0
|
|
6103
|
-
};
|
|
6104
|
-
}
|
|
6105
|
-
function dateMatchersToDayPickerMatchers(matchers) {
|
|
6106
|
-
if (matchers === void 0) return void 0;
|
|
6107
|
-
return Array.isArray(matchers) ? matchers.map(dateMatcherToDayPickerMatcher) : dateMatcherToDayPickerMatcher(matchers);
|
|
6108
|
-
}
|
|
6109
|
-
|
|
6110
5947
|
// src/components/internal/DatePicker/Day.tsx
|
|
6111
|
-
import { useRef as
|
|
5948
|
+
import { useRef as useRef6 } from "react";
|
|
6112
5949
|
import { useDayRender } from "react-day-picker";
|
|
6113
5950
|
import { trussProps as trussProps12, mergeProps as mergeProps3 } from "@homebound/truss/runtime";
|
|
6114
5951
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
6115
5952
|
function Day(props) {
|
|
6116
5953
|
const tid = useTestIds(props, "datePickerDay");
|
|
6117
|
-
const buttonRef =
|
|
5954
|
+
const buttonRef = useRef6(null);
|
|
6118
5955
|
const {
|
|
6119
5956
|
isHidden,
|
|
6120
5957
|
isButton,
|
|
@@ -6241,19 +6078,18 @@ var rangeBaseStyles = {
|
|
|
6241
6078
|
};
|
|
6242
6079
|
|
|
6243
6080
|
// src/components/internal/DatePicker/Header.tsx
|
|
6244
|
-
import { addMonths, addYears } from "date-fns";
|
|
6081
|
+
import { addMonths, addYears, format } from "date-fns";
|
|
6245
6082
|
import { useNavigation } from "react-day-picker";
|
|
6246
6083
|
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6247
6084
|
function Header(props) {
|
|
6248
6085
|
const {
|
|
6249
6086
|
displayMonth
|
|
6250
6087
|
} = props;
|
|
6251
|
-
const displayMonthDate = jsDateToPlainDate(displayMonth);
|
|
6252
6088
|
const {
|
|
6253
6089
|
goToMonth
|
|
6254
6090
|
} = useNavigation();
|
|
6255
6091
|
return /* @__PURE__ */ jsxs10("div", { className: "df jcsb aic ml_12px mr_2px h_32px", children: [
|
|
6256
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6092
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: format(displayMonth, "MMMM yyyy") }),
|
|
6257
6093
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
6258
6094
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addMonths(displayMonth, -1)) }),
|
|
6259
6095
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addMonths(displayMonth, 1)) })
|
|
@@ -6264,41 +6100,36 @@ function YearSkipHeader(props) {
|
|
|
6264
6100
|
const {
|
|
6265
6101
|
displayMonth
|
|
6266
6102
|
} = props;
|
|
6267
|
-
const displayMonthDate = jsDateToPlainDate(displayMonth);
|
|
6268
6103
|
const {
|
|
6269
6104
|
goToMonth
|
|
6270
6105
|
} = useNavigation();
|
|
6271
6106
|
return /* @__PURE__ */ jsxs10("div", { className: "df jcsb aic ml_12px mr_12px h_32px", children: [
|
|
6272
6107
|
/* @__PURE__ */ jsxs10("div", { className: "df fdr jcsb", children: [
|
|
6273
6108
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addMonths(displayMonth, -1)) }),
|
|
6274
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6109
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: format(displayMonth, "MMM") }),
|
|
6275
6110
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addMonths(displayMonth, 1)) })
|
|
6276
6111
|
] }),
|
|
6277
6112
|
/* @__PURE__ */ jsxs10("div", { className: "df fdr jcsb", children: [
|
|
6278
6113
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addYears(displayMonth, -1)) }),
|
|
6279
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6114
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: format(displayMonth, "yyyy") }),
|
|
6280
6115
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addYears(displayMonth, 1)) })
|
|
6281
6116
|
] })
|
|
6282
6117
|
] });
|
|
6283
6118
|
}
|
|
6284
6119
|
|
|
6285
6120
|
// src/components/internal/DatePicker/WeekHeader.tsx
|
|
6121
|
+
import { addDays, format as format2, startOfWeek } from "date-fns";
|
|
6286
6122
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6287
6123
|
function WeekHeader() {
|
|
6288
|
-
const
|
|
6289
|
-
const start = today.subtract({
|
|
6290
|
-
days: today.dayOfWeek % 7
|
|
6291
|
-
});
|
|
6124
|
+
const start = startOfWeek(/* @__PURE__ */ new Date());
|
|
6292
6125
|
const days = [];
|
|
6293
6126
|
for (let i = 0; i < 7; i++) {
|
|
6294
|
-
days.push(start
|
|
6295
|
-
days: i
|
|
6296
|
-
}));
|
|
6127
|
+
days.push(addDays(start, i));
|
|
6297
6128
|
}
|
|
6298
6129
|
return /* @__PURE__ */ jsx18("thead", { className: "rdp-head", children: /* @__PURE__ */ jsx18("tr", { className: "rdp-head_row", children: days.map((day) => /* @__PURE__ */ jsxs11("th", { scope: "col", className: "pt1 pb_12px pr1 pl1 fw4 fz_12px lh_16px gray400", children: [
|
|
6299
|
-
/* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children:
|
|
6300
|
-
/* @__PURE__ */ jsx18("span", { className: "rdp-vhidden", children:
|
|
6301
|
-
] },
|
|
6130
|
+
/* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: format2(day, "EEEEE") }),
|
|
6131
|
+
/* @__PURE__ */ jsx18("span", { className: "rdp-vhidden", children: format2(day, "EEEE") })
|
|
6132
|
+
] }, format2(day, "EEEE"))) }) });
|
|
6302
6133
|
}
|
|
6303
6134
|
|
|
6304
6135
|
// src/components/internal/DatePicker/DatePicker.tsx
|
|
@@ -6320,15 +6151,15 @@ function DatePicker(props) {
|
|
|
6320
6151
|
Head: WeekHeader,
|
|
6321
6152
|
Day
|
|
6322
6153
|
},
|
|
6323
|
-
selected: value ? [
|
|
6324
|
-
defaultMonth:
|
|
6154
|
+
selected: value ? [value] : [],
|
|
6155
|
+
defaultMonth: value ?? /* @__PURE__ */ new Date(),
|
|
6325
6156
|
onDayClick: (day, modifiers) => {
|
|
6326
6157
|
if (modifiers.disabled) return;
|
|
6327
|
-
onSelect(
|
|
6158
|
+
onSelect(day);
|
|
6328
6159
|
},
|
|
6329
|
-
disabled:
|
|
6160
|
+
disabled: disabledDays,
|
|
6330
6161
|
modifiers: {
|
|
6331
|
-
indicatorDot:
|
|
6162
|
+
indicatorDot: dottedDays ?? []
|
|
6332
6163
|
}
|
|
6333
6164
|
}
|
|
6334
6165
|
) });
|
|
@@ -6355,21 +6186,21 @@ function DateRangePicker(props) {
|
|
|
6355
6186
|
useYearPicker
|
|
6356
6187
|
} = props;
|
|
6357
6188
|
const tid = useTestIds(props, "datePicker");
|
|
6358
|
-
return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected:
|
|
6189
|
+
return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected: range, components: {
|
|
6359
6190
|
Caption: useYearPicker ? YearSkipHeader : Header,
|
|
6360
6191
|
Head: WeekHeader,
|
|
6361
6192
|
Day
|
|
6362
|
-
}, defaultMonth:
|
|
6193
|
+
}, defaultMonth: range?.to ?? /* @__PURE__ */ new Date(), onSelect: (selection, day, activeModifiers) => {
|
|
6363
6194
|
if (activeModifiers.disabled) return;
|
|
6364
|
-
onSelect(
|
|
6365
|
-
}, disabled:
|
|
6366
|
-
indicatorDot:
|
|
6195
|
+
onSelect(selection);
|
|
6196
|
+
}, disabled: disabledDays, modifiers: {
|
|
6197
|
+
indicatorDot: dottedDays ?? []
|
|
6367
6198
|
} }) });
|
|
6368
6199
|
}
|
|
6369
6200
|
|
|
6370
6201
|
// src/components/internal/Menu.tsx
|
|
6371
6202
|
import { camelCase } from "change-case";
|
|
6372
|
-
import { useEffect as useEffect8, useMemo as useMemo9, useRef as
|
|
6203
|
+
import { useEffect as useEffect8, useMemo as useMemo9, useRef as useRef10, useState as useState11 } from "react";
|
|
6373
6204
|
import { FocusScope, useFilter as useFilter2, useMenu } from "react-aria";
|
|
6374
6205
|
import { Item, Section, useTreeData, useTreeState } from "react-stately";
|
|
6375
6206
|
|
|
@@ -6414,7 +6245,7 @@ import { trussProps as trussProps21 } from "@homebound/truss/runtime";
|
|
|
6414
6245
|
|
|
6415
6246
|
// src/inputs/internal/MenuSearchField.tsx
|
|
6416
6247
|
import { useTextField } from "@react-aria/textfield";
|
|
6417
|
-
import { useRef as
|
|
6248
|
+
import { useRef as useRef9 } from "react";
|
|
6418
6249
|
|
|
6419
6250
|
// src/inputs/TextFieldBase.tsx
|
|
6420
6251
|
import { useState as useState10 } from "react";
|
|
@@ -6513,7 +6344,7 @@ function InlineLabel({
|
|
|
6513
6344
|
|
|
6514
6345
|
// src/components/Table/components/Row.tsx
|
|
6515
6346
|
import { observer } from "mobx-react";
|
|
6516
|
-
import React6, { useCallback as useCallback6, useContext as useContext10, useRef as
|
|
6347
|
+
import React6, { useCallback as useCallback6, useContext as useContext10, useRef as useRef8 } from "react";
|
|
6517
6348
|
import { mergeProps as mergeProps5 } from "react-aria";
|
|
6518
6349
|
|
|
6519
6350
|
// src/components/Table/components/cell.tsx
|
|
@@ -6579,7 +6410,7 @@ var rowClickRenderFn = (as, api, colSpan) => (key, css2, content, row, rowStyle,
|
|
|
6579
6410
|
};
|
|
6580
6411
|
|
|
6581
6412
|
// src/components/Table/components/ColumnResizeHandle.tsx
|
|
6582
|
-
import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as
|
|
6413
|
+
import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as useRef7, useState as useState9 } from "react";
|
|
6583
6414
|
import { trussProps as trussProps16 } from "@homebound/truss/runtime";
|
|
6584
6415
|
import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6585
6416
|
function findScrollableParent(element) {
|
|
@@ -6617,13 +6448,13 @@ function ColumnResizeHandle({
|
|
|
6617
6448
|
const [guideLineX, setGuideLineX] = useState9(null);
|
|
6618
6449
|
const [guideLineTop, setGuideLineTop] = useState9(0);
|
|
6619
6450
|
const [guideLineHeight, setGuideLineHeight] = useState9(0);
|
|
6620
|
-
const startXRef =
|
|
6621
|
-
const startWidthRef =
|
|
6622
|
-
const startHandleRightRef =
|
|
6623
|
-
const handleRef =
|
|
6624
|
-
const rafRef =
|
|
6625
|
-
const pendingMouseXRef =
|
|
6626
|
-
const scrollableParentRef =
|
|
6451
|
+
const startXRef = useRef7(0);
|
|
6452
|
+
const startWidthRef = useRef7(0);
|
|
6453
|
+
const startHandleRightRef = useRef7(0);
|
|
6454
|
+
const handleRef = useRef7(null);
|
|
6455
|
+
const rafRef = useRef7(null);
|
|
6456
|
+
const pendingMouseXRef = useRef7(null);
|
|
6457
|
+
const scrollableParentRef = useRef7(null);
|
|
6627
6458
|
const tid = useTestIds({}, "columnResizeHandle");
|
|
6628
6459
|
const handleMouseDown = useCallback5((e) => {
|
|
6629
6460
|
e.preventDefault();
|
|
@@ -7765,7 +7596,7 @@ function RowImpl(props) {
|
|
|
7765
7596
|
let foundFirstContentColumn = false;
|
|
7766
7597
|
let minStickyLeftOffset = 0;
|
|
7767
7598
|
let expandColumnHidden = false;
|
|
7768
|
-
const ref =
|
|
7599
|
+
const ref = useRef8(null);
|
|
7769
7600
|
const dragOverCallback = useCallback6((row2, evt) => onDragOver?.(row2, evt), [onDragOver]);
|
|
7770
7601
|
const onDragOverDebounced = useDebouncedCallback2(dragOverCallback, 100);
|
|
7771
7602
|
const RowContent = () => /* @__PURE__ */ jsx28(RowTag, { ...mergeProps_12(BorderHoverParent, void 0, rowCss), ...others, "data-gridrow": true, ...getCount(row.id), ref, children: isKeptGroupRow ? /* @__PURE__ */ jsx28(KeptGroupRow, { as, style, columnSizes, row, colSpan: columns.length, isLastBodyRow }) : columns.map((column2, columnIndex) => {
|
|
@@ -8531,7 +8362,7 @@ var textFieldBaseMultilineTopPadding = 11;
|
|
|
8531
8362
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
8532
8363
|
function MenuSearchField(props) {
|
|
8533
8364
|
const tid = useTestIds(props);
|
|
8534
|
-
const inputRef =
|
|
8365
|
+
const inputRef = useRef9(null);
|
|
8535
8366
|
const { labelProps, inputProps } = useTextField({ ...props }, inputRef);
|
|
8536
8367
|
return /* @__PURE__ */ jsx31(
|
|
8537
8368
|
TextFieldBase,
|
|
@@ -8615,7 +8446,7 @@ function Menu(props) {
|
|
|
8615
8446
|
keys !== "all" && onChange && onChange([...keys.values()].map((k) => k.toString())[0]);
|
|
8616
8447
|
}
|
|
8617
8448
|
});
|
|
8618
|
-
const menuRef =
|
|
8449
|
+
const menuRef = useRef10(null);
|
|
8619
8450
|
const {
|
|
8620
8451
|
menuProps
|
|
8621
8452
|
} = useMenu({
|
|
@@ -8657,7 +8488,7 @@ function Menu(props) {
|
|
|
8657
8488
|
}
|
|
8658
8489
|
|
|
8659
8490
|
// src/components/internal/MenuItem.tsx
|
|
8660
|
-
import { useRef as
|
|
8491
|
+
import { useRef as useRef13 } from "react";
|
|
8661
8492
|
import { useHover as useHover7, useMenuItem } from "react-aria";
|
|
8662
8493
|
import { useHistory } from "react-router";
|
|
8663
8494
|
import { Link as Link3 } from "react-router-dom";
|
|
@@ -8912,12 +8743,12 @@ var pressedOverlayCss = {
|
|
|
8912
8743
|
};
|
|
8913
8744
|
|
|
8914
8745
|
// src/components/ButtonModal.tsx
|
|
8915
|
-
import { useRef as
|
|
8746
|
+
import { useRef as useRef12 } from "react";
|
|
8916
8747
|
import { useMenuTrigger } from "react-aria";
|
|
8917
8748
|
import { useMenuTriggerState } from "react-stately";
|
|
8918
8749
|
|
|
8919
8750
|
// src/components/internal/OverlayTrigger.tsx
|
|
8920
|
-
import { useMemo as useMemo13, useRef as
|
|
8751
|
+
import { useMemo as useMemo13, useRef as useRef11 } from "react";
|
|
8921
8752
|
import { useOverlayPosition } from "react-aria";
|
|
8922
8753
|
|
|
8923
8754
|
// src/components/Button.tsx
|
|
@@ -9607,7 +9438,7 @@ function OverlayTrigger(props) {
|
|
|
9607
9438
|
}
|
|
9608
9439
|
}
|
|
9609
9440
|
}), [menuTriggerProps, state]);
|
|
9610
|
-
const popoverRef =
|
|
9441
|
+
const popoverRef = useRef11(null);
|
|
9611
9442
|
const {
|
|
9612
9443
|
overlayProps: positionProps
|
|
9613
9444
|
} = useOverlayPosition({
|
|
@@ -9669,7 +9500,7 @@ import { jsx as jsx39 } from "react/jsx-runtime";
|
|
|
9669
9500
|
function ButtonModal(props) {
|
|
9670
9501
|
const { storybookDefaultOpen, trigger, disabled, content, title } = props;
|
|
9671
9502
|
const state = useMenuTriggerState({ isOpen: storybookDefaultOpen });
|
|
9672
|
-
const buttonRef =
|
|
9503
|
+
const buttonRef = useRef12(null);
|
|
9673
9504
|
const { menuTriggerProps } = useMenuTrigger({ isDisabled: !!disabled }, state, buttonRef);
|
|
9674
9505
|
const tid = useTestIds(
|
|
9675
9506
|
props,
|
|
@@ -9753,7 +9584,7 @@ function MenuItemImpl(props) {
|
|
|
9753
9584
|
const isDisabled = Boolean(disabled);
|
|
9754
9585
|
const isSelected = state.selectionManager.selectedKeys.has(label);
|
|
9755
9586
|
const isFocused = state.selectionManager.focusedKey === item.key;
|
|
9756
|
-
const ref =
|
|
9587
|
+
const ref = useRef13(null);
|
|
9757
9588
|
const history = useHistory();
|
|
9758
9589
|
const {
|
|
9759
9590
|
hoverProps,
|
|
@@ -9900,7 +9731,7 @@ function Popover(props) {
|
|
|
9900
9731
|
}
|
|
9901
9732
|
|
|
9902
9733
|
// src/inputs/internal/ComboBoxBase.tsx
|
|
9903
|
-
import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as
|
|
9734
|
+
import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as useRef22, useState as useState19 } from "react";
|
|
9904
9735
|
import { useButton as useButton7, useComboBox as useComboBox2, useFilter as useFilter4, useOverlayPosition as useOverlayPosition4 } from "react-aria";
|
|
9905
9736
|
import { Item as Item4, useComboBoxState as useComboBoxState2 } from "react-stately";
|
|
9906
9737
|
import { trussProps as trussProps39 } from "@homebound/truss/runtime";
|
|
@@ -9971,13 +9802,13 @@ function useGrowingTextField({ inputRef, inputWrapRef, value, disabled, maxLines
|
|
|
9971
9802
|
}
|
|
9972
9803
|
|
|
9973
9804
|
// src/inputs/TreeSelectField/TreeSelectField.tsx
|
|
9974
|
-
import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as
|
|
9805
|
+
import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as useRef21, useState as useState17 } from "react";
|
|
9975
9806
|
import { useButton as useButton6, useComboBox, useFilter as useFilter3, useOverlayPosition as useOverlayPosition3 } from "react-aria";
|
|
9976
9807
|
import { Item as Item3, useComboBoxState } from "react-stately";
|
|
9977
9808
|
import { trussProps as trussProps37 } from "@homebound/truss/runtime";
|
|
9978
9809
|
|
|
9979
9810
|
// src/inputs/internal/ListBox.tsx
|
|
9980
|
-
import { useEffect as useEffect12, useRef as
|
|
9811
|
+
import { useEffect as useEffect12, useRef as useRef20, useState as useState16 } from "react";
|
|
9981
9812
|
import { useListBox } from "react-aria";
|
|
9982
9813
|
import { trussProps as trussProps36 } from "@homebound/truss/runtime";
|
|
9983
9814
|
|
|
@@ -9990,17 +9821,17 @@ import { useListBoxSection, useSeparator as useSeparator2 } from "react-aria";
|
|
|
9990
9821
|
import { trussProps as trussProps35 } from "@homebound/truss/runtime";
|
|
9991
9822
|
|
|
9992
9823
|
// src/inputs/internal/Option.tsx
|
|
9993
|
-
import { useRef as
|
|
9824
|
+
import { useRef as useRef16 } from "react";
|
|
9994
9825
|
import { mergeProps as mergeProps12, useHover as useHover8, useOption } from "react-aria";
|
|
9995
9826
|
|
|
9996
9827
|
// src/inputs/ChipSelectField.tsx
|
|
9997
9828
|
import { camelCase as camelCase2 } from "change-case";
|
|
9998
|
-
import { useEffect as useEffect10, useMemo as useMemo14, useRef as
|
|
9829
|
+
import { useEffect as useEffect10, useMemo as useMemo14, useRef as useRef15, useState as useState15 } from "react";
|
|
9999
9830
|
import { mergeProps as mergeProps11, useButton as useButton5, useFocus as useFocus2, useOverlayPosition as useOverlayPosition2, useSelect } from "react-aria";
|
|
10000
9831
|
import { Item as Item2, Section as Section2, useListData, useSelectState } from "react-stately";
|
|
10001
9832
|
|
|
10002
9833
|
// src/inputs/ChipTextField.tsx
|
|
10003
|
-
import { useEffect as useEffect9, useRef as
|
|
9834
|
+
import { useEffect as useEffect9, useRef as useRef14, useState as useState14 } from "react";
|
|
10004
9835
|
import { useFocus } from "react-aria";
|
|
10005
9836
|
import { trussProps as trussProps28 } from "@homebound/truss/runtime";
|
|
10006
9837
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
@@ -10019,7 +9850,7 @@ function ChipTextField(props) {
|
|
|
10019
9850
|
const {
|
|
10020
9851
|
fieldProps
|
|
10021
9852
|
} = usePresentationContext();
|
|
10022
|
-
const valueRef =
|
|
9853
|
+
const valueRef = useRef14(value);
|
|
10023
9854
|
const tid = useTestIds(props, "chipField");
|
|
10024
9855
|
const [isFocused, setIsFocused] = useState14(false);
|
|
10025
9856
|
const {
|
|
@@ -10040,7 +9871,7 @@ function ChipTextField(props) {
|
|
|
10040
9871
|
onBlur: () => maybeCall(onBlur),
|
|
10041
9872
|
onFocusChange: setIsFocused
|
|
10042
9873
|
});
|
|
10043
|
-
const fieldRef =
|
|
9874
|
+
const fieldRef = useRef14(null);
|
|
10044
9875
|
useEffect9(
|
|
10045
9876
|
() => {
|
|
10046
9877
|
autoFocus && fieldRef.current?.focus();
|
|
@@ -10147,7 +9978,7 @@ function defaultOptionLabel(opt) {
|
|
|
10147
9978
|
import { trussProps as trussProps30 } from "@homebound/truss/runtime";
|
|
10148
9979
|
import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10149
9980
|
function ChipSelectField(props) {
|
|
10150
|
-
const firstRender =
|
|
9981
|
+
const firstRender = useRef15(true);
|
|
10151
9982
|
const {
|
|
10152
9983
|
fieldProps
|
|
10153
9984
|
} = usePresentationContext();
|
|
@@ -10205,10 +10036,10 @@ function ChipSelectField(props) {
|
|
|
10205
10036
|
} = useFocus2({
|
|
10206
10037
|
onFocusChange: setIsClearFocused
|
|
10207
10038
|
});
|
|
10208
|
-
const buttonRef =
|
|
10209
|
-
const popoverRef =
|
|
10210
|
-
const listBoxRef =
|
|
10211
|
-
const wrapperRef =
|
|
10039
|
+
const buttonRef = useRef15(null);
|
|
10040
|
+
const popoverRef = useRef15(null);
|
|
10041
|
+
const listBoxRef = useRef15(null);
|
|
10042
|
+
const wrapperRef = useRef15(null);
|
|
10212
10043
|
const listData = useListData({
|
|
10213
10044
|
initialItems: !onCreateNew ? options : [{
|
|
10214
10045
|
title: "Options",
|
|
@@ -10412,7 +10243,7 @@ function Option(props) {
|
|
|
10412
10243
|
scrollToIndex,
|
|
10413
10244
|
disabledReason
|
|
10414
10245
|
} = props;
|
|
10415
|
-
const ref =
|
|
10246
|
+
const ref = useRef16(null);
|
|
10416
10247
|
const {
|
|
10417
10248
|
hoverProps,
|
|
10418
10249
|
isHovered
|
|
@@ -10491,7 +10322,7 @@ function Option(props) {
|
|
|
10491
10322
|
|
|
10492
10323
|
// src/inputs/internal/VirtualizedOptions.tsx
|
|
10493
10324
|
import { getInteractionModality } from "@react-aria/interactions";
|
|
10494
|
-
import { useEffect as useEffect11, useRef as
|
|
10325
|
+
import { useEffect as useEffect11, useRef as useRef19 } from "react";
|
|
10495
10326
|
import { Virtuoso } from "react-virtuoso";
|
|
10496
10327
|
|
|
10497
10328
|
// src/inputs/internal/LoadingDots.tsx
|
|
@@ -10539,11 +10370,11 @@ function LoadingDots({
|
|
|
10539
10370
|
}
|
|
10540
10371
|
|
|
10541
10372
|
// src/inputs/TreeSelectField/TreeOption.tsx
|
|
10542
|
-
import { useRef as
|
|
10373
|
+
import { useRef as useRef18 } from "react";
|
|
10543
10374
|
import { useHover as useHover10, useOption as useOption2 } from "react-aria";
|
|
10544
10375
|
|
|
10545
10376
|
// src/inputs/CheckboxBase.tsx
|
|
10546
|
-
import { useRef as
|
|
10377
|
+
import { useRef as useRef17 } from "react";
|
|
10547
10378
|
import { mergeProps as mergeProps13, useFocusRing as useFocusRing5, useHover as useHover9, VisuallyHidden as VisuallyHidden3 } from "react-aria";
|
|
10548
10379
|
import { trussProps as trussProps33 } from "@homebound/truss/runtime";
|
|
10549
10380
|
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
@@ -10562,7 +10393,7 @@ function CheckboxBase(props) {
|
|
|
10562
10393
|
tooltip,
|
|
10563
10394
|
fullWidth = false
|
|
10564
10395
|
} = props;
|
|
10565
|
-
const ref =
|
|
10396
|
+
const ref = useRef17(null);
|
|
10566
10397
|
const {
|
|
10567
10398
|
isFocusVisible,
|
|
10568
10399
|
focusProps
|
|
@@ -10707,7 +10538,7 @@ function TreeOption(props) {
|
|
|
10707
10538
|
const leveledOption = item.value;
|
|
10708
10539
|
if (!leveledOption) return null;
|
|
10709
10540
|
const [option, level] = leveledOption;
|
|
10710
|
-
const ref =
|
|
10541
|
+
const ref = useRef18(null);
|
|
10711
10542
|
const {
|
|
10712
10543
|
hoverProps,
|
|
10713
10544
|
isHovered
|
|
@@ -10857,7 +10688,7 @@ function VirtualizedOptions(props) {
|
|
|
10857
10688
|
isTree,
|
|
10858
10689
|
allowCollapsing
|
|
10859
10690
|
} = props;
|
|
10860
|
-
const virtuosoRef =
|
|
10691
|
+
const virtuosoRef = useRef19(null);
|
|
10861
10692
|
const focusedKey = state.selectionManager.focusedKey;
|
|
10862
10693
|
const focusedItem = focusedKey != null ? state.collection.getItem(focusedKey) : null;
|
|
10863
10694
|
const selectedItem = state.selectionManager.selectedKeys.size > 0 ? state.collection.getItem([...state.selectionManager.selectedKeys.values()][0]) : void 0;
|
|
@@ -10871,6 +10702,7 @@ function VirtualizedOptions(props) {
|
|
|
10871
10702
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10872
10703
|
[focusedItem]
|
|
10873
10704
|
);
|
|
10705
|
+
const key = process.env.NODE_ENV === "test" ? items.length : "virtuoso";
|
|
10874
10706
|
return /* @__PURE__ */ jsx50(
|
|
10875
10707
|
Virtuoso,
|
|
10876
10708
|
{
|
|
@@ -10878,11 +10710,6 @@ function VirtualizedOptions(props) {
|
|
|
10878
10710
|
totalListHeightChanged: onListHeightChange,
|
|
10879
10711
|
totalCount: items.length,
|
|
10880
10712
|
...process.env.NODE_ENV === "test" ? {
|
|
10881
|
-
// In tests, we render all rows so assertions can see expands/async-loaded items. However,
|
|
10882
|
-
// the `initialItemCount` (next prop) is only applied on amount, so we set `key={items.length}`
|
|
10883
|
-
// to force a remount when our list changes -- and we only want/need this in tests, b/c otherwise
|
|
10884
|
-
// in production a Virtuoso remount causes visible flashing.
|
|
10885
|
-
key: items.length,
|
|
10886
10713
|
// We don't really need to set this, but it's handy for tests, which would otherwise render
|
|
10887
10714
|
// just 1 row. A better way to do this would be to jest.mock out Virtuoso with an impl that
|
|
10888
10715
|
// just rendered everything, but doing this for now.
|
|
@@ -10925,7 +10752,8 @@ function VirtualizedOptions(props) {
|
|
|
10925
10752
|
components: !loading ? {} : {
|
|
10926
10753
|
Footer: typeof loading === "function" ? loading : () => /* @__PURE__ */ jsx50(LoadingDots, { contrast })
|
|
10927
10754
|
}
|
|
10928
|
-
}
|
|
10755
|
+
},
|
|
10756
|
+
key
|
|
10929
10757
|
);
|
|
10930
10758
|
}
|
|
10931
10759
|
|
|
@@ -11015,9 +10843,9 @@ function ListBox(props) {
|
|
|
11015
10843
|
const isMultiSelect = state.selectionManager.selectionMode === "multiple";
|
|
11016
10844
|
const firstItem = state.collection.at(0);
|
|
11017
10845
|
const hasSections = firstItem && firstItem.type === "section";
|
|
11018
|
-
const selectedList =
|
|
11019
|
-
const firstRender =
|
|
11020
|
-
const virtuosoListHeight =
|
|
10846
|
+
const selectedList = useRef20(null);
|
|
10847
|
+
const firstRender = useRef20(true);
|
|
10848
|
+
const virtuosoListHeight = useRef20(0);
|
|
11021
10849
|
const onListHeightChange = (listHeight) => {
|
|
11022
10850
|
virtuosoListHeight.current = listHeight;
|
|
11023
10851
|
const height = (selectedList.current?.offsetHeight || 0) + listHeight;
|
|
@@ -11052,7 +10880,7 @@ function ListBox(props) {
|
|
|
11052
10880
|
boxShadow: "bshBasic h_bshHover"
|
|
11053
10881
|
} : {}
|
|
11054
10882
|
}), ref: listBoxRef, ...listBoxProps, children: [
|
|
11055
|
-
isMultiSelect &&
|
|
10883
|
+
isMultiSelect && selectedOptions.length > 0 && /* @__PURE__ */ jsx53("ul", { className: "p_0 m_0 lis_none pt2 pl2 pb1 pr1 df bbs_solid bbw_1px bcGray200 flexWrap_wrap maxh_50 oa", ref: selectedList, children: selectedOptions.map((o) => /* @__PURE__ */ jsx53(ListBoxToggleChip, { state, option: o, getOptionValue, getOptionLabel, disabled: state.disabledKeys.has(getOptionValue(o)) }, getOptionValue(o))) }),
|
|
11056
10884
|
/* @__PURE__ */ jsx53("ul", { className: "p_0 m_0 lis_none fg1", children: hasSections ? [...state.collection].map((section) => /* @__PURE__ */ jsx53(
|
|
11057
10885
|
ListBoxSection,
|
|
11058
10886
|
{
|
|
@@ -11203,14 +11031,15 @@ function TreeSelectFieldBase(props) {
|
|
|
11203
11031
|
if (!maybeOption) return [];
|
|
11204
11032
|
return [maybeOption.option];
|
|
11205
11033
|
});
|
|
11206
|
-
const
|
|
11034
|
+
const selectedChipState = getSelectedChipState(initialOptions, selectedOptions, selectedKeys, chipDisplay, getOptionLabel, getOptionValue);
|
|
11207
11035
|
return {
|
|
11208
11036
|
selectedKeys: [...selectedKeys],
|
|
11209
11037
|
searchValue: void 0,
|
|
11210
|
-
inputValue: selectedOptions.length === 1 ? getOptionLabel([...selectedOptions][0]) : isReadOnly && selectedOptions.length > 0 ?
|
|
11038
|
+
inputValue: selectedOptions.length === 1 ? getOptionLabel([...selectedOptions][0]) : isReadOnly && selectedOptions.length > 0 ? selectedChipState.labels.join(", ") : selectedOptions.length === 0 ? nothingSelectedText : "",
|
|
11211
11039
|
selectedOptions,
|
|
11040
|
+
selectedChipOptions: selectedChipState.options,
|
|
11212
11041
|
allOptions: initialOptions,
|
|
11213
|
-
selectedOptionsLabels,
|
|
11042
|
+
selectedOptionsLabels: selectedChipState.labels,
|
|
11214
11043
|
optionsLoading: false,
|
|
11215
11044
|
allowCollapsing: true
|
|
11216
11045
|
};
|
|
@@ -11259,7 +11088,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11259
11088
|
}));
|
|
11260
11089
|
}
|
|
11261
11090
|
}, []);
|
|
11262
|
-
const firstOpen =
|
|
11091
|
+
const firstOpen = useRef21(true);
|
|
11263
11092
|
function onOpenChange(isOpen) {
|
|
11264
11093
|
if (firstOpen.current && isOpen) {
|
|
11265
11094
|
maybeInitLoad(options, setFieldState);
|
|
@@ -11309,7 +11138,9 @@ function TreeSelectFieldBase(props) {
|
|
|
11309
11138
|
searchValue: void 0,
|
|
11310
11139
|
allowCollapsing: true,
|
|
11311
11140
|
selectedKeys: [],
|
|
11312
|
-
selectedOptions: []
|
|
11141
|
+
selectedOptions: [],
|
|
11142
|
+
selectedChipOptions: [],
|
|
11143
|
+
selectedOptionsLabels: []
|
|
11313
11144
|
}));
|
|
11314
11145
|
onSelect({
|
|
11315
11146
|
all: {
|
|
@@ -11376,6 +11207,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11376
11207
|
const rootValues = rootOptions.map(getOptionValue);
|
|
11377
11208
|
const leafOptions = selectedOptions.filter((o) => !o.children || o.children.length === 0);
|
|
11378
11209
|
const leafValues = leafOptions.map(getOptionValue);
|
|
11210
|
+
const selectedChipState = getSelectedChipState(fieldState.allOptions, selectedOptions, selectedKeys, chipDisplay, getOptionLabel, getOptionValue);
|
|
11379
11211
|
setFieldState((prevState) => ({
|
|
11380
11212
|
...prevState,
|
|
11381
11213
|
// Since we reset the list of options upon selection changes, then set the `inputValue` to empty string to reflect that.
|
|
@@ -11383,7 +11215,8 @@ function TreeSelectFieldBase(props) {
|
|
|
11383
11215
|
searchValue: void 0,
|
|
11384
11216
|
selectedKeys: [...selectedKeys],
|
|
11385
11217
|
selectedOptions,
|
|
11386
|
-
|
|
11218
|
+
selectedChipOptions: selectedChipState.options,
|
|
11219
|
+
selectedOptionsLabels: selectedChipState.labels
|
|
11387
11220
|
}));
|
|
11388
11221
|
onSelect({
|
|
11389
11222
|
all: {
|
|
@@ -11416,12 +11249,12 @@ function TreeSelectFieldBase(props) {
|
|
|
11416
11249
|
}));
|
|
11417
11250
|
}
|
|
11418
11251
|
}
|
|
11419
|
-
const comboBoxRef =
|
|
11420
|
-
const triggerRef =
|
|
11421
|
-
const inputRef =
|
|
11422
|
-
const inputWrapRef =
|
|
11423
|
-
const listBoxRef =
|
|
11424
|
-
const popoverRef =
|
|
11252
|
+
const comboBoxRef = useRef21(null);
|
|
11253
|
+
const triggerRef = useRef21(null);
|
|
11254
|
+
const inputRef = useRef21(null);
|
|
11255
|
+
const inputWrapRef = useRef21(null);
|
|
11256
|
+
const listBoxRef = useRef21(null);
|
|
11257
|
+
const popoverRef = useRef21(null);
|
|
11425
11258
|
const {
|
|
11426
11259
|
buttonProps: triggerProps,
|
|
11427
11260
|
inputProps,
|
|
@@ -11482,7 +11315,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11482
11315
|
onClose: () => state.toggle(),
|
|
11483
11316
|
isOpen: state.isOpen,
|
|
11484
11317
|
minWidth: 320,
|
|
11485
|
-
children: /* @__PURE__ */ jsx54(ListBox, { ...listBoxProps, positionProps, state, listBoxRef, selectedOptions: fieldState.
|
|
11318
|
+
children: /* @__PURE__ */ jsx54(ListBox, { ...listBoxProps, positionProps, state, listBoxRef, selectedOptions: fieldState.selectedChipOptions, getOptionLabel, getOptionValue: (o) => valueToKey(getOptionValue(o)), contrast, horizontalLayout: labelStyle === "left", loading: fieldState.optionsLoading, allowCollapsing: fieldState.allowCollapsing, isTree: true })
|
|
11486
11319
|
}
|
|
11487
11320
|
)
|
|
11488
11321
|
] });
|
|
@@ -11512,6 +11345,25 @@ function isOptionFullySelected(option, selectedKeys, disabledKeys, groupKeys, ge
|
|
|
11512
11345
|
if (!option.children || option.children.length === 0) return false;
|
|
11513
11346
|
return option.children.every((child) => isOptionFullySelected(child, selectedKeys, disabledKeys, groupKeys, getOptionValue));
|
|
11514
11347
|
}
|
|
11348
|
+
function getSelectedChipState(allOptions, selectedOptions, selectedKeys, chipDisplay, getOptionLabel, getOptionValue) {
|
|
11349
|
+
const options = chipDisplay === "root" ? dedupeOptionsByValue(allOptions.flatMap((option) => getTopLevelSelections(option, selectedKeys, getOptionValue)), getOptionValue) : chipDisplay === "leaf" ? selectedOptions.filter(isLeafOption) : selectedOptions;
|
|
11350
|
+
return {
|
|
11351
|
+
options,
|
|
11352
|
+
labels: options.map(getOptionLabel)
|
|
11353
|
+
};
|
|
11354
|
+
}
|
|
11355
|
+
function dedupeOptionsByValue(options, getOptionValue) {
|
|
11356
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11357
|
+
return options.filter(function filterOption(option) {
|
|
11358
|
+
const key = valueToKey(getOptionValue(option));
|
|
11359
|
+
if (seen.has(key)) return false;
|
|
11360
|
+
seen.add(key);
|
|
11361
|
+
return true;
|
|
11362
|
+
});
|
|
11363
|
+
}
|
|
11364
|
+
function isLeafOption(option) {
|
|
11365
|
+
return !option.children || option.children.length === 0;
|
|
11366
|
+
}
|
|
11515
11367
|
|
|
11516
11368
|
// src/inputs/internal/ComboBoxInput.tsx
|
|
11517
11369
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
@@ -11550,7 +11402,6 @@ function ComboBoxInput(props) {
|
|
|
11550
11402
|
} = useTreeSelectFieldProvider();
|
|
11551
11403
|
const [isFocused, setIsFocused] = useState18(false);
|
|
11552
11404
|
const isMultiSelect = state.selectionManager.selectionMode === "multiple";
|
|
11553
|
-
const showNumSelection = isMultiSelect && state.selectionManager.selectedKeys.size > 1;
|
|
11554
11405
|
const showChipSelection = isMultiSelect && state.selectionManager.selectedKeys.size > 0;
|
|
11555
11406
|
const showFieldDecoration = (!isMultiSelect || isMultiSelect && !isFocused) && fieldDecoration && selectedOptions.length === 1;
|
|
11556
11407
|
const multilineProps = allowWrap ? {
|
|
@@ -11558,6 +11409,8 @@ function ComboBoxInput(props) {
|
|
|
11558
11409
|
multiline: true
|
|
11559
11410
|
} : {};
|
|
11560
11411
|
const chipLabels = isTree ? selectedOptionsLabels || [] : selectedOptions.map((o) => getOptionLabel(o));
|
|
11412
|
+
const selectedChipCount = chipLabels.length;
|
|
11413
|
+
const showNumSelection = isMultiSelect && selectedChipCount > 1;
|
|
11561
11414
|
useGrowingTextField({
|
|
11562
11415
|
// This says: When using a multiselect, then only enable the growing textfield when we are focused on it.
|
|
11563
11416
|
// Because otherwise, we're not displaying the input element that dictates the height (we're displaying <Chips/>). This would cause incorrect calculations
|
|
@@ -11568,7 +11421,7 @@ function ComboBoxInput(props) {
|
|
|
11568
11421
|
});
|
|
11569
11422
|
return /* @__PURE__ */ jsx55(TextFieldBase, { ...otherProps, ...multilineProps, unfocusedPlaceholder: showChipSelection && /* @__PURE__ */ jsx55(Chips, { compact: otherProps.compact, values: chipLabels, wrap: allowWrap }), inputRef, inputWrapRef, errorMsg, contrast, xss: otherProps.labelStyle !== "inline" && !inputProps.readOnly ? {
|
|
11570
11423
|
fontWeight: "fw5"
|
|
11571
|
-
} : void 0, startAdornment: showNumSelection && /* @__PURE__ */ jsx55(Tooltip, { title: /* @__PURE__ */ jsx55(SelectedOptionBullets, { labels: chipLabels }), children: /* @__PURE__ */ jsx55(CountBadge, { count:
|
|
11424
|
+
} : void 0, startAdornment: showNumSelection && /* @__PURE__ */ jsx55(Tooltip, { title: /* @__PURE__ */ jsx55(SelectedOptionBullets, { labels: chipLabels }), children: /* @__PURE__ */ jsx55(CountBadge, { count: selectedChipCount, "data-testid": "selectedOptionsCount" }) }) || showFieldDecoration && fieldDecoration(selectedOptions[0]), endAdornment: !inputProps.readOnly && /* @__PURE__ */ jsx55("button", { ...buttonProps, disabled: inputProps.disabled, ref: buttonRef, ...trussProps38({
|
|
11572
11425
|
...{
|
|
11573
11426
|
borderRadius: "br4",
|
|
11574
11427
|
outline: "outline0",
|
|
@@ -11772,7 +11625,7 @@ function ComboBoxBase(props) {
|
|
|
11772
11625
|
}));
|
|
11773
11626
|
}
|
|
11774
11627
|
}
|
|
11775
|
-
const firstOpen =
|
|
11628
|
+
const firstOpen = useRef22(true);
|
|
11776
11629
|
function onOpenChange(isOpen) {
|
|
11777
11630
|
if (firstOpen.current && isOpen) {
|
|
11778
11631
|
maybeInitLoad();
|
|
@@ -11785,12 +11638,12 @@ function ComboBoxBase(props) {
|
|
|
11785
11638
|
}));
|
|
11786
11639
|
}
|
|
11787
11640
|
}
|
|
11788
|
-
const comboBoxRef =
|
|
11789
|
-
const triggerRef =
|
|
11790
|
-
const inputRef =
|
|
11791
|
-
const inputWrapRef =
|
|
11792
|
-
const listBoxRef =
|
|
11793
|
-
const popoverRef =
|
|
11641
|
+
const comboBoxRef = useRef22(null);
|
|
11642
|
+
const triggerRef = useRef22(null);
|
|
11643
|
+
const inputRef = useRef22(null);
|
|
11644
|
+
const inputWrapRef = useRef22(null);
|
|
11645
|
+
const listBoxRef = useRef22(null);
|
|
11646
|
+
const popoverRef = useRef22(null);
|
|
11794
11647
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
11795
11648
|
const comboBoxChildren = useCallback9((item) => /* @__PURE__ */ jsx56(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))), [getOptionValue, getOptionLabel, getOptionMenuLabel]);
|
|
11796
11649
|
const selectedKeys = useMemo16(() => {
|
|
@@ -12024,10 +11877,10 @@ function Autocomplete(props) {
|
|
|
12024
11877
|
...others
|
|
12025
11878
|
};
|
|
12026
11879
|
const state = useComboBoxState3(comboBoxProps);
|
|
12027
|
-
const inputWrapRef =
|
|
12028
|
-
const inputRef =
|
|
12029
|
-
const listBoxRef =
|
|
12030
|
-
const popoverRef =
|
|
11880
|
+
const inputWrapRef = useRef23(null);
|
|
11881
|
+
const inputRef = useRef23(null);
|
|
11882
|
+
const listBoxRef = useRef23(null);
|
|
11883
|
+
const popoverRef = useRef23(null);
|
|
12031
11884
|
const { inputProps, listBoxProps, labelProps } = useComboBox3(
|
|
12032
11885
|
{
|
|
12033
11886
|
...comboBoxProps,
|
|
@@ -12094,7 +11947,7 @@ function Autocomplete(props) {
|
|
|
12094
11947
|
}
|
|
12095
11948
|
|
|
12096
11949
|
// src/inputs/Checkbox.tsx
|
|
12097
|
-
import { useRef as
|
|
11950
|
+
import { useRef as useRef24 } from "react";
|
|
12098
11951
|
import { useCheckbox } from "react-aria";
|
|
12099
11952
|
import { useToggleState } from "react-stately";
|
|
12100
11953
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -12104,7 +11957,7 @@ function Checkbox(props) {
|
|
|
12104
11957
|
const isIndeterminate = selected === "indeterminate";
|
|
12105
11958
|
const ariaProps = { isSelected, isDisabled: !!disabled, isIndeterminate, ...otherProps };
|
|
12106
11959
|
const checkboxProps = { ...ariaProps, "aria-label": label };
|
|
12107
|
-
const ref =
|
|
11960
|
+
const ref = useRef24(null);
|
|
12108
11961
|
const toggleState = useToggleState(ariaProps);
|
|
12109
11962
|
const { inputProps } = useCheckbox(checkboxProps, toggleState, ref);
|
|
12110
11963
|
return /* @__PURE__ */ jsx58(
|
|
@@ -12123,7 +11976,7 @@ function Checkbox(props) {
|
|
|
12123
11976
|
}
|
|
12124
11977
|
|
|
12125
11978
|
// src/inputs/CheckboxGroup.tsx
|
|
12126
|
-
import { useRef as
|
|
11979
|
+
import { useRef as useRef25 } from "react";
|
|
12127
11980
|
import { useCheckboxGroup, useCheckboxGroupItem } from "react-aria";
|
|
12128
11981
|
import { useCheckboxGroupState } from "react-stately";
|
|
12129
11982
|
import { trussProps as trussProps40 } from "@homebound/truss/runtime";
|
|
@@ -12198,7 +12051,7 @@ function CheckboxGroupItem(props) {
|
|
|
12198
12051
|
...ariaProps,
|
|
12199
12052
|
"aria-label": label
|
|
12200
12053
|
};
|
|
12201
|
-
const ref =
|
|
12054
|
+
const ref = useRef25(null);
|
|
12202
12055
|
const {
|
|
12203
12056
|
inputProps
|
|
12204
12057
|
} = useCheckboxGroupItem(checkboxProps, groupState, ref);
|
|
@@ -12206,37 +12059,69 @@ function CheckboxGroupItem(props) {
|
|
|
12206
12059
|
}
|
|
12207
12060
|
|
|
12208
12061
|
// src/inputs/DateFields/DateField.mock.tsx
|
|
12062
|
+
import { format as format3, parse } from "date-fns";
|
|
12209
12063
|
import { useState as useState20 } from "react";
|
|
12064
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12065
|
+
function DateFieldMock(props) {
|
|
12066
|
+
const { onChange = () => {
|
|
12067
|
+
}, errorMsg, onBlur, onFocus } = props;
|
|
12068
|
+
const [value, setValue] = useState20(props.value ? format3(props.value, "MM/dd/yy") : "");
|
|
12069
|
+
const tid = useTestIds(props, "date");
|
|
12070
|
+
return /* @__PURE__ */ jsx60(
|
|
12071
|
+
"input",
|
|
12072
|
+
{
|
|
12073
|
+
...tid,
|
|
12074
|
+
"data-error": !!errorMsg,
|
|
12075
|
+
value,
|
|
12076
|
+
onChange: (e) => {
|
|
12077
|
+
const { value: value2 } = e.target;
|
|
12078
|
+
setValue(value2);
|
|
12079
|
+
onChange(parse(value2, "MM/dd/yy", /* @__PURE__ */ new Date()));
|
|
12080
|
+
},
|
|
12081
|
+
onBlur: () => maybeCall(onBlur),
|
|
12082
|
+
onFocus: () => maybeCall(onFocus),
|
|
12083
|
+
disabled: !!props.disabled,
|
|
12084
|
+
readOnly: !!props.readOnly,
|
|
12085
|
+
"data-disabled-days": JSON.stringify(props.disabledDays)
|
|
12086
|
+
}
|
|
12087
|
+
);
|
|
12088
|
+
}
|
|
12089
|
+
|
|
12090
|
+
// src/inputs/DateFields/DateFieldBase.tsx
|
|
12091
|
+
import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef26, useState as useState21 } from "react";
|
|
12092
|
+
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
12093
|
+
import { isDateRange } from "react-day-picker";
|
|
12094
|
+
import { useOverlayTriggerState } from "react-stately";
|
|
12210
12095
|
|
|
12211
12096
|
// src/inputs/DateFields/utils.ts
|
|
12212
|
-
import {
|
|
12097
|
+
import { format as dateFnsFormat, parse as dateFnsParse, isDate } from "date-fns";
|
|
12213
12098
|
var dateFormats = {
|
|
12214
|
-
short: "
|
|
12215
|
-
medium: "
|
|
12216
|
-
long: "
|
|
12099
|
+
short: "MM/dd/yy",
|
|
12100
|
+
medium: "EEE, MMM d",
|
|
12101
|
+
long: "EEEE LLLL d, uuuu"
|
|
12217
12102
|
};
|
|
12218
|
-
function getDateFormat(
|
|
12219
|
-
return
|
|
12103
|
+
function getDateFormat(format4) {
|
|
12104
|
+
return format4 ? dateFormats[format4] : dateFormats.short;
|
|
12220
12105
|
}
|
|
12221
|
-
function formatDate(date,
|
|
12106
|
+
function formatDate(date, format4) {
|
|
12222
12107
|
if (!date) return "";
|
|
12223
|
-
return
|
|
12108
|
+
return dateFnsFormat(date, format4);
|
|
12224
12109
|
}
|
|
12225
|
-
function formatDateRange(date,
|
|
12110
|
+
function formatDateRange(date, format4) {
|
|
12226
12111
|
if (!date) return "";
|
|
12227
12112
|
const { from, to } = date;
|
|
12228
|
-
const fromFormatted = from ?
|
|
12229
|
-
const toFormatted = to ?
|
|
12113
|
+
const fromFormatted = from ? dateFnsFormat(from, format4) : "";
|
|
12114
|
+
const toFormatted = to ? dateFnsFormat(to, format4) : "";
|
|
12230
12115
|
return !fromFormatted && !toFormatted ? void 0 : `${fromFormatted} - ${toFormatted}`;
|
|
12231
12116
|
}
|
|
12232
|
-
function parseDate(str,
|
|
12233
|
-
return parseDateString(str,
|
|
12117
|
+
function parseDate(str, format4) {
|
|
12118
|
+
return parseDateString(str, format4);
|
|
12234
12119
|
}
|
|
12235
|
-
function parseDateRange(str,
|
|
12120
|
+
function parseDateRange(str, format4) {
|
|
12236
12121
|
const [from = "", to = ""] = str.split("-");
|
|
12237
|
-
const fromDate = parseDateString(from.trim(),
|
|
12238
|
-
const toDate = parseDateString(to.trim(),
|
|
12239
|
-
if (toDate && fromDate &&
|
|
12122
|
+
const fromDate = parseDateString(from.trim(), format4);
|
|
12123
|
+
const toDate = parseDateString(to.trim(), format4);
|
|
12124
|
+
if (toDate && fromDate && toDate < fromDate) {
|
|
12240
12125
|
return { from: toDate, to: fromDate };
|
|
12241
12126
|
}
|
|
12242
12127
|
if (toDate === void 0 && fromDate === void 0) {
|
|
@@ -12244,81 +12129,31 @@ function parseDateRange(str, format) {
|
|
|
12244
12129
|
}
|
|
12245
12130
|
return { from: fromDate, to: toDate };
|
|
12246
12131
|
}
|
|
12247
|
-
function parseDateString(str,
|
|
12248
|
-
if (format !== dateFormats.short && format !== "date") {
|
|
12249
|
-
return void 0;
|
|
12250
|
-
}
|
|
12132
|
+
function parseDateString(str, format4) {
|
|
12251
12133
|
const split = str.split("/");
|
|
12252
12134
|
if (split.length !== 3) {
|
|
12253
12135
|
return void 0;
|
|
12254
12136
|
}
|
|
12255
|
-
|
|
12256
|
-
if (split[2].length !== yearLength) {
|
|
12137
|
+
if (split[2].length !== 2) {
|
|
12257
12138
|
return void 0;
|
|
12258
12139
|
}
|
|
12259
|
-
const month = parseInt(split[0], 10);
|
|
12140
|
+
const month = parseInt(split[0], 10) - 1;
|
|
12260
12141
|
const day = parseInt(split[1], 10);
|
|
12261
12142
|
const year = parseInt(split[2], 10);
|
|
12262
|
-
if (
|
|
12143
|
+
if (isNaN(year) || String(year).length > 4 || isNaN(month) || isNaN(day) || day <= 0 || day > 31 || month < 0 || month >= 12) {
|
|
12263
12144
|
return void 0;
|
|
12264
12145
|
}
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
year: yearLength === 2 ? normalizeTwoDigitYear(year, todayPlainDate().year) : year,
|
|
12268
|
-
month,
|
|
12269
|
-
day
|
|
12270
|
-
});
|
|
12271
|
-
} catch {
|
|
12146
|
+
const parsed = dateFnsParse(str, format4, /* @__PURE__ */ new Date());
|
|
12147
|
+
if (!isValidDate(parsed)) {
|
|
12272
12148
|
return void 0;
|
|
12273
12149
|
}
|
|
12150
|
+
return parsed;
|
|
12274
12151
|
}
|
|
12275
12152
|
function isValidDate(d) {
|
|
12276
|
-
return d !== void 0 &&
|
|
12277
|
-
}
|
|
12278
|
-
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
12279
|
-
const isCommonEra = currentYear > 0;
|
|
12280
|
-
const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
12281
|
-
if (absCurrentYear <= 50) {
|
|
12282
|
-
return isCommonEra ? twoDigitYear || 100 : 1 - (twoDigitYear || 100);
|
|
12283
|
-
}
|
|
12284
|
-
const rangeEnd = absCurrentYear + 50;
|
|
12285
|
-
const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
12286
|
-
const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
12287
|
-
const normalizedYear = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
12288
|
-
return isCommonEra ? normalizedYear : 1 - normalizedYear;
|
|
12289
|
-
}
|
|
12290
|
-
|
|
12291
|
-
// src/inputs/DateFields/DateField.mock.tsx
|
|
12292
|
-
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12293
|
-
function DateFieldMock(props) {
|
|
12294
|
-
const { onChange = () => {
|
|
12295
|
-
}, errorMsg, onBlur, onFocus } = props;
|
|
12296
|
-
const [value, setValue] = useState20(formatDate(props.value, dateFormats.short));
|
|
12297
|
-
const tid = useTestIds(props, "date");
|
|
12298
|
-
return /* @__PURE__ */ jsx60(
|
|
12299
|
-
"input",
|
|
12300
|
-
{
|
|
12301
|
-
...tid,
|
|
12302
|
-
"data-error": !!errorMsg,
|
|
12303
|
-
value,
|
|
12304
|
-
onChange: (e) => {
|
|
12305
|
-
const { value: value2 } = e.target;
|
|
12306
|
-
setValue(value2);
|
|
12307
|
-
onChange(parseDate(value2, dateFormats.short));
|
|
12308
|
-
},
|
|
12309
|
-
onBlur: () => maybeCall(onBlur),
|
|
12310
|
-
onFocus: () => maybeCall(onFocus),
|
|
12311
|
-
disabled: !!props.disabled,
|
|
12312
|
-
readOnly: !!props.readOnly,
|
|
12313
|
-
"data-disabled-days": JSON.stringify(props.disabledDays)
|
|
12314
|
-
}
|
|
12315
|
-
);
|
|
12153
|
+
return d !== void 0 && isDate(d) && d.toString() !== "Invalid Date";
|
|
12316
12154
|
}
|
|
12317
12155
|
|
|
12318
12156
|
// src/inputs/DateFields/DateFieldBase.tsx
|
|
12319
|
-
import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef27, useState as useState21 } from "react";
|
|
12320
|
-
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
12321
|
-
import { useOverlayTriggerState } from "react-stately";
|
|
12322
12157
|
import { trussProps as trussProps41 } from "@homebound/truss/runtime";
|
|
12323
12158
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12324
12159
|
function DateFieldBase(props) {
|
|
@@ -12334,7 +12169,7 @@ function DateFieldBase(props) {
|
|
|
12334
12169
|
errorMsg,
|
|
12335
12170
|
helperText,
|
|
12336
12171
|
readOnly,
|
|
12337
|
-
format = "short",
|
|
12172
|
+
format: format4 = "short",
|
|
12338
12173
|
iconLeft = false,
|
|
12339
12174
|
hideCalendarIcon = false,
|
|
12340
12175
|
disabledDays,
|
|
@@ -12346,12 +12181,12 @@ function DateFieldBase(props) {
|
|
|
12346
12181
|
...others
|
|
12347
12182
|
} = props;
|
|
12348
12183
|
const isRangeMode = mode === "range";
|
|
12349
|
-
const inputRef =
|
|
12350
|
-
const inputWrapRef =
|
|
12351
|
-
const buttonRef =
|
|
12352
|
-
const overlayRef =
|
|
12353
|
-
const isFocused =
|
|
12354
|
-
const dateFormat = getDateFormat(
|
|
12184
|
+
const inputRef = useRef26(null);
|
|
12185
|
+
const inputWrapRef = useRef26(null);
|
|
12186
|
+
const buttonRef = useRef26(null);
|
|
12187
|
+
const overlayRef = useRef26(null);
|
|
12188
|
+
const isFocused = useRef26(false);
|
|
12189
|
+
const dateFormat = getDateFormat(format4);
|
|
12355
12190
|
const [wipValue, setWipValue] = useState21(value);
|
|
12356
12191
|
const [inputValue, setInputValue] = useState21((isRangeMode ? formatDateRange(props.value, dateFormat) : formatDate(props.value, dateFormat)) ?? "");
|
|
12357
12192
|
const tid = useTestIds(props, defaultTestId(label));
|
|
@@ -12440,20 +12275,16 @@ function DateFieldBase(props) {
|
|
|
12440
12275
|
(d) => {
|
|
12441
12276
|
setWipValue(d);
|
|
12442
12277
|
if (d && isParsedDateValid(d)) {
|
|
12443
|
-
if (isRangeMode &&
|
|
12278
|
+
if (isRangeMode && isDateRange(d)) {
|
|
12444
12279
|
props.onChange(d);
|
|
12445
12280
|
return;
|
|
12446
12281
|
}
|
|
12447
|
-
if (!isRangeMode && !
|
|
12282
|
+
if (!isRangeMode && !isDateRange(d)) {
|
|
12448
12283
|
props.onChange(d);
|
|
12449
12284
|
return;
|
|
12450
12285
|
}
|
|
12451
12286
|
} else {
|
|
12452
|
-
|
|
12453
|
-
props.onChange(void 0);
|
|
12454
|
-
} else {
|
|
12455
|
-
props.onChange(void 0);
|
|
12456
|
-
}
|
|
12287
|
+
props.onChange(void 0);
|
|
12457
12288
|
return;
|
|
12458
12289
|
}
|
|
12459
12290
|
},
|
|
@@ -12461,7 +12292,7 @@ function DateFieldBase(props) {
|
|
|
12461
12292
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12462
12293
|
[isRangeMode, props.onChange]
|
|
12463
12294
|
);
|
|
12464
|
-
const inputSize = !isRangeMode ?
|
|
12295
|
+
const inputSize = !isRangeMode ? format4 === "short" ? 8 : format4 === "medium" ? 10 : void 0 : void 0;
|
|
12465
12296
|
const clearButton = /* @__PURE__ */ jsx61(Fragment18, { children: inputValue !== "" && !state.isOpen && /* @__PURE__ */ jsx61(IconButton, { icon: "xCircle", color: "rgba(100, 100, 100, 1)" /* Gray700 */, onClick: () => {
|
|
12466
12297
|
setInputValue("");
|
|
12467
12298
|
onChange(void 0);
|
|
@@ -12523,10 +12354,7 @@ function DateFieldBase(props) {
|
|
|
12523
12354
|
] });
|
|
12524
12355
|
}
|
|
12525
12356
|
function isParsedDateValid(d) {
|
|
12526
|
-
return d !== void 0 && (!
|
|
12527
|
-
}
|
|
12528
|
-
function isDateRangeValue(value) {
|
|
12529
|
-
return typeof value === "object" && value !== null && ("from" in value || "to" in value);
|
|
12357
|
+
return d !== void 0 && (!isDateRange(d) || isDateRange(d) && isValidDate(d.from) && isValidDate(d.to));
|
|
12530
12358
|
}
|
|
12531
12359
|
|
|
12532
12360
|
// src/utils/withTestMock.tsx
|
|
@@ -12713,7 +12541,7 @@ function MultiSelectField(props) {
|
|
|
12713
12541
|
|
|
12714
12542
|
// src/inputs/NumberField.tsx
|
|
12715
12543
|
import { NumberParser } from "@internationalized/number";
|
|
12716
|
-
import { useMemo as useMemo18, useRef as
|
|
12544
|
+
import { useMemo as useMemo18, useRef as useRef27, useState as useState23 } from "react";
|
|
12717
12545
|
import { mergeProps as mergeProps15, useLocale, useNumberField } from "react-aria";
|
|
12718
12546
|
import { useNumberFieldState } from "react-stately";
|
|
12719
12547
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
@@ -12800,11 +12628,11 @@ function NumberField(props) {
|
|
|
12800
12628
|
};
|
|
12801
12629
|
}, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
|
|
12802
12630
|
const numberParser = useMemo18(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
|
|
12803
|
-
const valueRef =
|
|
12631
|
+
const valueRef = useRef27({
|
|
12804
12632
|
wip: false
|
|
12805
12633
|
});
|
|
12806
|
-
const lastSentRef =
|
|
12807
|
-
const focusValueRef =
|
|
12634
|
+
const lastSentRef = useRef27(void 0);
|
|
12635
|
+
const focusValueRef = useRef27(void 0);
|
|
12808
12636
|
const [, forceRender] = useState23(0);
|
|
12809
12637
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
12810
12638
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
@@ -12852,7 +12680,7 @@ function NumberField(props) {
|
|
|
12852
12680
|
...otherProps
|
|
12853
12681
|
};
|
|
12854
12682
|
const state = useNumberFieldState(useProps);
|
|
12855
|
-
const inputRef =
|
|
12683
|
+
const inputRef = useRef27(null);
|
|
12856
12684
|
const {
|
|
12857
12685
|
labelProps,
|
|
12858
12686
|
inputProps,
|
|
@@ -12904,7 +12732,7 @@ function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiv
|
|
|
12904
12732
|
}
|
|
12905
12733
|
|
|
12906
12734
|
// src/inputs/RadioGroupField.tsx
|
|
12907
|
-
import { Fragment as Fragment19, useMemo as useMemo19, useRef as
|
|
12735
|
+
import { Fragment as Fragment19, useMemo as useMemo19, useRef as useRef28 } from "react";
|
|
12908
12736
|
import { useFocusRing as useFocusRing6, useHover as useHover12, useRadio, useRadioGroup } from "react-aria";
|
|
12909
12737
|
import { useRadioGroupState } from "react-stately";
|
|
12910
12738
|
import { trussProps as trussProps44 } from "@homebound/truss/runtime";
|
|
@@ -12980,7 +12808,7 @@ function Radio(props) {
|
|
|
12980
12808
|
} = props;
|
|
12981
12809
|
const labelId = `${parentId}-${value}-label`;
|
|
12982
12810
|
const descriptionId = `${parentId}-${value}-description`;
|
|
12983
|
-
const ref =
|
|
12811
|
+
const ref = useRef28(null);
|
|
12984
12812
|
const {
|
|
12985
12813
|
inputProps,
|
|
12986
12814
|
isDisabled
|
|
@@ -13150,7 +12978,7 @@ var radioDisabled = {
|
|
|
13150
12978
|
|
|
13151
12979
|
// src/inputs/RichTextField.tsx
|
|
13152
12980
|
import DOMPurify from "dompurify";
|
|
13153
|
-
import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as
|
|
12981
|
+
import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as useRef29, useState as useState25 } from "react";
|
|
13154
12982
|
|
|
13155
12983
|
// src/inputs/RichTextField.mock.tsx
|
|
13156
12984
|
import { camelCase as camelCase3 } from "change-case";
|
|
@@ -13206,13 +13034,13 @@ function RichTextFieldImpl(props) {
|
|
|
13206
13034
|
fullWidth = fieldProps?.fullWidth ?? false
|
|
13207
13035
|
} = props;
|
|
13208
13036
|
const [editor, setEditor] = useState25();
|
|
13209
|
-
const editorElement =
|
|
13210
|
-
const currentHtml =
|
|
13211
|
-
const onChangeRef =
|
|
13037
|
+
const editorElement = useRef29();
|
|
13038
|
+
const currentHtml = useRef29(void 0);
|
|
13039
|
+
const onChangeRef = useRef29(onChange);
|
|
13212
13040
|
onChangeRef.current = onChange;
|
|
13213
|
-
const onBlurRef =
|
|
13041
|
+
const onBlurRef = useRef29(onBlur);
|
|
13214
13042
|
onBlurRef.current = onBlur;
|
|
13215
|
-
const onFocusRef =
|
|
13043
|
+
const onFocusRef = useRef29(onFocus);
|
|
13216
13044
|
onFocusRef.current = onFocus;
|
|
13217
13045
|
const id = useMemo20(() => {
|
|
13218
13046
|
if (readOnly) return;
|
|
@@ -13363,7 +13191,7 @@ function SelectField(props) {
|
|
|
13363
13191
|
}
|
|
13364
13192
|
|
|
13365
13193
|
// src/inputs/Switch.tsx
|
|
13366
|
-
import { useRef as
|
|
13194
|
+
import { useRef as useRef30 } from "react";
|
|
13367
13195
|
import { useFocusRing as useFocusRing7, useHover as useHover13, useSwitch, VisuallyHidden as VisuallyHidden5 } from "react-aria";
|
|
13368
13196
|
import { trussProps as trussProps46 } from "@homebound/truss/runtime";
|
|
13369
13197
|
import { jsx as jsx73, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -13396,7 +13224,7 @@ function Switch(props) {
|
|
|
13396
13224
|
...otherProps
|
|
13397
13225
|
};
|
|
13398
13226
|
const state = toToggleState(isSelected, onChange);
|
|
13399
|
-
const ref =
|
|
13227
|
+
const ref = useRef30(null);
|
|
13400
13228
|
const {
|
|
13401
13229
|
inputProps
|
|
13402
13230
|
} = useSwitch({
|
|
@@ -13548,7 +13376,7 @@ function switchCircleSelectedStyles(isCompact) {
|
|
|
13548
13376
|
}
|
|
13549
13377
|
|
|
13550
13378
|
// src/inputs/TextAreaField.tsx
|
|
13551
|
-
import { useRef as
|
|
13379
|
+
import { useRef as useRef31 } from "react";
|
|
13552
13380
|
import { mergeProps as mergeProps16, useTextField as useTextField3 } from "react-aria";
|
|
13553
13381
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
13554
13382
|
function TextAreaField(props) {
|
|
@@ -13566,8 +13394,8 @@ function TextAreaField(props) {
|
|
|
13566
13394
|
const isDisabled = !!disabled;
|
|
13567
13395
|
const isReadOnly = !!readOnly;
|
|
13568
13396
|
const textFieldProps = { ...otherProps, value, isDisabled, isReadOnly };
|
|
13569
|
-
const inputRef =
|
|
13570
|
-
const inputWrapRef =
|
|
13397
|
+
const inputRef = useRef31(null);
|
|
13398
|
+
const inputWrapRef = useRef31(null);
|
|
13571
13399
|
useGrowingTextField({ inputRef, inputWrapRef, value, maxLines });
|
|
13572
13400
|
const { labelProps, inputProps } = useTextField3(
|
|
13573
13401
|
{
|
|
@@ -13605,7 +13433,7 @@ function TextAreaField(props) {
|
|
|
13605
13433
|
}
|
|
13606
13434
|
|
|
13607
13435
|
// src/inputs/TextField.tsx
|
|
13608
|
-
import { useRef as
|
|
13436
|
+
import { useRef as useRef32 } from "react";
|
|
13609
13437
|
import { mergeProps as mergeProps17, useTextField as useTextField4 } from "react-aria";
|
|
13610
13438
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
13611
13439
|
function TextField(props) {
|
|
@@ -13633,7 +13461,7 @@ function TextField(props) {
|
|
|
13633
13461
|
validationState: errorMsg ? "invalid" : "valid",
|
|
13634
13462
|
value
|
|
13635
13463
|
};
|
|
13636
|
-
const inputRef =
|
|
13464
|
+
const inputRef = useRef32(null);
|
|
13637
13465
|
const { labelProps, inputProps } = useTextField4(
|
|
13638
13466
|
{
|
|
13639
13467
|
...textFieldProps,
|
|
@@ -13669,7 +13497,7 @@ function TextField(props) {
|
|
|
13669
13497
|
}
|
|
13670
13498
|
|
|
13671
13499
|
// src/inputs/ToggleButton.tsx
|
|
13672
|
-
import { useRef as
|
|
13500
|
+
import { useRef as useRef33, useState as useState26 } from "react";
|
|
13673
13501
|
import { useFocusRing as useFocusRing8, useHover as useHover14, usePress, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden6 } from "react-aria";
|
|
13674
13502
|
import { useToggleState as useToggleState3 } from "react-stately";
|
|
13675
13503
|
import { trussProps as trussProps47 } from "@homebound/truss/runtime";
|
|
@@ -13703,8 +13531,8 @@ function ToggleButton(props) {
|
|
|
13703
13531
|
return result;
|
|
13704
13532
|
}
|
|
13705
13533
|
});
|
|
13706
|
-
const labelRef =
|
|
13707
|
-
const ref =
|
|
13534
|
+
const labelRef = useRef33(null);
|
|
13535
|
+
const ref = useRef33(null);
|
|
13708
13536
|
const tid = useTestIds(otherProps, label);
|
|
13709
13537
|
const {
|
|
13710
13538
|
isPressed: isPressedFromEvents,
|
|
@@ -13790,7 +13618,7 @@ var togglePressStyles = {
|
|
|
13790
13618
|
};
|
|
13791
13619
|
|
|
13792
13620
|
// src/inputs/ToggleChipGroup.tsx
|
|
13793
|
-
import { useRef as
|
|
13621
|
+
import { useRef as useRef34 } from "react";
|
|
13794
13622
|
import { useCheckboxGroup as useCheckboxGroup2, useCheckboxGroupItem as useCheckboxGroupItem2, useFocusRing as useFocusRing9, VisuallyHidden as VisuallyHidden7 } from "react-aria";
|
|
13795
13623
|
import { useCheckboxGroupState as useCheckboxGroupState2 } from "react-stately";
|
|
13796
13624
|
import { trussProps as trussProps48 } from "@homebound/truss/runtime";
|
|
@@ -13863,7 +13691,7 @@ function ToggleChip2(props) {
|
|
|
13863
13691
|
} = props;
|
|
13864
13692
|
const isDisabled = !!disabled;
|
|
13865
13693
|
const isReadOnly = !!readonly;
|
|
13866
|
-
const ref =
|
|
13694
|
+
const ref = useRef34(null);
|
|
13867
13695
|
const {
|
|
13868
13696
|
inputProps
|
|
13869
13697
|
} = useCheckboxGroupItem2({
|
|
@@ -14913,9 +14741,9 @@ function maybeApply(maybeFn) {
|
|
|
14913
14741
|
}
|
|
14914
14742
|
|
|
14915
14743
|
// src/components/Table/hooks/useColumnResizeHandlers.ts
|
|
14916
|
-
import { useCallback as useCallback12, useRef as
|
|
14744
|
+
import { useCallback as useCallback12, useRef as useRef35 } from "react";
|
|
14917
14745
|
function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
|
|
14918
|
-
const hasLockedColumnsRef =
|
|
14746
|
+
const hasLockedColumnsRef = useRef35(false);
|
|
14919
14747
|
const distributeAdjustment = useCallback12(
|
|
14920
14748
|
(rightColumns, totalRightWidth, adjustment) => {
|
|
14921
14749
|
const updates = {};
|
|
@@ -15044,7 +14872,7 @@ function useScrollStorage(tableId, enabled = true) {
|
|
|
15044
14872
|
|
|
15045
14873
|
// src/components/Table/hooks/useSetupColumnSizes.ts
|
|
15046
14874
|
import { useResizeObserver } from "@react-aria/utils";
|
|
15047
|
-
import { useCallback as useCallback14, useEffect as useEffect18, useRef as
|
|
14875
|
+
import { useCallback as useCallback14, useEffect as useEffect18, useRef as useRef36, useState as useState28 } from "react";
|
|
15048
14876
|
|
|
15049
14877
|
// src/components/Table/hooks/useColumnResizing.ts
|
|
15050
14878
|
import { useCallback as useCallback13, useEffect as useEffect17, useState as useState27 } from "react";
|
|
@@ -15103,9 +14931,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15103
14931
|
const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
|
|
15104
14932
|
disableColumnResizing ? void 0 : visibleColumnsStorageKey
|
|
15105
14933
|
);
|
|
15106
|
-
const calculateImmediately =
|
|
14934
|
+
const calculateImmediately = useRef36(true);
|
|
15107
14935
|
const [tableWidth, setTableWidth] = useState28();
|
|
15108
|
-
const prevTableWidthRef =
|
|
14936
|
+
const prevTableWidthRef = useRef36(tableWidth);
|
|
15109
14937
|
const [columnSizes, setColumnSizes] = useState28(
|
|
15110
14938
|
calcColumnSizes(columns, tableWidth, style.minWidthPx, expandedColumnIds, resizedWidths)
|
|
15111
14939
|
);
|
|
@@ -15172,9 +15000,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15172
15000
|
}
|
|
15173
15001
|
|
|
15174
15002
|
// src/hooks/useRenderCount.ts
|
|
15175
|
-
import { useCallback as useCallback15, useRef as
|
|
15003
|
+
import { useCallback as useCallback15, useRef as useRef37 } from "react";
|
|
15176
15004
|
function useRenderCount() {
|
|
15177
|
-
const ref =
|
|
15005
|
+
const ref = useRef37(/* @__PURE__ */ new Map());
|
|
15178
15006
|
const getCount = useCallback15((id) => {
|
|
15179
15007
|
const count = ref.current.get(id) || 1;
|
|
15180
15008
|
ref.current.set(id, count + 1);
|
|
@@ -15231,10 +15059,10 @@ function GridTable(props) {
|
|
|
15231
15059
|
disableColumnResizing = false
|
|
15232
15060
|
} = props;
|
|
15233
15061
|
const columnsWithIds = useMemo24(() => assignDefaultColumnIds(_columns), [_columns]);
|
|
15234
|
-
const virtuosoRef =
|
|
15235
|
-
const virtuosoRangeRef =
|
|
15236
|
-
const resizeRef =
|
|
15237
|
-
const tableContainerRef =
|
|
15062
|
+
const virtuosoRef = useRef38(null);
|
|
15063
|
+
const virtuosoRangeRef = useRef38(null);
|
|
15064
|
+
const resizeRef = useRef38(null);
|
|
15065
|
+
const tableContainerRef = useRef38(null);
|
|
15238
15066
|
const api = useMemo24(
|
|
15239
15067
|
() => {
|
|
15240
15068
|
const api2 = props.api ?? new GridTableApiImpl();
|
|
@@ -15249,7 +15077,7 @@ function GridTable(props) {
|
|
|
15249
15077
|
[props.api]
|
|
15250
15078
|
);
|
|
15251
15079
|
const [draggedRow, _setDraggedRow] = useState29(void 0);
|
|
15252
|
-
const draggedRowRef =
|
|
15080
|
+
const draggedRowRef = useRef38(draggedRow);
|
|
15253
15081
|
const setDraggedRow = (row) => {
|
|
15254
15082
|
draggedRowRef.current = row;
|
|
15255
15083
|
_setDraggedRow(row);
|
|
@@ -16095,17 +15923,17 @@ var variantStyles2 = {
|
|
|
16095
15923
|
};
|
|
16096
15924
|
|
|
16097
15925
|
// src/components/BeamContext.tsx
|
|
16098
|
-
import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as
|
|
15926
|
+
import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as useRef45 } from "react";
|
|
16099
15927
|
import { OverlayProvider } from "react-aria";
|
|
16100
15928
|
|
|
16101
15929
|
// src/components/Modal/Modal.tsx
|
|
16102
15930
|
import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
|
|
16103
|
-
import { useCallback as useCallback17, useEffect as useEffect23, useRef as
|
|
15931
|
+
import { useCallback as useCallback17, useEffect as useEffect23, useRef as useRef40, useState as useState32 } from "react";
|
|
16104
15932
|
import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
|
|
16105
15933
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16106
15934
|
|
|
16107
15935
|
// src/components/Modal/useModal.tsx
|
|
16108
|
-
import { useEffect as useEffect22, useMemo as useMemo27, useRef as
|
|
15936
|
+
import { useEffect as useEffect22, useMemo as useMemo27, useRef as useRef39 } from "react";
|
|
16109
15937
|
|
|
16110
15938
|
// src/components/Modal/ModalContext.tsx
|
|
16111
15939
|
import { createContext as createContext4, useContext as useContext13, useMemo as useMemo26 } from "react";
|
|
@@ -16123,8 +15951,8 @@ function useModalContext() {
|
|
|
16123
15951
|
function useModal() {
|
|
16124
15952
|
const { modalState, modalCanCloseChecks } = useBeamContext();
|
|
16125
15953
|
const { inModal } = useModalContext();
|
|
16126
|
-
const lastCanClose =
|
|
16127
|
-
const api =
|
|
15954
|
+
const lastCanClose = useRef39();
|
|
15955
|
+
const api = useRef39();
|
|
16128
15956
|
useEffect22(() => {
|
|
16129
15957
|
return () => {
|
|
16130
15958
|
modalCanCloseChecks.current = modalCanCloseChecks.current.filter((c) => c !== lastCanClose.current);
|
|
@@ -16177,7 +16005,7 @@ function Modal(props) {
|
|
|
16177
16005
|
allowClosing = true
|
|
16178
16006
|
} = props;
|
|
16179
16007
|
const isFixedHeight = typeof size !== "string";
|
|
16180
|
-
const ref =
|
|
16008
|
+
const ref = useRef40(null);
|
|
16181
16009
|
const {
|
|
16182
16010
|
modalBodyDiv,
|
|
16183
16011
|
modalFooterDiv,
|
|
@@ -16208,9 +16036,9 @@ function Modal(props) {
|
|
|
16208
16036
|
role: "dialog"
|
|
16209
16037
|
}, ref);
|
|
16210
16038
|
const [[width2, height], setSize] = useState32(getSize(size));
|
|
16211
|
-
const modalBodyRef =
|
|
16212
|
-
const modalFooterRef =
|
|
16213
|
-
const modalHeaderRef =
|
|
16039
|
+
const modalBodyRef = useRef40(null);
|
|
16040
|
+
const modalFooterRef = useRef40(null);
|
|
16041
|
+
const modalHeaderRef = useRef40(null);
|
|
16214
16042
|
const testId = useTestIds({}, testIdPrefix);
|
|
16215
16043
|
usePreventScroll();
|
|
16216
16044
|
const {
|
|
@@ -16506,7 +16334,7 @@ function useSnackbarContext() {
|
|
|
16506
16334
|
|
|
16507
16335
|
// src/components/SuperDrawer/SuperDrawer.tsx
|
|
16508
16336
|
import { AnimatePresence, motion } from "framer-motion";
|
|
16509
|
-
import { useEffect as useEffect24, useRef as
|
|
16337
|
+
import { useEffect as useEffect24, useRef as useRef41 } from "react";
|
|
16510
16338
|
import { createPortal as createPortal4 } from "react-dom";
|
|
16511
16339
|
|
|
16512
16340
|
// src/components/SuperDrawer/utils.ts
|
|
@@ -16528,7 +16356,7 @@ function SuperDrawer() {
|
|
|
16528
16356
|
const {
|
|
16529
16357
|
closeDrawer
|
|
16530
16358
|
} = useSuperDrawer();
|
|
16531
|
-
const headerRef =
|
|
16359
|
+
const headerRef = useRef41(null);
|
|
16532
16360
|
const testId = useTestIds({}, "superDrawer");
|
|
16533
16361
|
const currentContent = contentStack.current[contentStack.current.length - 1]?.opts;
|
|
16534
16362
|
const {
|
|
@@ -16623,7 +16451,7 @@ function SuperDrawer() {
|
|
|
16623
16451
|
}
|
|
16624
16452
|
|
|
16625
16453
|
// src/components/Layout/FormPageLayout.tsx
|
|
16626
|
-
import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as
|
|
16454
|
+
import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as useRef42, useState as useState39 } from "react";
|
|
16627
16455
|
import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
|
|
16628
16456
|
|
|
16629
16457
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -18291,7 +18119,7 @@ function SectionNavLink(props) {
|
|
|
18291
18119
|
});
|
|
18292
18120
|
}, [sectionRef]);
|
|
18293
18121
|
const tids = useTestIds(props);
|
|
18294
|
-
const buttonRef =
|
|
18122
|
+
const buttonRef = useRef42(null);
|
|
18295
18123
|
const {
|
|
18296
18124
|
buttonProps,
|
|
18297
18125
|
isPressed
|
|
@@ -18441,7 +18269,7 @@ function invertSpacing(value) {
|
|
|
18441
18269
|
import React17, { useEffect as useEffect27, useMemo as useMemo38, useState as useState42 } from "react";
|
|
18442
18270
|
|
|
18443
18271
|
// src/components/ButtonMenu.tsx
|
|
18444
|
-
import { useRef as
|
|
18272
|
+
import { useRef as useRef43 } from "react";
|
|
18445
18273
|
import { useMenuTrigger as useMenuTrigger2 } from "react-aria";
|
|
18446
18274
|
import { useMenuTriggerState as useMenuTriggerState2 } from "react-stately";
|
|
18447
18275
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
@@ -18453,7 +18281,7 @@ function ButtonMenu(props) {
|
|
|
18453
18281
|
onChange = props.onChange;
|
|
18454
18282
|
}
|
|
18455
18283
|
const state = useMenuTriggerState2({ isOpen: defaultOpen });
|
|
18456
|
-
const buttonRef =
|
|
18284
|
+
const buttonRef = useRef43(null);
|
|
18457
18285
|
const { menuTriggerProps, menuProps } = useMenuTrigger2({ isDisabled: !!disabled }, state, buttonRef);
|
|
18458
18286
|
const tid = useTestIds(
|
|
18459
18287
|
props,
|
|
@@ -18560,16 +18388,8 @@ function dateFilter(props) {
|
|
|
18560
18388
|
}
|
|
18561
18389
|
var anyOption = {};
|
|
18562
18390
|
var DateFilter = class extends BaseFilter {
|
|
18563
|
-
hydrate(value) {
|
|
18564
|
-
if (!isDateFilterValue(value)) return void 0;
|
|
18565
|
-
const hydratedValue = parsePersistedPlainDate(value.value);
|
|
18566
|
-
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18567
|
-
}
|
|
18568
|
-
dehydrate(value) {
|
|
18569
|
-
return value ? { op: value.op, value: dehydratePlainDate(value.value) } : void 0;
|
|
18570
|
-
}
|
|
18571
18391
|
render(value, setValue, tid, inModal, vertical) {
|
|
18572
|
-
const { label, operations, getOperationValue, getOperationLabel
|
|
18392
|
+
const { label, operations, getOperationValue, getOperationLabel } = this.props;
|
|
18573
18393
|
return /* @__PURE__ */ jsxs65(Fragment28, { children: [
|
|
18574
18394
|
vertical && /* @__PURE__ */ jsx127(Label, { label }),
|
|
18575
18395
|
/* @__PURE__ */ jsxs65(CompoundField, { children: [
|
|
@@ -18586,8 +18406,8 @@ var DateFilter = class extends BaseFilter {
|
|
|
18586
18406
|
getOptionLabel: (o) => o === anyOption ? "Any" : getOperationLabel(o),
|
|
18587
18407
|
value: value?.op,
|
|
18588
18408
|
onSelect: (op) => (
|
|
18589
|
-
// default the selected date to
|
|
18590
|
-
setValue(op ? { op, value: value?.value
|
|
18409
|
+
// default the selected date to today if it doesn't exist in the filter's value
|
|
18410
|
+
setValue(op ? { op, value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date() } : void 0)
|
|
18591
18411
|
),
|
|
18592
18412
|
label: inModal ? `${label} date filter operation` : label,
|
|
18593
18413
|
labelStyle: !inModal && !vertical ? "inline" : inModal || vertical ? "hidden" : "above",
|
|
@@ -18599,13 +18419,9 @@ var DateFilter = class extends BaseFilter {
|
|
|
18599
18419
|
DateField,
|
|
18600
18420
|
{
|
|
18601
18421
|
labelStyle: "inline",
|
|
18602
|
-
value: value?.value
|
|
18422
|
+
value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date(),
|
|
18603
18423
|
label: "Date",
|
|
18604
|
-
onChange: (d) => {
|
|
18605
|
-
if (d && value) {
|
|
18606
|
-
setValue({ ...value, value: d });
|
|
18607
|
-
}
|
|
18608
|
-
},
|
|
18424
|
+
onChange: (d) => setValue({ ...value, value: d }),
|
|
18609
18425
|
disabled: !value,
|
|
18610
18426
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18611
18427
|
}
|
|
@@ -18614,9 +18430,6 @@ var DateFilter = class extends BaseFilter {
|
|
|
18614
18430
|
] });
|
|
18615
18431
|
}
|
|
18616
18432
|
};
|
|
18617
|
-
function isDateFilterValue(value) {
|
|
18618
|
-
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18619
|
-
}
|
|
18620
18433
|
|
|
18621
18434
|
// src/components/Filters/DateRangeFilter.tsx
|
|
18622
18435
|
import { Fragment as Fragment29, jsx as jsx128, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -18624,17 +18437,6 @@ function dateRangeFilter(props) {
|
|
|
18624
18437
|
return (key) => new DateRangeFilter(key, props);
|
|
18625
18438
|
}
|
|
18626
18439
|
var DateRangeFilter = class extends BaseFilter {
|
|
18627
|
-
hydrate(value) {
|
|
18628
|
-
if (!isDateRangeFilterValue(value)) return void 0;
|
|
18629
|
-
const hydratedValue = hydrateDateRange(value.value);
|
|
18630
|
-
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18631
|
-
}
|
|
18632
|
-
dehydrate(value) {
|
|
18633
|
-
return value ? {
|
|
18634
|
-
op: value.op,
|
|
18635
|
-
value: value.value ? { from: dehydratePlainDate(value.value.from), to: dehydratePlainDate(value.value.to) } : void 0
|
|
18636
|
-
} : void 0;
|
|
18637
|
-
}
|
|
18638
18440
|
render(value, setValue, tid, inModal, vertical) {
|
|
18639
18441
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
18640
18442
|
return /* @__PURE__ */ jsxs66(Fragment29, { children: [
|
|
@@ -18646,17 +18448,8 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18646
18448
|
isRangeFilterField: true,
|
|
18647
18449
|
placeholder: placeholderText,
|
|
18648
18450
|
label: testFieldLabel ?? "Date",
|
|
18649
|
-
value: value?.value,
|
|
18650
|
-
onChange: (d) => {
|
|
18651
|
-
if (!d) {
|
|
18652
|
-
setValue(void 0);
|
|
18653
|
-
return;
|
|
18654
|
-
}
|
|
18655
|
-
const op = value?.op ?? defaultValue?.op;
|
|
18656
|
-
if (op !== void 0) {
|
|
18657
|
-
setValue({ op, value: d });
|
|
18658
|
-
}
|
|
18659
|
-
},
|
|
18451
|
+
value: value?.value ? { from: new Date(value.value.from), to: new Date(value.value.to) } : void 0,
|
|
18452
|
+
onChange: (d) => d ? setValue({ op: defaultValue?.op, value: d }) : setValue(void 0),
|
|
18660
18453
|
disabledDays,
|
|
18661
18454
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18662
18455
|
}
|
|
@@ -18664,17 +18457,6 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18664
18457
|
] });
|
|
18665
18458
|
}
|
|
18666
18459
|
};
|
|
18667
|
-
function isDateRangeFilterValue(value) {
|
|
18668
|
-
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18669
|
-
}
|
|
18670
|
-
function hydrateDateRange(value) {
|
|
18671
|
-
if (typeof value !== "object" || value === null) return void 0;
|
|
18672
|
-
const { from, to } = value;
|
|
18673
|
-
const hydratedFrom = parsePersistedPlainDate(from);
|
|
18674
|
-
const hydratedTo = parsePersistedPlainDate(to);
|
|
18675
|
-
if (hydratedFrom === void 0 && hydratedTo === void 0) return void 0;
|
|
18676
|
-
return { from: hydratedFrom, to: hydratedTo };
|
|
18677
|
-
}
|
|
18678
18460
|
|
|
18679
18461
|
// src/components/Filters/MultiFilter.tsx
|
|
18680
18462
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -19236,7 +19018,7 @@ function toPageNumberSize(page) {
|
|
|
19236
19018
|
}
|
|
19237
19019
|
|
|
19238
19020
|
// src/components/Table/components/EditColumnsButton.tsx
|
|
19239
|
-
import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as
|
|
19021
|
+
import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as useRef44 } from "react";
|
|
19240
19022
|
import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
|
|
19241
19023
|
import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
|
|
19242
19024
|
import { jsx as jsx141, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -19251,7 +19033,7 @@ function EditColumnsButton(props) {
|
|
|
19251
19033
|
const state = useMenuTriggerState3({
|
|
19252
19034
|
isOpen: defaultOpen
|
|
19253
19035
|
});
|
|
19254
|
-
const buttonRef =
|
|
19036
|
+
const buttonRef = useRef44(null);
|
|
19255
19037
|
const {
|
|
19256
19038
|
menuTriggerProps
|
|
19257
19039
|
} = useMenuTrigger3({
|
|
@@ -19480,10 +19262,10 @@ function useGridTableLayoutState({
|
|
|
19480
19262
|
});
|
|
19481
19263
|
useEffect27(() => {
|
|
19482
19264
|
if (page.limit !== persistedPageSize) setPersistedPageSize(page.limit);
|
|
19483
|
-
setPage((prev) =>
|
|
19265
|
+
setPage((prev) => ({
|
|
19484
19266
|
...prev,
|
|
19485
19267
|
offset: 0
|
|
19486
|
-
});
|
|
19268
|
+
}));
|
|
19487
19269
|
}, [page.limit, persistedPageSize, setPersistedPageSize, filter, searchString]);
|
|
19488
19270
|
return {
|
|
19489
19271
|
filter,
|
|
@@ -19744,18 +19526,18 @@ var BeamContext = createContext7({
|
|
|
19744
19526
|
});
|
|
19745
19527
|
function BeamProvider({ children, ...presentationProps }) {
|
|
19746
19528
|
const [, tick] = useReducer((prev) => prev + 1, 0);
|
|
19747
|
-
const modalRef =
|
|
19529
|
+
const modalRef = useRef45();
|
|
19748
19530
|
const modalHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19749
19531
|
const modalBodyDiv = useMemo40(() => {
|
|
19750
19532
|
const el = document.createElement("div");
|
|
19751
19533
|
el.style.height = "100%";
|
|
19752
19534
|
return el;
|
|
19753
19535
|
}, []);
|
|
19754
|
-
const modalCanCloseChecksRef =
|
|
19536
|
+
const modalCanCloseChecksRef = useRef45([]);
|
|
19755
19537
|
const modalFooterDiv = useMemo40(() => document.createElement("div"), []);
|
|
19756
|
-
const drawerContentStackRef =
|
|
19757
|
-
const drawerCanCloseChecks =
|
|
19758
|
-
const drawerCanCloseDetailsChecks =
|
|
19538
|
+
const drawerContentStackRef = useRef45([]);
|
|
19539
|
+
const drawerCanCloseChecks = useRef45([]);
|
|
19540
|
+
const drawerCanCloseDetailsChecks = useRef45([]);
|
|
19759
19541
|
const sdHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19760
19542
|
const context = useMemo40(() => {
|
|
19761
19543
|
return {
|
|
@@ -19798,14 +19580,14 @@ function useBeamContext() {
|
|
|
19798
19580
|
}
|
|
19799
19581
|
|
|
19800
19582
|
// src/components/ButtonDatePicker.tsx
|
|
19801
|
-
import { useRef as
|
|
19583
|
+
import { useRef as useRef46 } from "react";
|
|
19802
19584
|
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
19803
19585
|
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
19804
19586
|
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
19805
19587
|
function ButtonDatePicker(props) {
|
|
19806
19588
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
19807
19589
|
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
19808
|
-
const buttonRef =
|
|
19590
|
+
const buttonRef = useRef46(null);
|
|
19809
19591
|
const {
|
|
19810
19592
|
menuTriggerProps,
|
|
19811
19593
|
menuProps: { autoFocus: _af, ...menuProps }
|
|
@@ -19828,7 +19610,7 @@ function ButtonDatePicker(props) {
|
|
|
19828
19610
|
}
|
|
19829
19611
|
|
|
19830
19612
|
// src/components/ButtonGroup.tsx
|
|
19831
|
-
import { useRef as
|
|
19613
|
+
import { useRef as useRef47 } from "react";
|
|
19832
19614
|
import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
|
|
19833
19615
|
import { trussProps as trussProps73 } from "@homebound/truss/runtime";
|
|
19834
19616
|
import { jsx as jsx151, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
@@ -19876,7 +19658,7 @@ function GroupButton(props) {
|
|
|
19876
19658
|
isDisabled: !!disabled,
|
|
19877
19659
|
...otherProps
|
|
19878
19660
|
};
|
|
19879
|
-
const ref =
|
|
19661
|
+
const ref = useRef47(null);
|
|
19880
19662
|
const {
|
|
19881
19663
|
buttonProps,
|
|
19882
19664
|
isPressed
|
|
@@ -19999,7 +19781,7 @@ import { useHover as useHover16 } from "react-aria";
|
|
|
19999
19781
|
|
|
20000
19782
|
// src/components/Tag.tsx
|
|
20001
19783
|
import { useResizeObserver as useResizeObserver4 } from "@react-aria/utils";
|
|
20002
|
-
import { useRef as
|
|
19784
|
+
import { useRef as useRef48, useState as useState44 } from "react";
|
|
20003
19785
|
import { trussProps as trussProps74 } from "@homebound/truss/runtime";
|
|
20004
19786
|
import { jsx as jsx152, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
20005
19787
|
function Tag(props) {
|
|
@@ -20013,7 +19795,7 @@ function Tag(props) {
|
|
|
20013
19795
|
const typeStyles2 = getStyles(type);
|
|
20014
19796
|
const tid = useTestIds(otherProps);
|
|
20015
19797
|
const [showTooltip, setShowTooltip] = useState44(false);
|
|
20016
|
-
const ref =
|
|
19798
|
+
const ref = useRef48(null);
|
|
20017
19799
|
useResizeObserver4({
|
|
20018
19800
|
ref,
|
|
20019
19801
|
onResize: () => {
|
|
@@ -20222,7 +20004,7 @@ function Copy(props) {
|
|
|
20222
20004
|
|
|
20223
20005
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
20224
20006
|
import equal2 from "fast-deep-equal";
|
|
20225
|
-
import { useCallback as useCallback24, useRef as
|
|
20007
|
+
import { useCallback as useCallback24, useRef as useRef49 } from "react";
|
|
20226
20008
|
|
|
20227
20009
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
20228
20010
|
import { createContext as createContext8, useContext as useContext18 } from "react";
|
|
@@ -20245,12 +20027,12 @@ function DnDGrid(props) {
|
|
|
20245
20027
|
onReorder,
|
|
20246
20028
|
activeItemStyles
|
|
20247
20029
|
} = props;
|
|
20248
|
-
const gridEl =
|
|
20249
|
-
const dragEl =
|
|
20250
|
-
const cloneEl =
|
|
20251
|
-
const initialOrder =
|
|
20252
|
-
const reorderViaKeyboard =
|
|
20253
|
-
const transformFrom =
|
|
20030
|
+
const gridEl = useRef49(null);
|
|
20031
|
+
const dragEl = useRef49();
|
|
20032
|
+
const cloneEl = useRef49();
|
|
20033
|
+
const initialOrder = useRef49();
|
|
20034
|
+
const reorderViaKeyboard = useRef49(false);
|
|
20035
|
+
const transformFrom = useRef49({
|
|
20254
20036
|
x: 0,
|
|
20255
20037
|
y: 0
|
|
20256
20038
|
});
|
|
@@ -20712,14 +20494,14 @@ function HbSpinnerProvider({
|
|
|
20712
20494
|
|
|
20713
20495
|
// src/components/MaxLines.tsx
|
|
20714
20496
|
import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
20715
|
-
import { useCallback as useCallback25, useEffect as useEffect30, useRef as
|
|
20497
|
+
import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef50, useState as useState45 } from "react";
|
|
20716
20498
|
import { trussProps as trussProps80 } from "@homebound/truss/runtime";
|
|
20717
20499
|
import { jsx as jsx160, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
20718
20500
|
function MaxLines({
|
|
20719
20501
|
maxLines,
|
|
20720
20502
|
children
|
|
20721
20503
|
}) {
|
|
20722
|
-
const elRef =
|
|
20504
|
+
const elRef = useRef50(null);
|
|
20723
20505
|
const [hasMore, setHasMore] = useState45(false);
|
|
20724
20506
|
const [expanded, setExpanded] = useState45(false);
|
|
20725
20507
|
useLayoutEffect2(() => {
|
|
@@ -20755,7 +20537,7 @@ function MaxLines({
|
|
|
20755
20537
|
|
|
20756
20538
|
// src/components/ScrollShadows.tsx
|
|
20757
20539
|
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
20758
|
-
import { useCallback as useCallback26, useMemo as useMemo47, useRef as
|
|
20540
|
+
import { useCallback as useCallback26, useMemo as useMemo47, useRef as useRef51, useState as useState46 } from "react";
|
|
20759
20541
|
import { trussProps as trussProps81 } from "@homebound/truss/runtime";
|
|
20760
20542
|
import { jsx as jsx161, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
20761
20543
|
function ScrollShadows(props) {
|
|
@@ -20775,7 +20557,7 @@ function ScrollShadows(props) {
|
|
|
20775
20557
|
}
|
|
20776
20558
|
const [showStartShadow, setShowStartShadow] = useState46(false);
|
|
20777
20559
|
const [showEndShadow, setShowEndShadow] = useState46(false);
|
|
20778
|
-
const scrollRef =
|
|
20560
|
+
const scrollRef = useRef51(null);
|
|
20779
20561
|
const [startShadowStyles, endShadowStyles] = useMemo47(() => {
|
|
20780
20562
|
const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
|
|
20781
20563
|
const commonStyles = {
|
|
@@ -20948,7 +20730,7 @@ function useSnackbar() {
|
|
|
20948
20730
|
var snackbarId = 1;
|
|
20949
20731
|
|
|
20950
20732
|
// src/components/Stepper.tsx
|
|
20951
|
-
import { useRef as
|
|
20733
|
+
import { useRef as useRef52 } from "react";
|
|
20952
20734
|
import { useButton as useButton11, useFocusRing as useFocusRing14, useHover as useHover18 } from "react-aria";
|
|
20953
20735
|
import { trussProps as trussProps82 } from "@homebound/truss/runtime";
|
|
20954
20736
|
import { jsx as jsx162, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
@@ -21026,7 +20808,7 @@ function StepButton(props) {
|
|
|
21026
20808
|
onPress: onClick,
|
|
21027
20809
|
isDisabled: disabled
|
|
21028
20810
|
};
|
|
21029
|
-
const ref =
|
|
20811
|
+
const ref = useRef52(null);
|
|
21030
20812
|
const {
|
|
21031
20813
|
buttonProps,
|
|
21032
20814
|
isPressed
|
|
@@ -21420,7 +21202,7 @@ function visit(rows, fn) {
|
|
|
21420
21202
|
|
|
21421
21203
|
// src/components/Tabs.tsx
|
|
21422
21204
|
import { camelCase as camelCase5 } from "change-case";
|
|
21423
|
-
import { useEffect as useEffect32, useMemo as useMemo49, useRef as
|
|
21205
|
+
import { useEffect as useEffect32, useMemo as useMemo49, useRef as useRef53, useState as useState47 } from "react";
|
|
21424
21206
|
import { mergeProps as mergeProps26, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
|
|
21425
21207
|
import { matchPath, Route } from "react-router";
|
|
21426
21208
|
import { Link as Link5, useLocation } from "react-router-dom";
|
|
@@ -21479,7 +21261,7 @@ function Tabs(props) {
|
|
|
21479
21261
|
} = useFocusRing15();
|
|
21480
21262
|
const tid = useTestIds(others, "tabs");
|
|
21481
21263
|
const [active, setActive] = useState47(selected);
|
|
21482
|
-
const ref =
|
|
21264
|
+
const ref = useRef53(null);
|
|
21483
21265
|
useEffect32(() => setActive(selected), [selected]);
|
|
21484
21266
|
function onKeyUp(e) {
|
|
21485
21267
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
@@ -21877,7 +21659,6 @@ export {
|
|
|
21877
21659
|
filterTestIdPrefix,
|
|
21878
21660
|
formatDate,
|
|
21879
21661
|
formatDateRange,
|
|
21880
|
-
formatPlainDate,
|
|
21881
21662
|
formatValue,
|
|
21882
21663
|
generateColumnId,
|
|
21883
21664
|
getAlignment,
|