@homebound/beam 3.2.0-alpha.3 → 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 +155 -393
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -63
- package/dist/index.d.ts +49 -63
- package/dist/index.js +295 -532
- 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();
|
|
@@ -7516,7 +7347,6 @@ var RowState = class {
|
|
|
7516
7347
|
};
|
|
7517
7348
|
|
|
7518
7349
|
// src/components/Table/utils/sortRows.ts
|
|
7519
|
-
import { Temporal as Temporal2 } from "temporal-polyfill";
|
|
7520
7350
|
function sortRows(columns, rows, sortState, caseSensitive) {
|
|
7521
7351
|
const fn = sortFn(columns, sortState, caseSensitive);
|
|
7522
7352
|
const sorted = [...rows].sort(fn);
|
|
@@ -7581,7 +7411,7 @@ function sortValue(value, caseSensitive) {
|
|
|
7581
7411
|
if (maybeFn instanceof Function) {
|
|
7582
7412
|
maybeFn = maybeFn();
|
|
7583
7413
|
}
|
|
7584
|
-
return
|
|
7414
|
+
return typeof maybeFn === "string" && !caseSensitive ? maybeFn.toLowerCase() : maybeFn;
|
|
7585
7415
|
}
|
|
7586
7416
|
function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, maybeContent) {
|
|
7587
7417
|
if (process.env.NODE_ENV !== "production" && !isHeader && sortOn === "client" && column2.clientSideSort !== false) {
|
|
@@ -7596,24 +7426,7 @@ function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, may
|
|
|
7596
7426
|
}
|
|
7597
7427
|
function canClientSideSort(value) {
|
|
7598
7428
|
const t = typeof value;
|
|
7599
|
-
return value === null || t === "undefined" || t === "number" || t === "string" || t === "
|
|
7600
|
-
}
|
|
7601
|
-
function normalizeSortValue(value, caseSensitive) {
|
|
7602
|
-
if (isPlainDate2(value)) {
|
|
7603
|
-
return value.toString();
|
|
7604
|
-
} else if (isZonedDateTime(value)) {
|
|
7605
|
-
return value.epochNanoseconds;
|
|
7606
|
-
} else if (typeof value === "string" && !caseSensitive) {
|
|
7607
|
-
return value.toLowerCase();
|
|
7608
|
-
} else {
|
|
7609
|
-
return value;
|
|
7610
|
-
}
|
|
7611
|
-
}
|
|
7612
|
-
function isPlainDate2(value) {
|
|
7613
|
-
return value instanceof Temporal2.PlainDate;
|
|
7614
|
-
}
|
|
7615
|
-
function isZonedDateTime(value) {
|
|
7616
|
-
return value instanceof Temporal2.ZonedDateTime;
|
|
7429
|
+
return value === null || t === "undefined" || t === "number" || t === "string" || t === "boolean" || value instanceof Date;
|
|
7617
7430
|
}
|
|
7618
7431
|
|
|
7619
7432
|
// src/components/Table/components/Row.tsx
|
|
@@ -7783,7 +7596,7 @@ function RowImpl(props) {
|
|
|
7783
7596
|
let foundFirstContentColumn = false;
|
|
7784
7597
|
let minStickyLeftOffset = 0;
|
|
7785
7598
|
let expandColumnHidden = false;
|
|
7786
|
-
const ref =
|
|
7599
|
+
const ref = useRef8(null);
|
|
7787
7600
|
const dragOverCallback = useCallback6((row2, evt) => onDragOver?.(row2, evt), [onDragOver]);
|
|
7788
7601
|
const onDragOverDebounced = useDebouncedCallback2(dragOverCallback, 100);
|
|
7789
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) => {
|
|
@@ -8549,7 +8362,7 @@ var textFieldBaseMultilineTopPadding = 11;
|
|
|
8549
8362
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
8550
8363
|
function MenuSearchField(props) {
|
|
8551
8364
|
const tid = useTestIds(props);
|
|
8552
|
-
const inputRef =
|
|
8365
|
+
const inputRef = useRef9(null);
|
|
8553
8366
|
const { labelProps, inputProps } = useTextField({ ...props }, inputRef);
|
|
8554
8367
|
return /* @__PURE__ */ jsx31(
|
|
8555
8368
|
TextFieldBase,
|
|
@@ -8633,7 +8446,7 @@ function Menu(props) {
|
|
|
8633
8446
|
keys !== "all" && onChange && onChange([...keys.values()].map((k) => k.toString())[0]);
|
|
8634
8447
|
}
|
|
8635
8448
|
});
|
|
8636
|
-
const menuRef =
|
|
8449
|
+
const menuRef = useRef10(null);
|
|
8637
8450
|
const {
|
|
8638
8451
|
menuProps
|
|
8639
8452
|
} = useMenu({
|
|
@@ -8675,7 +8488,7 @@ function Menu(props) {
|
|
|
8675
8488
|
}
|
|
8676
8489
|
|
|
8677
8490
|
// src/components/internal/MenuItem.tsx
|
|
8678
|
-
import { useRef as
|
|
8491
|
+
import { useRef as useRef13 } from "react";
|
|
8679
8492
|
import { useHover as useHover7, useMenuItem } from "react-aria";
|
|
8680
8493
|
import { useHistory } from "react-router";
|
|
8681
8494
|
import { Link as Link3 } from "react-router-dom";
|
|
@@ -8930,12 +8743,12 @@ var pressedOverlayCss = {
|
|
|
8930
8743
|
};
|
|
8931
8744
|
|
|
8932
8745
|
// src/components/ButtonModal.tsx
|
|
8933
|
-
import { useRef as
|
|
8746
|
+
import { useRef as useRef12 } from "react";
|
|
8934
8747
|
import { useMenuTrigger } from "react-aria";
|
|
8935
8748
|
import { useMenuTriggerState } from "react-stately";
|
|
8936
8749
|
|
|
8937
8750
|
// src/components/internal/OverlayTrigger.tsx
|
|
8938
|
-
import { useMemo as useMemo13, useRef as
|
|
8751
|
+
import { useMemo as useMemo13, useRef as useRef11 } from "react";
|
|
8939
8752
|
import { useOverlayPosition } from "react-aria";
|
|
8940
8753
|
|
|
8941
8754
|
// src/components/Button.tsx
|
|
@@ -9625,7 +9438,7 @@ function OverlayTrigger(props) {
|
|
|
9625
9438
|
}
|
|
9626
9439
|
}
|
|
9627
9440
|
}), [menuTriggerProps, state]);
|
|
9628
|
-
const popoverRef =
|
|
9441
|
+
const popoverRef = useRef11(null);
|
|
9629
9442
|
const {
|
|
9630
9443
|
overlayProps: positionProps
|
|
9631
9444
|
} = useOverlayPosition({
|
|
@@ -9687,7 +9500,7 @@ import { jsx as jsx39 } from "react/jsx-runtime";
|
|
|
9687
9500
|
function ButtonModal(props) {
|
|
9688
9501
|
const { storybookDefaultOpen, trigger, disabled, content, title } = props;
|
|
9689
9502
|
const state = useMenuTriggerState({ isOpen: storybookDefaultOpen });
|
|
9690
|
-
const buttonRef =
|
|
9503
|
+
const buttonRef = useRef12(null);
|
|
9691
9504
|
const { menuTriggerProps } = useMenuTrigger({ isDisabled: !!disabled }, state, buttonRef);
|
|
9692
9505
|
const tid = useTestIds(
|
|
9693
9506
|
props,
|
|
@@ -9771,7 +9584,7 @@ function MenuItemImpl(props) {
|
|
|
9771
9584
|
const isDisabled = Boolean(disabled);
|
|
9772
9585
|
const isSelected = state.selectionManager.selectedKeys.has(label);
|
|
9773
9586
|
const isFocused = state.selectionManager.focusedKey === item.key;
|
|
9774
|
-
const ref =
|
|
9587
|
+
const ref = useRef13(null);
|
|
9775
9588
|
const history = useHistory();
|
|
9776
9589
|
const {
|
|
9777
9590
|
hoverProps,
|
|
@@ -9918,7 +9731,7 @@ function Popover(props) {
|
|
|
9918
9731
|
}
|
|
9919
9732
|
|
|
9920
9733
|
// src/inputs/internal/ComboBoxBase.tsx
|
|
9921
|
-
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";
|
|
9922
9735
|
import { useButton as useButton7, useComboBox as useComboBox2, useFilter as useFilter4, useOverlayPosition as useOverlayPosition4 } from "react-aria";
|
|
9923
9736
|
import { Item as Item4, useComboBoxState as useComboBoxState2 } from "react-stately";
|
|
9924
9737
|
import { trussProps as trussProps39 } from "@homebound/truss/runtime";
|
|
@@ -9989,13 +9802,13 @@ function useGrowingTextField({ inputRef, inputWrapRef, value, disabled, maxLines
|
|
|
9989
9802
|
}
|
|
9990
9803
|
|
|
9991
9804
|
// src/inputs/TreeSelectField/TreeSelectField.tsx
|
|
9992
|
-
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";
|
|
9993
9806
|
import { useButton as useButton6, useComboBox, useFilter as useFilter3, useOverlayPosition as useOverlayPosition3 } from "react-aria";
|
|
9994
9807
|
import { Item as Item3, useComboBoxState } from "react-stately";
|
|
9995
9808
|
import { trussProps as trussProps37 } from "@homebound/truss/runtime";
|
|
9996
9809
|
|
|
9997
9810
|
// src/inputs/internal/ListBox.tsx
|
|
9998
|
-
import { useEffect as useEffect12, useRef as
|
|
9811
|
+
import { useEffect as useEffect12, useRef as useRef20, useState as useState16 } from "react";
|
|
9999
9812
|
import { useListBox } from "react-aria";
|
|
10000
9813
|
import { trussProps as trussProps36 } from "@homebound/truss/runtime";
|
|
10001
9814
|
|
|
@@ -10008,17 +9821,17 @@ import { useListBoxSection, useSeparator as useSeparator2 } from "react-aria";
|
|
|
10008
9821
|
import { trussProps as trussProps35 } from "@homebound/truss/runtime";
|
|
10009
9822
|
|
|
10010
9823
|
// src/inputs/internal/Option.tsx
|
|
10011
|
-
import { useRef as
|
|
9824
|
+
import { useRef as useRef16 } from "react";
|
|
10012
9825
|
import { mergeProps as mergeProps12, useHover as useHover8, useOption } from "react-aria";
|
|
10013
9826
|
|
|
10014
9827
|
// src/inputs/ChipSelectField.tsx
|
|
10015
9828
|
import { camelCase as camelCase2 } from "change-case";
|
|
10016
|
-
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";
|
|
10017
9830
|
import { mergeProps as mergeProps11, useButton as useButton5, useFocus as useFocus2, useOverlayPosition as useOverlayPosition2, useSelect } from "react-aria";
|
|
10018
9831
|
import { Item as Item2, Section as Section2, useListData, useSelectState } from "react-stately";
|
|
10019
9832
|
|
|
10020
9833
|
// src/inputs/ChipTextField.tsx
|
|
10021
|
-
import { useEffect as useEffect9, useRef as
|
|
9834
|
+
import { useEffect as useEffect9, useRef as useRef14, useState as useState14 } from "react";
|
|
10022
9835
|
import { useFocus } from "react-aria";
|
|
10023
9836
|
import { trussProps as trussProps28 } from "@homebound/truss/runtime";
|
|
10024
9837
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
@@ -10037,7 +9850,7 @@ function ChipTextField(props) {
|
|
|
10037
9850
|
const {
|
|
10038
9851
|
fieldProps
|
|
10039
9852
|
} = usePresentationContext();
|
|
10040
|
-
const valueRef =
|
|
9853
|
+
const valueRef = useRef14(value);
|
|
10041
9854
|
const tid = useTestIds(props, "chipField");
|
|
10042
9855
|
const [isFocused, setIsFocused] = useState14(false);
|
|
10043
9856
|
const {
|
|
@@ -10058,7 +9871,7 @@ function ChipTextField(props) {
|
|
|
10058
9871
|
onBlur: () => maybeCall(onBlur),
|
|
10059
9872
|
onFocusChange: setIsFocused
|
|
10060
9873
|
});
|
|
10061
|
-
const fieldRef =
|
|
9874
|
+
const fieldRef = useRef14(null);
|
|
10062
9875
|
useEffect9(
|
|
10063
9876
|
() => {
|
|
10064
9877
|
autoFocus && fieldRef.current?.focus();
|
|
@@ -10165,7 +9978,7 @@ function defaultOptionLabel(opt) {
|
|
|
10165
9978
|
import { trussProps as trussProps30 } from "@homebound/truss/runtime";
|
|
10166
9979
|
import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10167
9980
|
function ChipSelectField(props) {
|
|
10168
|
-
const firstRender =
|
|
9981
|
+
const firstRender = useRef15(true);
|
|
10169
9982
|
const {
|
|
10170
9983
|
fieldProps
|
|
10171
9984
|
} = usePresentationContext();
|
|
@@ -10223,10 +10036,10 @@ function ChipSelectField(props) {
|
|
|
10223
10036
|
} = useFocus2({
|
|
10224
10037
|
onFocusChange: setIsClearFocused
|
|
10225
10038
|
});
|
|
10226
|
-
const buttonRef =
|
|
10227
|
-
const popoverRef =
|
|
10228
|
-
const listBoxRef =
|
|
10229
|
-
const wrapperRef =
|
|
10039
|
+
const buttonRef = useRef15(null);
|
|
10040
|
+
const popoverRef = useRef15(null);
|
|
10041
|
+
const listBoxRef = useRef15(null);
|
|
10042
|
+
const wrapperRef = useRef15(null);
|
|
10230
10043
|
const listData = useListData({
|
|
10231
10044
|
initialItems: !onCreateNew ? options : [{
|
|
10232
10045
|
title: "Options",
|
|
@@ -10430,7 +10243,7 @@ function Option(props) {
|
|
|
10430
10243
|
scrollToIndex,
|
|
10431
10244
|
disabledReason
|
|
10432
10245
|
} = props;
|
|
10433
|
-
const ref =
|
|
10246
|
+
const ref = useRef16(null);
|
|
10434
10247
|
const {
|
|
10435
10248
|
hoverProps,
|
|
10436
10249
|
isHovered
|
|
@@ -10509,7 +10322,7 @@ function Option(props) {
|
|
|
10509
10322
|
|
|
10510
10323
|
// src/inputs/internal/VirtualizedOptions.tsx
|
|
10511
10324
|
import { getInteractionModality } from "@react-aria/interactions";
|
|
10512
|
-
import { useEffect as useEffect11, useRef as
|
|
10325
|
+
import { useEffect as useEffect11, useRef as useRef19 } from "react";
|
|
10513
10326
|
import { Virtuoso } from "react-virtuoso";
|
|
10514
10327
|
|
|
10515
10328
|
// src/inputs/internal/LoadingDots.tsx
|
|
@@ -10557,11 +10370,11 @@ function LoadingDots({
|
|
|
10557
10370
|
}
|
|
10558
10371
|
|
|
10559
10372
|
// src/inputs/TreeSelectField/TreeOption.tsx
|
|
10560
|
-
import { useRef as
|
|
10373
|
+
import { useRef as useRef18 } from "react";
|
|
10561
10374
|
import { useHover as useHover10, useOption as useOption2 } from "react-aria";
|
|
10562
10375
|
|
|
10563
10376
|
// src/inputs/CheckboxBase.tsx
|
|
10564
|
-
import { useRef as
|
|
10377
|
+
import { useRef as useRef17 } from "react";
|
|
10565
10378
|
import { mergeProps as mergeProps13, useFocusRing as useFocusRing5, useHover as useHover9, VisuallyHidden as VisuallyHidden3 } from "react-aria";
|
|
10566
10379
|
import { trussProps as trussProps33 } from "@homebound/truss/runtime";
|
|
10567
10380
|
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
@@ -10580,7 +10393,7 @@ function CheckboxBase(props) {
|
|
|
10580
10393
|
tooltip,
|
|
10581
10394
|
fullWidth = false
|
|
10582
10395
|
} = props;
|
|
10583
|
-
const ref =
|
|
10396
|
+
const ref = useRef17(null);
|
|
10584
10397
|
const {
|
|
10585
10398
|
isFocusVisible,
|
|
10586
10399
|
focusProps
|
|
@@ -10725,7 +10538,7 @@ function TreeOption(props) {
|
|
|
10725
10538
|
const leveledOption = item.value;
|
|
10726
10539
|
if (!leveledOption) return null;
|
|
10727
10540
|
const [option, level] = leveledOption;
|
|
10728
|
-
const ref =
|
|
10541
|
+
const ref = useRef18(null);
|
|
10729
10542
|
const {
|
|
10730
10543
|
hoverProps,
|
|
10731
10544
|
isHovered
|
|
@@ -10875,7 +10688,7 @@ function VirtualizedOptions(props) {
|
|
|
10875
10688
|
isTree,
|
|
10876
10689
|
allowCollapsing
|
|
10877
10690
|
} = props;
|
|
10878
|
-
const virtuosoRef =
|
|
10691
|
+
const virtuosoRef = useRef19(null);
|
|
10879
10692
|
const focusedKey = state.selectionManager.focusedKey;
|
|
10880
10693
|
const focusedItem = focusedKey != null ? state.collection.getItem(focusedKey) : null;
|
|
10881
10694
|
const selectedItem = state.selectionManager.selectedKeys.size > 0 ? state.collection.getItem([...state.selectionManager.selectedKeys.values()][0]) : void 0;
|
|
@@ -10889,6 +10702,7 @@ function VirtualizedOptions(props) {
|
|
|
10889
10702
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10890
10703
|
[focusedItem]
|
|
10891
10704
|
);
|
|
10705
|
+
const key = process.env.NODE_ENV === "test" ? items.length : "virtuoso";
|
|
10892
10706
|
return /* @__PURE__ */ jsx50(
|
|
10893
10707
|
Virtuoso,
|
|
10894
10708
|
{
|
|
@@ -10896,11 +10710,6 @@ function VirtualizedOptions(props) {
|
|
|
10896
10710
|
totalListHeightChanged: onListHeightChange,
|
|
10897
10711
|
totalCount: items.length,
|
|
10898
10712
|
...process.env.NODE_ENV === "test" ? {
|
|
10899
|
-
// In tests, we render all rows so assertions can see expands/async-loaded items. However,
|
|
10900
|
-
// the `initialItemCount` (next prop) is only applied on amount, so we set `key={items.length}`
|
|
10901
|
-
// to force a remount when our list changes -- and we only want/need this in tests, b/c otherwise
|
|
10902
|
-
// in production a Virtuoso remount causes visible flashing.
|
|
10903
|
-
key: items.length,
|
|
10904
10713
|
// We don't really need to set this, but it's handy for tests, which would otherwise render
|
|
10905
10714
|
// just 1 row. A better way to do this would be to jest.mock out Virtuoso with an impl that
|
|
10906
10715
|
// just rendered everything, but doing this for now.
|
|
@@ -10943,7 +10752,8 @@ function VirtualizedOptions(props) {
|
|
|
10943
10752
|
components: !loading ? {} : {
|
|
10944
10753
|
Footer: typeof loading === "function" ? loading : () => /* @__PURE__ */ jsx50(LoadingDots, { contrast })
|
|
10945
10754
|
}
|
|
10946
|
-
}
|
|
10755
|
+
},
|
|
10756
|
+
key
|
|
10947
10757
|
);
|
|
10948
10758
|
}
|
|
10949
10759
|
|
|
@@ -11033,9 +10843,9 @@ function ListBox(props) {
|
|
|
11033
10843
|
const isMultiSelect = state.selectionManager.selectionMode === "multiple";
|
|
11034
10844
|
const firstItem = state.collection.at(0);
|
|
11035
10845
|
const hasSections = firstItem && firstItem.type === "section";
|
|
11036
|
-
const selectedList =
|
|
11037
|
-
const firstRender =
|
|
11038
|
-
const virtuosoListHeight =
|
|
10846
|
+
const selectedList = useRef20(null);
|
|
10847
|
+
const firstRender = useRef20(true);
|
|
10848
|
+
const virtuosoListHeight = useRef20(0);
|
|
11039
10849
|
const onListHeightChange = (listHeight) => {
|
|
11040
10850
|
virtuosoListHeight.current = listHeight;
|
|
11041
10851
|
const height = (selectedList.current?.offsetHeight || 0) + listHeight;
|
|
@@ -11070,7 +10880,7 @@ function ListBox(props) {
|
|
|
11070
10880
|
boxShadow: "bshBasic h_bshHover"
|
|
11071
10881
|
} : {}
|
|
11072
10882
|
}), ref: listBoxRef, ...listBoxProps, children: [
|
|
11073
|
-
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))) }),
|
|
11074
10884
|
/* @__PURE__ */ jsx53("ul", { className: "p_0 m_0 lis_none fg1", children: hasSections ? [...state.collection].map((section) => /* @__PURE__ */ jsx53(
|
|
11075
10885
|
ListBoxSection,
|
|
11076
10886
|
{
|
|
@@ -11221,14 +11031,15 @@ function TreeSelectFieldBase(props) {
|
|
|
11221
11031
|
if (!maybeOption) return [];
|
|
11222
11032
|
return [maybeOption.option];
|
|
11223
11033
|
});
|
|
11224
|
-
const
|
|
11034
|
+
const selectedChipState = getSelectedChipState(initialOptions, selectedOptions, selectedKeys, chipDisplay, getOptionLabel, getOptionValue);
|
|
11225
11035
|
return {
|
|
11226
11036
|
selectedKeys: [...selectedKeys],
|
|
11227
11037
|
searchValue: void 0,
|
|
11228
|
-
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 : "",
|
|
11229
11039
|
selectedOptions,
|
|
11040
|
+
selectedChipOptions: selectedChipState.options,
|
|
11230
11041
|
allOptions: initialOptions,
|
|
11231
|
-
selectedOptionsLabels,
|
|
11042
|
+
selectedOptionsLabels: selectedChipState.labels,
|
|
11232
11043
|
optionsLoading: false,
|
|
11233
11044
|
allowCollapsing: true
|
|
11234
11045
|
};
|
|
@@ -11277,7 +11088,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11277
11088
|
}));
|
|
11278
11089
|
}
|
|
11279
11090
|
}, []);
|
|
11280
|
-
const firstOpen =
|
|
11091
|
+
const firstOpen = useRef21(true);
|
|
11281
11092
|
function onOpenChange(isOpen) {
|
|
11282
11093
|
if (firstOpen.current && isOpen) {
|
|
11283
11094
|
maybeInitLoad(options, setFieldState);
|
|
@@ -11327,7 +11138,9 @@ function TreeSelectFieldBase(props) {
|
|
|
11327
11138
|
searchValue: void 0,
|
|
11328
11139
|
allowCollapsing: true,
|
|
11329
11140
|
selectedKeys: [],
|
|
11330
|
-
selectedOptions: []
|
|
11141
|
+
selectedOptions: [],
|
|
11142
|
+
selectedChipOptions: [],
|
|
11143
|
+
selectedOptionsLabels: []
|
|
11331
11144
|
}));
|
|
11332
11145
|
onSelect({
|
|
11333
11146
|
all: {
|
|
@@ -11394,6 +11207,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11394
11207
|
const rootValues = rootOptions.map(getOptionValue);
|
|
11395
11208
|
const leafOptions = selectedOptions.filter((o) => !o.children || o.children.length === 0);
|
|
11396
11209
|
const leafValues = leafOptions.map(getOptionValue);
|
|
11210
|
+
const selectedChipState = getSelectedChipState(fieldState.allOptions, selectedOptions, selectedKeys, chipDisplay, getOptionLabel, getOptionValue);
|
|
11397
11211
|
setFieldState((prevState) => ({
|
|
11398
11212
|
...prevState,
|
|
11399
11213
|
// Since we reset the list of options upon selection changes, then set the `inputValue` to empty string to reflect that.
|
|
@@ -11401,7 +11215,8 @@ function TreeSelectFieldBase(props) {
|
|
|
11401
11215
|
searchValue: void 0,
|
|
11402
11216
|
selectedKeys: [...selectedKeys],
|
|
11403
11217
|
selectedOptions,
|
|
11404
|
-
|
|
11218
|
+
selectedChipOptions: selectedChipState.options,
|
|
11219
|
+
selectedOptionsLabels: selectedChipState.labels
|
|
11405
11220
|
}));
|
|
11406
11221
|
onSelect({
|
|
11407
11222
|
all: {
|
|
@@ -11434,12 +11249,12 @@ function TreeSelectFieldBase(props) {
|
|
|
11434
11249
|
}));
|
|
11435
11250
|
}
|
|
11436
11251
|
}
|
|
11437
|
-
const comboBoxRef =
|
|
11438
|
-
const triggerRef =
|
|
11439
|
-
const inputRef =
|
|
11440
|
-
const inputWrapRef =
|
|
11441
|
-
const listBoxRef =
|
|
11442
|
-
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);
|
|
11443
11258
|
const {
|
|
11444
11259
|
buttonProps: triggerProps,
|
|
11445
11260
|
inputProps,
|
|
@@ -11500,7 +11315,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11500
11315
|
onClose: () => state.toggle(),
|
|
11501
11316
|
isOpen: state.isOpen,
|
|
11502
11317
|
minWidth: 320,
|
|
11503
|
-
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 })
|
|
11504
11319
|
}
|
|
11505
11320
|
)
|
|
11506
11321
|
] });
|
|
@@ -11530,6 +11345,25 @@ function isOptionFullySelected(option, selectedKeys, disabledKeys, groupKeys, ge
|
|
|
11530
11345
|
if (!option.children || option.children.length === 0) return false;
|
|
11531
11346
|
return option.children.every((child) => isOptionFullySelected(child, selectedKeys, disabledKeys, groupKeys, getOptionValue));
|
|
11532
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
|
+
}
|
|
11533
11367
|
|
|
11534
11368
|
// src/inputs/internal/ComboBoxInput.tsx
|
|
11535
11369
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
@@ -11568,7 +11402,6 @@ function ComboBoxInput(props) {
|
|
|
11568
11402
|
} = useTreeSelectFieldProvider();
|
|
11569
11403
|
const [isFocused, setIsFocused] = useState18(false);
|
|
11570
11404
|
const isMultiSelect = state.selectionManager.selectionMode === "multiple";
|
|
11571
|
-
const showNumSelection = isMultiSelect && state.selectionManager.selectedKeys.size > 1;
|
|
11572
11405
|
const showChipSelection = isMultiSelect && state.selectionManager.selectedKeys.size > 0;
|
|
11573
11406
|
const showFieldDecoration = (!isMultiSelect || isMultiSelect && !isFocused) && fieldDecoration && selectedOptions.length === 1;
|
|
11574
11407
|
const multilineProps = allowWrap ? {
|
|
@@ -11576,6 +11409,8 @@ function ComboBoxInput(props) {
|
|
|
11576
11409
|
multiline: true
|
|
11577
11410
|
} : {};
|
|
11578
11411
|
const chipLabels = isTree ? selectedOptionsLabels || [] : selectedOptions.map((o) => getOptionLabel(o));
|
|
11412
|
+
const selectedChipCount = chipLabels.length;
|
|
11413
|
+
const showNumSelection = isMultiSelect && selectedChipCount > 1;
|
|
11579
11414
|
useGrowingTextField({
|
|
11580
11415
|
// This says: When using a multiselect, then only enable the growing textfield when we are focused on it.
|
|
11581
11416
|
// Because otherwise, we're not displaying the input element that dictates the height (we're displaying <Chips/>). This would cause incorrect calculations
|
|
@@ -11586,7 +11421,7 @@ function ComboBoxInput(props) {
|
|
|
11586
11421
|
});
|
|
11587
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 ? {
|
|
11588
11423
|
fontWeight: "fw5"
|
|
11589
|
-
} : 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({
|
|
11590
11425
|
...{
|
|
11591
11426
|
borderRadius: "br4",
|
|
11592
11427
|
outline: "outline0",
|
|
@@ -11790,7 +11625,7 @@ function ComboBoxBase(props) {
|
|
|
11790
11625
|
}));
|
|
11791
11626
|
}
|
|
11792
11627
|
}
|
|
11793
|
-
const firstOpen =
|
|
11628
|
+
const firstOpen = useRef22(true);
|
|
11794
11629
|
function onOpenChange(isOpen) {
|
|
11795
11630
|
if (firstOpen.current && isOpen) {
|
|
11796
11631
|
maybeInitLoad();
|
|
@@ -11803,12 +11638,12 @@ function ComboBoxBase(props) {
|
|
|
11803
11638
|
}));
|
|
11804
11639
|
}
|
|
11805
11640
|
}
|
|
11806
|
-
const comboBoxRef =
|
|
11807
|
-
const triggerRef =
|
|
11808
|
-
const inputRef =
|
|
11809
|
-
const inputWrapRef =
|
|
11810
|
-
const listBoxRef =
|
|
11811
|
-
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);
|
|
11812
11647
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
11813
11648
|
const comboBoxChildren = useCallback9((item) => /* @__PURE__ */ jsx56(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))), [getOptionValue, getOptionLabel, getOptionMenuLabel]);
|
|
11814
11649
|
const selectedKeys = useMemo16(() => {
|
|
@@ -12042,10 +11877,10 @@ function Autocomplete(props) {
|
|
|
12042
11877
|
...others
|
|
12043
11878
|
};
|
|
12044
11879
|
const state = useComboBoxState3(comboBoxProps);
|
|
12045
|
-
const inputWrapRef =
|
|
12046
|
-
const inputRef =
|
|
12047
|
-
const listBoxRef =
|
|
12048
|
-
const popoverRef =
|
|
11880
|
+
const inputWrapRef = useRef23(null);
|
|
11881
|
+
const inputRef = useRef23(null);
|
|
11882
|
+
const listBoxRef = useRef23(null);
|
|
11883
|
+
const popoverRef = useRef23(null);
|
|
12049
11884
|
const { inputProps, listBoxProps, labelProps } = useComboBox3(
|
|
12050
11885
|
{
|
|
12051
11886
|
...comboBoxProps,
|
|
@@ -12112,7 +11947,7 @@ function Autocomplete(props) {
|
|
|
12112
11947
|
}
|
|
12113
11948
|
|
|
12114
11949
|
// src/inputs/Checkbox.tsx
|
|
12115
|
-
import { useRef as
|
|
11950
|
+
import { useRef as useRef24 } from "react";
|
|
12116
11951
|
import { useCheckbox } from "react-aria";
|
|
12117
11952
|
import { useToggleState } from "react-stately";
|
|
12118
11953
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -12122,7 +11957,7 @@ function Checkbox(props) {
|
|
|
12122
11957
|
const isIndeterminate = selected === "indeterminate";
|
|
12123
11958
|
const ariaProps = { isSelected, isDisabled: !!disabled, isIndeterminate, ...otherProps };
|
|
12124
11959
|
const checkboxProps = { ...ariaProps, "aria-label": label };
|
|
12125
|
-
const ref =
|
|
11960
|
+
const ref = useRef24(null);
|
|
12126
11961
|
const toggleState = useToggleState(ariaProps);
|
|
12127
11962
|
const { inputProps } = useCheckbox(checkboxProps, toggleState, ref);
|
|
12128
11963
|
return /* @__PURE__ */ jsx58(
|
|
@@ -12141,7 +11976,7 @@ function Checkbox(props) {
|
|
|
12141
11976
|
}
|
|
12142
11977
|
|
|
12143
11978
|
// src/inputs/CheckboxGroup.tsx
|
|
12144
|
-
import { useRef as
|
|
11979
|
+
import { useRef as useRef25 } from "react";
|
|
12145
11980
|
import { useCheckboxGroup, useCheckboxGroupItem } from "react-aria";
|
|
12146
11981
|
import { useCheckboxGroupState } from "react-stately";
|
|
12147
11982
|
import { trussProps as trussProps40 } from "@homebound/truss/runtime";
|
|
@@ -12216,7 +12051,7 @@ function CheckboxGroupItem(props) {
|
|
|
12216
12051
|
...ariaProps,
|
|
12217
12052
|
"aria-label": label
|
|
12218
12053
|
};
|
|
12219
|
-
const ref =
|
|
12054
|
+
const ref = useRef25(null);
|
|
12220
12055
|
const {
|
|
12221
12056
|
inputProps
|
|
12222
12057
|
} = useCheckboxGroupItem(checkboxProps, groupState, ref);
|
|
@@ -12224,37 +12059,69 @@ function CheckboxGroupItem(props) {
|
|
|
12224
12059
|
}
|
|
12225
12060
|
|
|
12226
12061
|
// src/inputs/DateFields/DateField.mock.tsx
|
|
12062
|
+
import { format as format3, parse } from "date-fns";
|
|
12227
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";
|
|
12228
12095
|
|
|
12229
12096
|
// src/inputs/DateFields/utils.ts
|
|
12230
|
-
import {
|
|
12097
|
+
import { format as dateFnsFormat, parse as dateFnsParse, isDate } from "date-fns";
|
|
12231
12098
|
var dateFormats = {
|
|
12232
|
-
short: "
|
|
12233
|
-
medium: "
|
|
12234
|
-
long: "
|
|
12099
|
+
short: "MM/dd/yy",
|
|
12100
|
+
medium: "EEE, MMM d",
|
|
12101
|
+
long: "EEEE LLLL d, uuuu"
|
|
12235
12102
|
};
|
|
12236
|
-
function getDateFormat(
|
|
12237
|
-
return
|
|
12103
|
+
function getDateFormat(format4) {
|
|
12104
|
+
return format4 ? dateFormats[format4] : dateFormats.short;
|
|
12238
12105
|
}
|
|
12239
|
-
function formatDate(date,
|
|
12106
|
+
function formatDate(date, format4) {
|
|
12240
12107
|
if (!date) return "";
|
|
12241
|
-
return
|
|
12108
|
+
return dateFnsFormat(date, format4);
|
|
12242
12109
|
}
|
|
12243
|
-
function formatDateRange(date,
|
|
12110
|
+
function formatDateRange(date, format4) {
|
|
12244
12111
|
if (!date) return "";
|
|
12245
12112
|
const { from, to } = date;
|
|
12246
|
-
const fromFormatted = from ?
|
|
12247
|
-
const toFormatted = to ?
|
|
12113
|
+
const fromFormatted = from ? dateFnsFormat(from, format4) : "";
|
|
12114
|
+
const toFormatted = to ? dateFnsFormat(to, format4) : "";
|
|
12248
12115
|
return !fromFormatted && !toFormatted ? void 0 : `${fromFormatted} - ${toFormatted}`;
|
|
12249
12116
|
}
|
|
12250
|
-
function parseDate(str,
|
|
12251
|
-
return parseDateString(str,
|
|
12117
|
+
function parseDate(str, format4) {
|
|
12118
|
+
return parseDateString(str, format4);
|
|
12252
12119
|
}
|
|
12253
|
-
function parseDateRange(str,
|
|
12120
|
+
function parseDateRange(str, format4) {
|
|
12254
12121
|
const [from = "", to = ""] = str.split("-");
|
|
12255
|
-
const fromDate = parseDateString(from.trim(),
|
|
12256
|
-
const toDate = parseDateString(to.trim(),
|
|
12257
|
-
if (toDate && fromDate &&
|
|
12122
|
+
const fromDate = parseDateString(from.trim(), format4);
|
|
12123
|
+
const toDate = parseDateString(to.trim(), format4);
|
|
12124
|
+
if (toDate && fromDate && toDate < fromDate) {
|
|
12258
12125
|
return { from: toDate, to: fromDate };
|
|
12259
12126
|
}
|
|
12260
12127
|
if (toDate === void 0 && fromDate === void 0) {
|
|
@@ -12262,81 +12129,31 @@ function parseDateRange(str, format) {
|
|
|
12262
12129
|
}
|
|
12263
12130
|
return { from: fromDate, to: toDate };
|
|
12264
12131
|
}
|
|
12265
|
-
function parseDateString(str,
|
|
12266
|
-
if (format !== dateFormats.short && format !== "date") {
|
|
12267
|
-
return void 0;
|
|
12268
|
-
}
|
|
12132
|
+
function parseDateString(str, format4) {
|
|
12269
12133
|
const split = str.split("/");
|
|
12270
12134
|
if (split.length !== 3) {
|
|
12271
12135
|
return void 0;
|
|
12272
12136
|
}
|
|
12273
|
-
|
|
12274
|
-
if (split[2].length !== yearLength) {
|
|
12137
|
+
if (split[2].length !== 2) {
|
|
12275
12138
|
return void 0;
|
|
12276
12139
|
}
|
|
12277
|
-
const month = parseInt(split[0], 10);
|
|
12140
|
+
const month = parseInt(split[0], 10) - 1;
|
|
12278
12141
|
const day = parseInt(split[1], 10);
|
|
12279
12142
|
const year = parseInt(split[2], 10);
|
|
12280
|
-
if (
|
|
12143
|
+
if (isNaN(year) || String(year).length > 4 || isNaN(month) || isNaN(day) || day <= 0 || day > 31 || month < 0 || month >= 12) {
|
|
12281
12144
|
return void 0;
|
|
12282
12145
|
}
|
|
12283
|
-
|
|
12284
|
-
|
|
12285
|
-
year: yearLength === 2 ? normalizeTwoDigitYear(year, todayPlainDate().year) : year,
|
|
12286
|
-
month,
|
|
12287
|
-
day
|
|
12288
|
-
});
|
|
12289
|
-
} catch {
|
|
12146
|
+
const parsed = dateFnsParse(str, format4, /* @__PURE__ */ new Date());
|
|
12147
|
+
if (!isValidDate(parsed)) {
|
|
12290
12148
|
return void 0;
|
|
12291
12149
|
}
|
|
12150
|
+
return parsed;
|
|
12292
12151
|
}
|
|
12293
12152
|
function isValidDate(d) {
|
|
12294
|
-
return d !== void 0 &&
|
|
12295
|
-
}
|
|
12296
|
-
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
12297
|
-
const isCommonEra = currentYear > 0;
|
|
12298
|
-
const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
12299
|
-
if (absCurrentYear <= 50) {
|
|
12300
|
-
return isCommonEra ? twoDigitYear || 100 : 1 - (twoDigitYear || 100);
|
|
12301
|
-
}
|
|
12302
|
-
const rangeEnd = absCurrentYear + 50;
|
|
12303
|
-
const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
12304
|
-
const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
12305
|
-
const normalizedYear = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
12306
|
-
return isCommonEra ? normalizedYear : 1 - normalizedYear;
|
|
12307
|
-
}
|
|
12308
|
-
|
|
12309
|
-
// src/inputs/DateFields/DateField.mock.tsx
|
|
12310
|
-
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12311
|
-
function DateFieldMock(props) {
|
|
12312
|
-
const { onChange = () => {
|
|
12313
|
-
}, errorMsg, onBlur, onFocus } = props;
|
|
12314
|
-
const [value, setValue] = useState20(formatDate(props.value, dateFormats.short));
|
|
12315
|
-
const tid = useTestIds(props, "date");
|
|
12316
|
-
return /* @__PURE__ */ jsx60(
|
|
12317
|
-
"input",
|
|
12318
|
-
{
|
|
12319
|
-
...tid,
|
|
12320
|
-
"data-error": !!errorMsg,
|
|
12321
|
-
value,
|
|
12322
|
-
onChange: (e) => {
|
|
12323
|
-
const { value: value2 } = e.target;
|
|
12324
|
-
setValue(value2);
|
|
12325
|
-
onChange(parseDate(value2, dateFormats.short));
|
|
12326
|
-
},
|
|
12327
|
-
onBlur: () => maybeCall(onBlur),
|
|
12328
|
-
onFocus: () => maybeCall(onFocus),
|
|
12329
|
-
disabled: !!props.disabled,
|
|
12330
|
-
readOnly: !!props.readOnly,
|
|
12331
|
-
"data-disabled-days": JSON.stringify(props.disabledDays)
|
|
12332
|
-
}
|
|
12333
|
-
);
|
|
12153
|
+
return d !== void 0 && isDate(d) && d.toString() !== "Invalid Date";
|
|
12334
12154
|
}
|
|
12335
12155
|
|
|
12336
12156
|
// src/inputs/DateFields/DateFieldBase.tsx
|
|
12337
|
-
import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef27, useState as useState21 } from "react";
|
|
12338
|
-
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
12339
|
-
import { useOverlayTriggerState } from "react-stately";
|
|
12340
12157
|
import { trussProps as trussProps41 } from "@homebound/truss/runtime";
|
|
12341
12158
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12342
12159
|
function DateFieldBase(props) {
|
|
@@ -12352,7 +12169,7 @@ function DateFieldBase(props) {
|
|
|
12352
12169
|
errorMsg,
|
|
12353
12170
|
helperText,
|
|
12354
12171
|
readOnly,
|
|
12355
|
-
format = "short",
|
|
12172
|
+
format: format4 = "short",
|
|
12356
12173
|
iconLeft = false,
|
|
12357
12174
|
hideCalendarIcon = false,
|
|
12358
12175
|
disabledDays,
|
|
@@ -12364,12 +12181,12 @@ function DateFieldBase(props) {
|
|
|
12364
12181
|
...others
|
|
12365
12182
|
} = props;
|
|
12366
12183
|
const isRangeMode = mode === "range";
|
|
12367
|
-
const inputRef =
|
|
12368
|
-
const inputWrapRef =
|
|
12369
|
-
const buttonRef =
|
|
12370
|
-
const overlayRef =
|
|
12371
|
-
const isFocused =
|
|
12372
|
-
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);
|
|
12373
12190
|
const [wipValue, setWipValue] = useState21(value);
|
|
12374
12191
|
const [inputValue, setInputValue] = useState21((isRangeMode ? formatDateRange(props.value, dateFormat) : formatDate(props.value, dateFormat)) ?? "");
|
|
12375
12192
|
const tid = useTestIds(props, defaultTestId(label));
|
|
@@ -12458,20 +12275,16 @@ function DateFieldBase(props) {
|
|
|
12458
12275
|
(d) => {
|
|
12459
12276
|
setWipValue(d);
|
|
12460
12277
|
if (d && isParsedDateValid(d)) {
|
|
12461
|
-
if (isRangeMode &&
|
|
12278
|
+
if (isRangeMode && isDateRange(d)) {
|
|
12462
12279
|
props.onChange(d);
|
|
12463
12280
|
return;
|
|
12464
12281
|
}
|
|
12465
|
-
if (!isRangeMode && !
|
|
12282
|
+
if (!isRangeMode && !isDateRange(d)) {
|
|
12466
12283
|
props.onChange(d);
|
|
12467
12284
|
return;
|
|
12468
12285
|
}
|
|
12469
12286
|
} else {
|
|
12470
|
-
|
|
12471
|
-
props.onChange(void 0);
|
|
12472
|
-
} else {
|
|
12473
|
-
props.onChange(void 0);
|
|
12474
|
-
}
|
|
12287
|
+
props.onChange(void 0);
|
|
12475
12288
|
return;
|
|
12476
12289
|
}
|
|
12477
12290
|
},
|
|
@@ -12479,7 +12292,7 @@ function DateFieldBase(props) {
|
|
|
12479
12292
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12480
12293
|
[isRangeMode, props.onChange]
|
|
12481
12294
|
);
|
|
12482
|
-
const inputSize = !isRangeMode ?
|
|
12295
|
+
const inputSize = !isRangeMode ? format4 === "short" ? 8 : format4 === "medium" ? 10 : void 0 : void 0;
|
|
12483
12296
|
const clearButton = /* @__PURE__ */ jsx61(Fragment18, { children: inputValue !== "" && !state.isOpen && /* @__PURE__ */ jsx61(IconButton, { icon: "xCircle", color: "rgba(100, 100, 100, 1)" /* Gray700 */, onClick: () => {
|
|
12484
12297
|
setInputValue("");
|
|
12485
12298
|
onChange(void 0);
|
|
@@ -12541,10 +12354,7 @@ function DateFieldBase(props) {
|
|
|
12541
12354
|
] });
|
|
12542
12355
|
}
|
|
12543
12356
|
function isParsedDateValid(d) {
|
|
12544
|
-
return d !== void 0 && (!
|
|
12545
|
-
}
|
|
12546
|
-
function isDateRangeValue(value) {
|
|
12547
|
-
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));
|
|
12548
12358
|
}
|
|
12549
12359
|
|
|
12550
12360
|
// src/utils/withTestMock.tsx
|
|
@@ -12731,7 +12541,7 @@ function MultiSelectField(props) {
|
|
|
12731
12541
|
|
|
12732
12542
|
// src/inputs/NumberField.tsx
|
|
12733
12543
|
import { NumberParser } from "@internationalized/number";
|
|
12734
|
-
import { useMemo as useMemo18, useRef as
|
|
12544
|
+
import { useMemo as useMemo18, useRef as useRef27, useState as useState23 } from "react";
|
|
12735
12545
|
import { mergeProps as mergeProps15, useLocale, useNumberField } from "react-aria";
|
|
12736
12546
|
import { useNumberFieldState } from "react-stately";
|
|
12737
12547
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
@@ -12818,11 +12628,11 @@ function NumberField(props) {
|
|
|
12818
12628
|
};
|
|
12819
12629
|
}, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
|
|
12820
12630
|
const numberParser = useMemo18(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
|
|
12821
|
-
const valueRef =
|
|
12631
|
+
const valueRef = useRef27({
|
|
12822
12632
|
wip: false
|
|
12823
12633
|
});
|
|
12824
|
-
const lastSentRef =
|
|
12825
|
-
const focusValueRef =
|
|
12634
|
+
const lastSentRef = useRef27(void 0);
|
|
12635
|
+
const focusValueRef = useRef27(void 0);
|
|
12826
12636
|
const [, forceRender] = useState23(0);
|
|
12827
12637
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
12828
12638
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
@@ -12870,7 +12680,7 @@ function NumberField(props) {
|
|
|
12870
12680
|
...otherProps
|
|
12871
12681
|
};
|
|
12872
12682
|
const state = useNumberFieldState(useProps);
|
|
12873
|
-
const inputRef =
|
|
12683
|
+
const inputRef = useRef27(null);
|
|
12874
12684
|
const {
|
|
12875
12685
|
labelProps,
|
|
12876
12686
|
inputProps,
|
|
@@ -12922,7 +12732,7 @@ function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiv
|
|
|
12922
12732
|
}
|
|
12923
12733
|
|
|
12924
12734
|
// src/inputs/RadioGroupField.tsx
|
|
12925
|
-
import { Fragment as Fragment19, useMemo as useMemo19, useRef as
|
|
12735
|
+
import { Fragment as Fragment19, useMemo as useMemo19, useRef as useRef28 } from "react";
|
|
12926
12736
|
import { useFocusRing as useFocusRing6, useHover as useHover12, useRadio, useRadioGroup } from "react-aria";
|
|
12927
12737
|
import { useRadioGroupState } from "react-stately";
|
|
12928
12738
|
import { trussProps as trussProps44 } from "@homebound/truss/runtime";
|
|
@@ -12998,7 +12808,7 @@ function Radio(props) {
|
|
|
12998
12808
|
} = props;
|
|
12999
12809
|
const labelId = `${parentId}-${value}-label`;
|
|
13000
12810
|
const descriptionId = `${parentId}-${value}-description`;
|
|
13001
|
-
const ref =
|
|
12811
|
+
const ref = useRef28(null);
|
|
13002
12812
|
const {
|
|
13003
12813
|
inputProps,
|
|
13004
12814
|
isDisabled
|
|
@@ -13168,7 +12978,7 @@ var radioDisabled = {
|
|
|
13168
12978
|
|
|
13169
12979
|
// src/inputs/RichTextField.tsx
|
|
13170
12980
|
import DOMPurify from "dompurify";
|
|
13171
|
-
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";
|
|
13172
12982
|
|
|
13173
12983
|
// src/inputs/RichTextField.mock.tsx
|
|
13174
12984
|
import { camelCase as camelCase3 } from "change-case";
|
|
@@ -13224,13 +13034,13 @@ function RichTextFieldImpl(props) {
|
|
|
13224
13034
|
fullWidth = fieldProps?.fullWidth ?? false
|
|
13225
13035
|
} = props;
|
|
13226
13036
|
const [editor, setEditor] = useState25();
|
|
13227
|
-
const editorElement =
|
|
13228
|
-
const currentHtml =
|
|
13229
|
-
const onChangeRef =
|
|
13037
|
+
const editorElement = useRef29();
|
|
13038
|
+
const currentHtml = useRef29(void 0);
|
|
13039
|
+
const onChangeRef = useRef29(onChange);
|
|
13230
13040
|
onChangeRef.current = onChange;
|
|
13231
|
-
const onBlurRef =
|
|
13041
|
+
const onBlurRef = useRef29(onBlur);
|
|
13232
13042
|
onBlurRef.current = onBlur;
|
|
13233
|
-
const onFocusRef =
|
|
13043
|
+
const onFocusRef = useRef29(onFocus);
|
|
13234
13044
|
onFocusRef.current = onFocus;
|
|
13235
13045
|
const id = useMemo20(() => {
|
|
13236
13046
|
if (readOnly) return;
|
|
@@ -13381,7 +13191,7 @@ function SelectField(props) {
|
|
|
13381
13191
|
}
|
|
13382
13192
|
|
|
13383
13193
|
// src/inputs/Switch.tsx
|
|
13384
|
-
import { useRef as
|
|
13194
|
+
import { useRef as useRef30 } from "react";
|
|
13385
13195
|
import { useFocusRing as useFocusRing7, useHover as useHover13, useSwitch, VisuallyHidden as VisuallyHidden5 } from "react-aria";
|
|
13386
13196
|
import { trussProps as trussProps46 } from "@homebound/truss/runtime";
|
|
13387
13197
|
import { jsx as jsx73, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -13414,7 +13224,7 @@ function Switch(props) {
|
|
|
13414
13224
|
...otherProps
|
|
13415
13225
|
};
|
|
13416
13226
|
const state = toToggleState(isSelected, onChange);
|
|
13417
|
-
const ref =
|
|
13227
|
+
const ref = useRef30(null);
|
|
13418
13228
|
const {
|
|
13419
13229
|
inputProps
|
|
13420
13230
|
} = useSwitch({
|
|
@@ -13566,7 +13376,7 @@ function switchCircleSelectedStyles(isCompact) {
|
|
|
13566
13376
|
}
|
|
13567
13377
|
|
|
13568
13378
|
// src/inputs/TextAreaField.tsx
|
|
13569
|
-
import { useRef as
|
|
13379
|
+
import { useRef as useRef31 } from "react";
|
|
13570
13380
|
import { mergeProps as mergeProps16, useTextField as useTextField3 } from "react-aria";
|
|
13571
13381
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
13572
13382
|
function TextAreaField(props) {
|
|
@@ -13584,8 +13394,8 @@ function TextAreaField(props) {
|
|
|
13584
13394
|
const isDisabled = !!disabled;
|
|
13585
13395
|
const isReadOnly = !!readOnly;
|
|
13586
13396
|
const textFieldProps = { ...otherProps, value, isDisabled, isReadOnly };
|
|
13587
|
-
const inputRef =
|
|
13588
|
-
const inputWrapRef =
|
|
13397
|
+
const inputRef = useRef31(null);
|
|
13398
|
+
const inputWrapRef = useRef31(null);
|
|
13589
13399
|
useGrowingTextField({ inputRef, inputWrapRef, value, maxLines });
|
|
13590
13400
|
const { labelProps, inputProps } = useTextField3(
|
|
13591
13401
|
{
|
|
@@ -13623,7 +13433,7 @@ function TextAreaField(props) {
|
|
|
13623
13433
|
}
|
|
13624
13434
|
|
|
13625
13435
|
// src/inputs/TextField.tsx
|
|
13626
|
-
import { useRef as
|
|
13436
|
+
import { useRef as useRef32 } from "react";
|
|
13627
13437
|
import { mergeProps as mergeProps17, useTextField as useTextField4 } from "react-aria";
|
|
13628
13438
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
13629
13439
|
function TextField(props) {
|
|
@@ -13651,7 +13461,7 @@ function TextField(props) {
|
|
|
13651
13461
|
validationState: errorMsg ? "invalid" : "valid",
|
|
13652
13462
|
value
|
|
13653
13463
|
};
|
|
13654
|
-
const inputRef =
|
|
13464
|
+
const inputRef = useRef32(null);
|
|
13655
13465
|
const { labelProps, inputProps } = useTextField4(
|
|
13656
13466
|
{
|
|
13657
13467
|
...textFieldProps,
|
|
@@ -13687,7 +13497,7 @@ function TextField(props) {
|
|
|
13687
13497
|
}
|
|
13688
13498
|
|
|
13689
13499
|
// src/inputs/ToggleButton.tsx
|
|
13690
|
-
import { useRef as
|
|
13500
|
+
import { useRef as useRef33, useState as useState26 } from "react";
|
|
13691
13501
|
import { useFocusRing as useFocusRing8, useHover as useHover14, usePress, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden6 } from "react-aria";
|
|
13692
13502
|
import { useToggleState as useToggleState3 } from "react-stately";
|
|
13693
13503
|
import { trussProps as trussProps47 } from "@homebound/truss/runtime";
|
|
@@ -13721,8 +13531,8 @@ function ToggleButton(props) {
|
|
|
13721
13531
|
return result;
|
|
13722
13532
|
}
|
|
13723
13533
|
});
|
|
13724
|
-
const labelRef =
|
|
13725
|
-
const ref =
|
|
13534
|
+
const labelRef = useRef33(null);
|
|
13535
|
+
const ref = useRef33(null);
|
|
13726
13536
|
const tid = useTestIds(otherProps, label);
|
|
13727
13537
|
const {
|
|
13728
13538
|
isPressed: isPressedFromEvents,
|
|
@@ -13808,7 +13618,7 @@ var togglePressStyles = {
|
|
|
13808
13618
|
};
|
|
13809
13619
|
|
|
13810
13620
|
// src/inputs/ToggleChipGroup.tsx
|
|
13811
|
-
import { useRef as
|
|
13621
|
+
import { useRef as useRef34 } from "react";
|
|
13812
13622
|
import { useCheckboxGroup as useCheckboxGroup2, useCheckboxGroupItem as useCheckboxGroupItem2, useFocusRing as useFocusRing9, VisuallyHidden as VisuallyHidden7 } from "react-aria";
|
|
13813
13623
|
import { useCheckboxGroupState as useCheckboxGroupState2 } from "react-stately";
|
|
13814
13624
|
import { trussProps as trussProps48 } from "@homebound/truss/runtime";
|
|
@@ -13881,7 +13691,7 @@ function ToggleChip2(props) {
|
|
|
13881
13691
|
} = props;
|
|
13882
13692
|
const isDisabled = !!disabled;
|
|
13883
13693
|
const isReadOnly = !!readonly;
|
|
13884
|
-
const ref =
|
|
13694
|
+
const ref = useRef34(null);
|
|
13885
13695
|
const {
|
|
13886
13696
|
inputProps
|
|
13887
13697
|
} = useCheckboxGroupItem2({
|
|
@@ -14931,9 +14741,9 @@ function maybeApply(maybeFn) {
|
|
|
14931
14741
|
}
|
|
14932
14742
|
|
|
14933
14743
|
// src/components/Table/hooks/useColumnResizeHandlers.ts
|
|
14934
|
-
import { useCallback as useCallback12, useRef as
|
|
14744
|
+
import { useCallback as useCallback12, useRef as useRef35 } from "react";
|
|
14935
14745
|
function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
|
|
14936
|
-
const hasLockedColumnsRef =
|
|
14746
|
+
const hasLockedColumnsRef = useRef35(false);
|
|
14937
14747
|
const distributeAdjustment = useCallback12(
|
|
14938
14748
|
(rightColumns, totalRightWidth, adjustment) => {
|
|
14939
14749
|
const updates = {};
|
|
@@ -15062,7 +14872,7 @@ function useScrollStorage(tableId, enabled = true) {
|
|
|
15062
14872
|
|
|
15063
14873
|
// src/components/Table/hooks/useSetupColumnSizes.ts
|
|
15064
14874
|
import { useResizeObserver } from "@react-aria/utils";
|
|
15065
|
-
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";
|
|
15066
14876
|
|
|
15067
14877
|
// src/components/Table/hooks/useColumnResizing.ts
|
|
15068
14878
|
import { useCallback as useCallback13, useEffect as useEffect17, useState as useState27 } from "react";
|
|
@@ -15121,9 +14931,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15121
14931
|
const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
|
|
15122
14932
|
disableColumnResizing ? void 0 : visibleColumnsStorageKey
|
|
15123
14933
|
);
|
|
15124
|
-
const calculateImmediately =
|
|
14934
|
+
const calculateImmediately = useRef36(true);
|
|
15125
14935
|
const [tableWidth, setTableWidth] = useState28();
|
|
15126
|
-
const prevTableWidthRef =
|
|
14936
|
+
const prevTableWidthRef = useRef36(tableWidth);
|
|
15127
14937
|
const [columnSizes, setColumnSizes] = useState28(
|
|
15128
14938
|
calcColumnSizes(columns, tableWidth, style.minWidthPx, expandedColumnIds, resizedWidths)
|
|
15129
14939
|
);
|
|
@@ -15190,9 +15000,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15190
15000
|
}
|
|
15191
15001
|
|
|
15192
15002
|
// src/hooks/useRenderCount.ts
|
|
15193
|
-
import { useCallback as useCallback15, useRef as
|
|
15003
|
+
import { useCallback as useCallback15, useRef as useRef37 } from "react";
|
|
15194
15004
|
function useRenderCount() {
|
|
15195
|
-
const ref =
|
|
15005
|
+
const ref = useRef37(/* @__PURE__ */ new Map());
|
|
15196
15006
|
const getCount = useCallback15((id) => {
|
|
15197
15007
|
const count = ref.current.get(id) || 1;
|
|
15198
15008
|
ref.current.set(id, count + 1);
|
|
@@ -15249,10 +15059,10 @@ function GridTable(props) {
|
|
|
15249
15059
|
disableColumnResizing = false
|
|
15250
15060
|
} = props;
|
|
15251
15061
|
const columnsWithIds = useMemo24(() => assignDefaultColumnIds(_columns), [_columns]);
|
|
15252
|
-
const virtuosoRef =
|
|
15253
|
-
const virtuosoRangeRef =
|
|
15254
|
-
const resizeRef =
|
|
15255
|
-
const tableContainerRef =
|
|
15062
|
+
const virtuosoRef = useRef38(null);
|
|
15063
|
+
const virtuosoRangeRef = useRef38(null);
|
|
15064
|
+
const resizeRef = useRef38(null);
|
|
15065
|
+
const tableContainerRef = useRef38(null);
|
|
15256
15066
|
const api = useMemo24(
|
|
15257
15067
|
() => {
|
|
15258
15068
|
const api2 = props.api ?? new GridTableApiImpl();
|
|
@@ -15267,7 +15077,7 @@ function GridTable(props) {
|
|
|
15267
15077
|
[props.api]
|
|
15268
15078
|
);
|
|
15269
15079
|
const [draggedRow, _setDraggedRow] = useState29(void 0);
|
|
15270
|
-
const draggedRowRef =
|
|
15080
|
+
const draggedRowRef = useRef38(draggedRow);
|
|
15271
15081
|
const setDraggedRow = (row) => {
|
|
15272
15082
|
draggedRowRef.current = row;
|
|
15273
15083
|
_setDraggedRow(row);
|
|
@@ -16113,17 +15923,17 @@ var variantStyles2 = {
|
|
|
16113
15923
|
};
|
|
16114
15924
|
|
|
16115
15925
|
// src/components/BeamContext.tsx
|
|
16116
|
-
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";
|
|
16117
15927
|
import { OverlayProvider } from "react-aria";
|
|
16118
15928
|
|
|
16119
15929
|
// src/components/Modal/Modal.tsx
|
|
16120
15930
|
import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
|
|
16121
|
-
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";
|
|
16122
15932
|
import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
|
|
16123
15933
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16124
15934
|
|
|
16125
15935
|
// src/components/Modal/useModal.tsx
|
|
16126
|
-
import { useEffect as useEffect22, useMemo as useMemo27, useRef as
|
|
15936
|
+
import { useEffect as useEffect22, useMemo as useMemo27, useRef as useRef39 } from "react";
|
|
16127
15937
|
|
|
16128
15938
|
// src/components/Modal/ModalContext.tsx
|
|
16129
15939
|
import { createContext as createContext4, useContext as useContext13, useMemo as useMemo26 } from "react";
|
|
@@ -16141,8 +15951,8 @@ function useModalContext() {
|
|
|
16141
15951
|
function useModal() {
|
|
16142
15952
|
const { modalState, modalCanCloseChecks } = useBeamContext();
|
|
16143
15953
|
const { inModal } = useModalContext();
|
|
16144
|
-
const lastCanClose =
|
|
16145
|
-
const api =
|
|
15954
|
+
const lastCanClose = useRef39();
|
|
15955
|
+
const api = useRef39();
|
|
16146
15956
|
useEffect22(() => {
|
|
16147
15957
|
return () => {
|
|
16148
15958
|
modalCanCloseChecks.current = modalCanCloseChecks.current.filter((c) => c !== lastCanClose.current);
|
|
@@ -16195,7 +16005,7 @@ function Modal(props) {
|
|
|
16195
16005
|
allowClosing = true
|
|
16196
16006
|
} = props;
|
|
16197
16007
|
const isFixedHeight = typeof size !== "string";
|
|
16198
|
-
const ref =
|
|
16008
|
+
const ref = useRef40(null);
|
|
16199
16009
|
const {
|
|
16200
16010
|
modalBodyDiv,
|
|
16201
16011
|
modalFooterDiv,
|
|
@@ -16226,9 +16036,9 @@ function Modal(props) {
|
|
|
16226
16036
|
role: "dialog"
|
|
16227
16037
|
}, ref);
|
|
16228
16038
|
const [[width2, height], setSize] = useState32(getSize(size));
|
|
16229
|
-
const modalBodyRef =
|
|
16230
|
-
const modalFooterRef =
|
|
16231
|
-
const modalHeaderRef =
|
|
16039
|
+
const modalBodyRef = useRef40(null);
|
|
16040
|
+
const modalFooterRef = useRef40(null);
|
|
16041
|
+
const modalHeaderRef = useRef40(null);
|
|
16232
16042
|
const testId = useTestIds({}, testIdPrefix);
|
|
16233
16043
|
usePreventScroll();
|
|
16234
16044
|
const {
|
|
@@ -16524,7 +16334,7 @@ function useSnackbarContext() {
|
|
|
16524
16334
|
|
|
16525
16335
|
// src/components/SuperDrawer/SuperDrawer.tsx
|
|
16526
16336
|
import { AnimatePresence, motion } from "framer-motion";
|
|
16527
|
-
import { useEffect as useEffect24, useRef as
|
|
16337
|
+
import { useEffect as useEffect24, useRef as useRef41 } from "react";
|
|
16528
16338
|
import { createPortal as createPortal4 } from "react-dom";
|
|
16529
16339
|
|
|
16530
16340
|
// src/components/SuperDrawer/utils.ts
|
|
@@ -16546,7 +16356,7 @@ function SuperDrawer() {
|
|
|
16546
16356
|
const {
|
|
16547
16357
|
closeDrawer
|
|
16548
16358
|
} = useSuperDrawer();
|
|
16549
|
-
const headerRef =
|
|
16359
|
+
const headerRef = useRef41(null);
|
|
16550
16360
|
const testId = useTestIds({}, "superDrawer");
|
|
16551
16361
|
const currentContent = contentStack.current[contentStack.current.length - 1]?.opts;
|
|
16552
16362
|
const {
|
|
@@ -16641,7 +16451,7 @@ function SuperDrawer() {
|
|
|
16641
16451
|
}
|
|
16642
16452
|
|
|
16643
16453
|
// src/components/Layout/FormPageLayout.tsx
|
|
16644
|
-
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";
|
|
16645
16455
|
import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
|
|
16646
16456
|
|
|
16647
16457
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -18309,7 +18119,7 @@ function SectionNavLink(props) {
|
|
|
18309
18119
|
});
|
|
18310
18120
|
}, [sectionRef]);
|
|
18311
18121
|
const tids = useTestIds(props);
|
|
18312
|
-
const buttonRef =
|
|
18122
|
+
const buttonRef = useRef42(null);
|
|
18313
18123
|
const {
|
|
18314
18124
|
buttonProps,
|
|
18315
18125
|
isPressed
|
|
@@ -18459,7 +18269,7 @@ function invertSpacing(value) {
|
|
|
18459
18269
|
import React17, { useEffect as useEffect27, useMemo as useMemo38, useState as useState42 } from "react";
|
|
18460
18270
|
|
|
18461
18271
|
// src/components/ButtonMenu.tsx
|
|
18462
|
-
import { useRef as
|
|
18272
|
+
import { useRef as useRef43 } from "react";
|
|
18463
18273
|
import { useMenuTrigger as useMenuTrigger2 } from "react-aria";
|
|
18464
18274
|
import { useMenuTriggerState as useMenuTriggerState2 } from "react-stately";
|
|
18465
18275
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
@@ -18471,7 +18281,7 @@ function ButtonMenu(props) {
|
|
|
18471
18281
|
onChange = props.onChange;
|
|
18472
18282
|
}
|
|
18473
18283
|
const state = useMenuTriggerState2({ isOpen: defaultOpen });
|
|
18474
|
-
const buttonRef =
|
|
18284
|
+
const buttonRef = useRef43(null);
|
|
18475
18285
|
const { menuTriggerProps, menuProps } = useMenuTrigger2({ isDisabled: !!disabled }, state, buttonRef);
|
|
18476
18286
|
const tid = useTestIds(
|
|
18477
18287
|
props,
|
|
@@ -18578,16 +18388,8 @@ function dateFilter(props) {
|
|
|
18578
18388
|
}
|
|
18579
18389
|
var anyOption = {};
|
|
18580
18390
|
var DateFilter = class extends BaseFilter {
|
|
18581
|
-
hydrate(value) {
|
|
18582
|
-
if (!isDateFilterValue(value)) return void 0;
|
|
18583
|
-
const hydratedValue = parsePersistedPlainDate(value.value);
|
|
18584
|
-
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18585
|
-
}
|
|
18586
|
-
dehydrate(value) {
|
|
18587
|
-
return value ? { op: value.op, value: dehydratePlainDate(value.value) } : void 0;
|
|
18588
|
-
}
|
|
18589
18391
|
render(value, setValue, tid, inModal, vertical) {
|
|
18590
|
-
const { label, operations, getOperationValue, getOperationLabel
|
|
18392
|
+
const { label, operations, getOperationValue, getOperationLabel } = this.props;
|
|
18591
18393
|
return /* @__PURE__ */ jsxs65(Fragment28, { children: [
|
|
18592
18394
|
vertical && /* @__PURE__ */ jsx127(Label, { label }),
|
|
18593
18395
|
/* @__PURE__ */ jsxs65(CompoundField, { children: [
|
|
@@ -18604,8 +18406,8 @@ var DateFilter = class extends BaseFilter {
|
|
|
18604
18406
|
getOptionLabel: (o) => o === anyOption ? "Any" : getOperationLabel(o),
|
|
18605
18407
|
value: value?.op,
|
|
18606
18408
|
onSelect: (op) => (
|
|
18607
|
-
// default the selected date to
|
|
18608
|
-
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)
|
|
18609
18411
|
),
|
|
18610
18412
|
label: inModal ? `${label} date filter operation` : label,
|
|
18611
18413
|
labelStyle: !inModal && !vertical ? "inline" : inModal || vertical ? "hidden" : "above",
|
|
@@ -18617,13 +18419,9 @@ var DateFilter = class extends BaseFilter {
|
|
|
18617
18419
|
DateField,
|
|
18618
18420
|
{
|
|
18619
18421
|
labelStyle: "inline",
|
|
18620
|
-
value: value?.value
|
|
18422
|
+
value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date(),
|
|
18621
18423
|
label: "Date",
|
|
18622
|
-
onChange: (d) => {
|
|
18623
|
-
if (d && value) {
|
|
18624
|
-
setValue({ ...value, value: d });
|
|
18625
|
-
}
|
|
18626
|
-
},
|
|
18424
|
+
onChange: (d) => setValue({ ...value, value: d }),
|
|
18627
18425
|
disabled: !value,
|
|
18628
18426
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18629
18427
|
}
|
|
@@ -18632,9 +18430,6 @@ var DateFilter = class extends BaseFilter {
|
|
|
18632
18430
|
] });
|
|
18633
18431
|
}
|
|
18634
18432
|
};
|
|
18635
|
-
function isDateFilterValue(value) {
|
|
18636
|
-
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18637
|
-
}
|
|
18638
18433
|
|
|
18639
18434
|
// src/components/Filters/DateRangeFilter.tsx
|
|
18640
18435
|
import { Fragment as Fragment29, jsx as jsx128, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -18642,17 +18437,6 @@ function dateRangeFilter(props) {
|
|
|
18642
18437
|
return (key) => new DateRangeFilter(key, props);
|
|
18643
18438
|
}
|
|
18644
18439
|
var DateRangeFilter = class extends BaseFilter {
|
|
18645
|
-
hydrate(value) {
|
|
18646
|
-
if (!isDateRangeFilterValue(value)) return void 0;
|
|
18647
|
-
const hydratedValue = hydrateDateRange(value.value);
|
|
18648
|
-
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18649
|
-
}
|
|
18650
|
-
dehydrate(value) {
|
|
18651
|
-
return value ? {
|
|
18652
|
-
op: value.op,
|
|
18653
|
-
value: value.value ? { from: dehydratePlainDate(value.value.from), to: dehydratePlainDate(value.value.to) } : void 0
|
|
18654
|
-
} : void 0;
|
|
18655
|
-
}
|
|
18656
18440
|
render(value, setValue, tid, inModal, vertical) {
|
|
18657
18441
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
18658
18442
|
return /* @__PURE__ */ jsxs66(Fragment29, { children: [
|
|
@@ -18664,17 +18448,8 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18664
18448
|
isRangeFilterField: true,
|
|
18665
18449
|
placeholder: placeholderText,
|
|
18666
18450
|
label: testFieldLabel ?? "Date",
|
|
18667
|
-
value: value?.value,
|
|
18668
|
-
onChange: (d) => {
|
|
18669
|
-
if (!d) {
|
|
18670
|
-
setValue(void 0);
|
|
18671
|
-
return;
|
|
18672
|
-
}
|
|
18673
|
-
const op = value?.op ?? defaultValue?.op;
|
|
18674
|
-
if (op !== void 0) {
|
|
18675
|
-
setValue({ op, value: d });
|
|
18676
|
-
}
|
|
18677
|
-
},
|
|
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),
|
|
18678
18453
|
disabledDays,
|
|
18679
18454
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18680
18455
|
}
|
|
@@ -18682,17 +18457,6 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18682
18457
|
] });
|
|
18683
18458
|
}
|
|
18684
18459
|
};
|
|
18685
|
-
function isDateRangeFilterValue(value) {
|
|
18686
|
-
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18687
|
-
}
|
|
18688
|
-
function hydrateDateRange(value) {
|
|
18689
|
-
if (typeof value !== "object" || value === null) return void 0;
|
|
18690
|
-
const { from, to } = value;
|
|
18691
|
-
const hydratedFrom = parsePersistedPlainDate(from);
|
|
18692
|
-
const hydratedTo = parsePersistedPlainDate(to);
|
|
18693
|
-
if (hydratedFrom === void 0 && hydratedTo === void 0) return void 0;
|
|
18694
|
-
return { from: hydratedFrom, to: hydratedTo };
|
|
18695
|
-
}
|
|
18696
18460
|
|
|
18697
18461
|
// src/components/Filters/MultiFilter.tsx
|
|
18698
18462
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -19254,7 +19018,7 @@ function toPageNumberSize(page) {
|
|
|
19254
19018
|
}
|
|
19255
19019
|
|
|
19256
19020
|
// src/components/Table/components/EditColumnsButton.tsx
|
|
19257
|
-
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";
|
|
19258
19022
|
import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
|
|
19259
19023
|
import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
|
|
19260
19024
|
import { jsx as jsx141, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -19269,7 +19033,7 @@ function EditColumnsButton(props) {
|
|
|
19269
19033
|
const state = useMenuTriggerState3({
|
|
19270
19034
|
isOpen: defaultOpen
|
|
19271
19035
|
});
|
|
19272
|
-
const buttonRef =
|
|
19036
|
+
const buttonRef = useRef44(null);
|
|
19273
19037
|
const {
|
|
19274
19038
|
menuTriggerProps
|
|
19275
19039
|
} = useMenuTrigger3({
|
|
@@ -19498,10 +19262,10 @@ function useGridTableLayoutState({
|
|
|
19498
19262
|
});
|
|
19499
19263
|
useEffect27(() => {
|
|
19500
19264
|
if (page.limit !== persistedPageSize) setPersistedPageSize(page.limit);
|
|
19501
|
-
setPage((prev) =>
|
|
19265
|
+
setPage((prev) => ({
|
|
19502
19266
|
...prev,
|
|
19503
19267
|
offset: 0
|
|
19504
|
-
});
|
|
19268
|
+
}));
|
|
19505
19269
|
}, [page.limit, persistedPageSize, setPersistedPageSize, filter, searchString]);
|
|
19506
19270
|
return {
|
|
19507
19271
|
filter,
|
|
@@ -19762,18 +19526,18 @@ var BeamContext = createContext7({
|
|
|
19762
19526
|
});
|
|
19763
19527
|
function BeamProvider({ children, ...presentationProps }) {
|
|
19764
19528
|
const [, tick] = useReducer((prev) => prev + 1, 0);
|
|
19765
|
-
const modalRef =
|
|
19529
|
+
const modalRef = useRef45();
|
|
19766
19530
|
const modalHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19767
19531
|
const modalBodyDiv = useMemo40(() => {
|
|
19768
19532
|
const el = document.createElement("div");
|
|
19769
19533
|
el.style.height = "100%";
|
|
19770
19534
|
return el;
|
|
19771
19535
|
}, []);
|
|
19772
|
-
const modalCanCloseChecksRef =
|
|
19536
|
+
const modalCanCloseChecksRef = useRef45([]);
|
|
19773
19537
|
const modalFooterDiv = useMemo40(() => document.createElement("div"), []);
|
|
19774
|
-
const drawerContentStackRef =
|
|
19775
|
-
const drawerCanCloseChecks =
|
|
19776
|
-
const drawerCanCloseDetailsChecks =
|
|
19538
|
+
const drawerContentStackRef = useRef45([]);
|
|
19539
|
+
const drawerCanCloseChecks = useRef45([]);
|
|
19540
|
+
const drawerCanCloseDetailsChecks = useRef45([]);
|
|
19777
19541
|
const sdHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19778
19542
|
const context = useMemo40(() => {
|
|
19779
19543
|
return {
|
|
@@ -19816,14 +19580,14 @@ function useBeamContext() {
|
|
|
19816
19580
|
}
|
|
19817
19581
|
|
|
19818
19582
|
// src/components/ButtonDatePicker.tsx
|
|
19819
|
-
import { useRef as
|
|
19583
|
+
import { useRef as useRef46 } from "react";
|
|
19820
19584
|
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
19821
19585
|
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
19822
19586
|
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
19823
19587
|
function ButtonDatePicker(props) {
|
|
19824
19588
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
19825
19589
|
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
19826
|
-
const buttonRef =
|
|
19590
|
+
const buttonRef = useRef46(null);
|
|
19827
19591
|
const {
|
|
19828
19592
|
menuTriggerProps,
|
|
19829
19593
|
menuProps: { autoFocus: _af, ...menuProps }
|
|
@@ -19846,7 +19610,7 @@ function ButtonDatePicker(props) {
|
|
|
19846
19610
|
}
|
|
19847
19611
|
|
|
19848
19612
|
// src/components/ButtonGroup.tsx
|
|
19849
|
-
import { useRef as
|
|
19613
|
+
import { useRef as useRef47 } from "react";
|
|
19850
19614
|
import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
|
|
19851
19615
|
import { trussProps as trussProps73 } from "@homebound/truss/runtime";
|
|
19852
19616
|
import { jsx as jsx151, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
@@ -19894,7 +19658,7 @@ function GroupButton(props) {
|
|
|
19894
19658
|
isDisabled: !!disabled,
|
|
19895
19659
|
...otherProps
|
|
19896
19660
|
};
|
|
19897
|
-
const ref =
|
|
19661
|
+
const ref = useRef47(null);
|
|
19898
19662
|
const {
|
|
19899
19663
|
buttonProps,
|
|
19900
19664
|
isPressed
|
|
@@ -20017,7 +19781,7 @@ import { useHover as useHover16 } from "react-aria";
|
|
|
20017
19781
|
|
|
20018
19782
|
// src/components/Tag.tsx
|
|
20019
19783
|
import { useResizeObserver as useResizeObserver4 } from "@react-aria/utils";
|
|
20020
|
-
import { useRef as
|
|
19784
|
+
import { useRef as useRef48, useState as useState44 } from "react";
|
|
20021
19785
|
import { trussProps as trussProps74 } from "@homebound/truss/runtime";
|
|
20022
19786
|
import { jsx as jsx152, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
20023
19787
|
function Tag(props) {
|
|
@@ -20031,7 +19795,7 @@ function Tag(props) {
|
|
|
20031
19795
|
const typeStyles2 = getStyles(type);
|
|
20032
19796
|
const tid = useTestIds(otherProps);
|
|
20033
19797
|
const [showTooltip, setShowTooltip] = useState44(false);
|
|
20034
|
-
const ref =
|
|
19798
|
+
const ref = useRef48(null);
|
|
20035
19799
|
useResizeObserver4({
|
|
20036
19800
|
ref,
|
|
20037
19801
|
onResize: () => {
|
|
@@ -20240,7 +20004,7 @@ function Copy(props) {
|
|
|
20240
20004
|
|
|
20241
20005
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
20242
20006
|
import equal2 from "fast-deep-equal";
|
|
20243
|
-
import { useCallback as useCallback24, useRef as
|
|
20007
|
+
import { useCallback as useCallback24, useRef as useRef49 } from "react";
|
|
20244
20008
|
|
|
20245
20009
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
20246
20010
|
import { createContext as createContext8, useContext as useContext18 } from "react";
|
|
@@ -20263,12 +20027,12 @@ function DnDGrid(props) {
|
|
|
20263
20027
|
onReorder,
|
|
20264
20028
|
activeItemStyles
|
|
20265
20029
|
} = props;
|
|
20266
|
-
const gridEl =
|
|
20267
|
-
const dragEl =
|
|
20268
|
-
const cloneEl =
|
|
20269
|
-
const initialOrder =
|
|
20270
|
-
const reorderViaKeyboard =
|
|
20271
|
-
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({
|
|
20272
20036
|
x: 0,
|
|
20273
20037
|
y: 0
|
|
20274
20038
|
});
|
|
@@ -20730,14 +20494,14 @@ function HbSpinnerProvider({
|
|
|
20730
20494
|
|
|
20731
20495
|
// src/components/MaxLines.tsx
|
|
20732
20496
|
import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
20733
|
-
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";
|
|
20734
20498
|
import { trussProps as trussProps80 } from "@homebound/truss/runtime";
|
|
20735
20499
|
import { jsx as jsx160, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
20736
20500
|
function MaxLines({
|
|
20737
20501
|
maxLines,
|
|
20738
20502
|
children
|
|
20739
20503
|
}) {
|
|
20740
|
-
const elRef =
|
|
20504
|
+
const elRef = useRef50(null);
|
|
20741
20505
|
const [hasMore, setHasMore] = useState45(false);
|
|
20742
20506
|
const [expanded, setExpanded] = useState45(false);
|
|
20743
20507
|
useLayoutEffect2(() => {
|
|
@@ -20773,7 +20537,7 @@ function MaxLines({
|
|
|
20773
20537
|
|
|
20774
20538
|
// src/components/ScrollShadows.tsx
|
|
20775
20539
|
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
20776
|
-
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";
|
|
20777
20541
|
import { trussProps as trussProps81 } from "@homebound/truss/runtime";
|
|
20778
20542
|
import { jsx as jsx161, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
20779
20543
|
function ScrollShadows(props) {
|
|
@@ -20793,7 +20557,7 @@ function ScrollShadows(props) {
|
|
|
20793
20557
|
}
|
|
20794
20558
|
const [showStartShadow, setShowStartShadow] = useState46(false);
|
|
20795
20559
|
const [showEndShadow, setShowEndShadow] = useState46(false);
|
|
20796
|
-
const scrollRef =
|
|
20560
|
+
const scrollRef = useRef51(null);
|
|
20797
20561
|
const [startShadowStyles, endShadowStyles] = useMemo47(() => {
|
|
20798
20562
|
const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
|
|
20799
20563
|
const commonStyles = {
|
|
@@ -20966,7 +20730,7 @@ function useSnackbar() {
|
|
|
20966
20730
|
var snackbarId = 1;
|
|
20967
20731
|
|
|
20968
20732
|
// src/components/Stepper.tsx
|
|
20969
|
-
import { useRef as
|
|
20733
|
+
import { useRef as useRef52 } from "react";
|
|
20970
20734
|
import { useButton as useButton11, useFocusRing as useFocusRing14, useHover as useHover18 } from "react-aria";
|
|
20971
20735
|
import { trussProps as trussProps82 } from "@homebound/truss/runtime";
|
|
20972
20736
|
import { jsx as jsx162, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
@@ -21044,7 +20808,7 @@ function StepButton(props) {
|
|
|
21044
20808
|
onPress: onClick,
|
|
21045
20809
|
isDisabled: disabled
|
|
21046
20810
|
};
|
|
21047
|
-
const ref =
|
|
20811
|
+
const ref = useRef52(null);
|
|
21048
20812
|
const {
|
|
21049
20813
|
buttonProps,
|
|
21050
20814
|
isPressed
|
|
@@ -21438,7 +21202,7 @@ function visit(rows, fn) {
|
|
|
21438
21202
|
|
|
21439
21203
|
// src/components/Tabs.tsx
|
|
21440
21204
|
import { camelCase as camelCase5 } from "change-case";
|
|
21441
|
-
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";
|
|
21442
21206
|
import { mergeProps as mergeProps26, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
|
|
21443
21207
|
import { matchPath, Route } from "react-router";
|
|
21444
21208
|
import { Link as Link5, useLocation } from "react-router-dom";
|
|
@@ -21497,7 +21261,7 @@ function Tabs(props) {
|
|
|
21497
21261
|
} = useFocusRing15();
|
|
21498
21262
|
const tid = useTestIds(others, "tabs");
|
|
21499
21263
|
const [active, setActive] = useState47(selected);
|
|
21500
|
-
const ref =
|
|
21264
|
+
const ref = useRef53(null);
|
|
21501
21265
|
useEffect32(() => setActive(selected), [selected]);
|
|
21502
21266
|
function onKeyUp(e) {
|
|
21503
21267
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
@@ -21895,7 +21659,6 @@ export {
|
|
|
21895
21659
|
filterTestIdPrefix,
|
|
21896
21660
|
formatDate,
|
|
21897
21661
|
formatDateRange,
|
|
21898
|
-
formatPlainDate,
|
|
21899
21662
|
formatValue,
|
|
21900
21663
|
generateColumnId,
|
|
21901
21664
|
getAlignment,
|