@homebound/beam 3.2.0 → 3.4.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 +378 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -49
- package/dist/index.d.ts +63 -49
- package/dist/index.js +517 -258
- package/dist/index.js.map +1 -1
- package/dist/utils/rtlUtils.cjs +2 -2
- package/dist/utils/rtlUtils.cjs.map +1 -1
- package/dist/utils/rtlUtils.d.cts +1 -1
- package/dist/utils/rtlUtils.d.ts +1 -1
- package/dist/utils/rtlUtils.js +2 -2
- package/dist/utils/rtlUtils.js.map +1 -1
- package/package.json +2 -1
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 useRef39, useState as useState29 } from "react";
|
|
4906
4906
|
import { Virtuoso as Virtuoso2 } from "react-virtuoso";
|
|
4907
4907
|
|
|
4908
4908
|
// src/components/Layout/ScrollableContent.tsx
|
|
@@ -5482,27 +5482,50 @@ function useHover2(props) {
|
|
|
5482
5482
|
}
|
|
5483
5483
|
|
|
5484
5484
|
// src/hooks/usePersistedFilter.ts
|
|
5485
|
-
import { useEffect as useEffect6, useMemo as useMemo8 } from "react";
|
|
5485
|
+
import { useEffect as useEffect6, useMemo as useMemo8, useRef as useRef6 } from "react";
|
|
5486
5486
|
import { JsonParam, useQueryParams as useQueryParams2 } from "use-query-params";
|
|
5487
5487
|
function usePersistedFilter({ storageKey, filterDefs }) {
|
|
5488
|
-
const
|
|
5488
|
+
const filterImpls = useMemo8(
|
|
5489
|
+
() => Object.fromEntries(safeEntries(filterDefs).map(([key, def]) => [key, def(key)])),
|
|
5490
|
+
[filterDefs]
|
|
5491
|
+
);
|
|
5492
|
+
const filterKeys = useMemo8(() => Object.keys(filterImpls), [filterImpls]);
|
|
5489
5493
|
const defaultFilter = useMemo8(
|
|
5490
5494
|
() => Object.fromEntries(
|
|
5491
|
-
safeEntries(
|
|
5495
|
+
safeEntries(filterImpls).filter(([, def]) => def.defaultValue !== void 0).map(([key, def]) => [key, def.defaultValue])
|
|
5492
5496
|
),
|
|
5493
|
-
[
|
|
5497
|
+
[filterImpls]
|
|
5494
5498
|
);
|
|
5495
5499
|
const [{ filter: queryParamsFilter }, setQueryParams] = useQueryParams2({ filter: JsonParam });
|
|
5496
|
-
const [storedFilter, setStoredFilter] = useSessionStorage(
|
|
5500
|
+
const [storedFilter, setStoredFilter] = useSessionStorage(
|
|
5501
|
+
storageKey,
|
|
5502
|
+
dehydrateFilter(filterImpls, defaultFilter) ?? defaultFilter
|
|
5503
|
+
);
|
|
5497
5504
|
const isQueryParamFilterValid = hasValidFilterKeys(queryParamsFilter, filterKeys);
|
|
5498
|
-
const
|
|
5499
|
-
const
|
|
5505
|
+
const serializedQueryParamsFilter = useMemo8(() => JSON.stringify(queryParamsFilter), [queryParamsFilter]);
|
|
5506
|
+
const serializedStoredFilter = useMemo8(() => JSON.stringify(storedFilter), [storedFilter]);
|
|
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) });
|
|
5500
5523
|
useEffect6(
|
|
5501
5524
|
() => {
|
|
5502
5525
|
if (queryParamsFilter === void 0) {
|
|
5503
5526
|
setQueryParams({ filter: storedFilter }, "replaceIn");
|
|
5504
5527
|
} else if (!isQueryParamFilterValid) {
|
|
5505
|
-
setQueryParams({ filter: defaultFilter }, "replaceIn");
|
|
5528
|
+
setQueryParams({ filter: dehydrateFilter(filterImpls, defaultFilter) }, "replaceIn");
|
|
5506
5529
|
} else if (JSON.stringify(queryParamsFilter) !== JSON.stringify(storedFilter)) {
|
|
5507
5530
|
setStoredFilter(queryParamsFilter);
|
|
5508
5531
|
}
|
|
@@ -5514,7 +5537,46 @@ function usePersistedFilter({ storageKey, filterDefs }) {
|
|
|
5514
5537
|
return { setFilter, filter };
|
|
5515
5538
|
}
|
|
5516
5539
|
function hasValidFilterKeys(queryParamsFilter, definedKeys) {
|
|
5517
|
-
return queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
|
|
5540
|
+
return !!queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
|
|
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;
|
|
5518
5580
|
}
|
|
5519
5581
|
|
|
5520
5582
|
// src/hooks/useSessionStorage.ts
|
|
@@ -5937,21 +5999,122 @@ function CollapseToggle(props) {
|
|
|
5937
5999
|
import { useContext as useContext12 } from "react";
|
|
5938
6000
|
|
|
5939
6001
|
// src/inputs/Autocomplete.tsx
|
|
5940
|
-
import { useCallback as useCallback10, useRef as
|
|
6002
|
+
import { useCallback as useCallback10, useRef as useRef24 } from "react";
|
|
5941
6003
|
import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition5 } from "react-aria";
|
|
5942
6004
|
import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stately";
|
|
5943
6005
|
|
|
5944
6006
|
// src/components/internal/DatePicker/DatePicker.tsx
|
|
5945
6007
|
import { DayPicker } from "react-day-picker";
|
|
5946
6008
|
|
|
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
|
+
|
|
5947
6110
|
// src/components/internal/DatePicker/Day.tsx
|
|
5948
|
-
import { useRef as
|
|
6111
|
+
import { useRef as useRef7 } from "react";
|
|
5949
6112
|
import { useDayRender } from "react-day-picker";
|
|
5950
6113
|
import { trussProps as trussProps12, mergeProps as mergeProps3 } from "@homebound/truss/runtime";
|
|
5951
6114
|
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5952
6115
|
function Day(props) {
|
|
5953
6116
|
const tid = useTestIds(props, "datePickerDay");
|
|
5954
|
-
const buttonRef =
|
|
6117
|
+
const buttonRef = useRef7(null);
|
|
5955
6118
|
const {
|
|
5956
6119
|
isHidden,
|
|
5957
6120
|
isButton,
|
|
@@ -6078,18 +6241,19 @@ var rangeBaseStyles = {
|
|
|
6078
6241
|
};
|
|
6079
6242
|
|
|
6080
6243
|
// src/components/internal/DatePicker/Header.tsx
|
|
6081
|
-
import { addMonths, addYears
|
|
6244
|
+
import { addMonths, addYears } from "date-fns";
|
|
6082
6245
|
import { useNavigation } from "react-day-picker";
|
|
6083
6246
|
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6084
6247
|
function Header(props) {
|
|
6085
6248
|
const {
|
|
6086
6249
|
displayMonth
|
|
6087
6250
|
} = props;
|
|
6251
|
+
const displayMonthDate = jsDateToPlainDate(displayMonth);
|
|
6088
6252
|
const {
|
|
6089
6253
|
goToMonth
|
|
6090
6254
|
} = useNavigation();
|
|
6091
6255
|
return /* @__PURE__ */ jsxs10("div", { className: "df jcsb aic ml_12px mr_2px h_32px", children: [
|
|
6092
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6256
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "monthYear") }),
|
|
6093
6257
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
6094
6258
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addMonths(displayMonth, -1)) }),
|
|
6095
6259
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addMonths(displayMonth, 1)) })
|
|
@@ -6100,36 +6264,41 @@ function YearSkipHeader(props) {
|
|
|
6100
6264
|
const {
|
|
6101
6265
|
displayMonth
|
|
6102
6266
|
} = props;
|
|
6267
|
+
const displayMonthDate = jsDateToPlainDate(displayMonth);
|
|
6103
6268
|
const {
|
|
6104
6269
|
goToMonth
|
|
6105
6270
|
} = useNavigation();
|
|
6106
6271
|
return /* @__PURE__ */ jsxs10("div", { className: "df jcsb aic ml_12px mr_12px h_32px", children: [
|
|
6107
6272
|
/* @__PURE__ */ jsxs10("div", { className: "df fdr jcsb", children: [
|
|
6108
6273
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addMonths(displayMonth, -1)) }),
|
|
6109
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6274
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "shortMonth") }),
|
|
6110
6275
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addMonths(displayMonth, 1)) })
|
|
6111
6276
|
] }),
|
|
6112
6277
|
/* @__PURE__ */ jsxs10("div", { className: "df fdr jcsb", children: [
|
|
6113
6278
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth(addYears(displayMonth, -1)) }),
|
|
6114
|
-
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children:
|
|
6279
|
+
/* @__PURE__ */ jsx17("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "year") }),
|
|
6115
6280
|
/* @__PURE__ */ jsx17(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth(addYears(displayMonth, 1)) })
|
|
6116
6281
|
] })
|
|
6117
6282
|
] });
|
|
6118
6283
|
}
|
|
6119
6284
|
|
|
6120
6285
|
// src/components/internal/DatePicker/WeekHeader.tsx
|
|
6121
|
-
import { addDays, format as format2, startOfWeek } from "date-fns";
|
|
6122
6286
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6123
6287
|
function WeekHeader() {
|
|
6124
|
-
const
|
|
6288
|
+
const today = todayPlainDate();
|
|
6289
|
+
const start = today.subtract({
|
|
6290
|
+
days: today.dayOfWeek % 7
|
|
6291
|
+
});
|
|
6125
6292
|
const days = [];
|
|
6126
6293
|
for (let i = 0; i < 7; i++) {
|
|
6127
|
-
days.push(
|
|
6294
|
+
days.push(start.add({
|
|
6295
|
+
days: i
|
|
6296
|
+
}));
|
|
6128
6297
|
}
|
|
6129
6298
|
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: [
|
|
6130
|
-
/* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children:
|
|
6131
|
-
/* @__PURE__ */ jsx18("span", { className: "rdp-vhidden", children:
|
|
6132
|
-
] },
|
|
6299
|
+
/* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: formatPlainDate(day, "weekdayInitial") }),
|
|
6300
|
+
/* @__PURE__ */ jsx18("span", { className: "rdp-vhidden", children: formatPlainDate(day, "weekday") })
|
|
6301
|
+
] }, formatPlainDate(day, "weekday"))) }) });
|
|
6133
6302
|
}
|
|
6134
6303
|
|
|
6135
6304
|
// src/components/internal/DatePicker/DatePicker.tsx
|
|
@@ -6151,15 +6320,15 @@ function DatePicker(props) {
|
|
|
6151
6320
|
Head: WeekHeader,
|
|
6152
6321
|
Day
|
|
6153
6322
|
},
|
|
6154
|
-
selected: value ? [value] : [],
|
|
6155
|
-
defaultMonth: value ??
|
|
6323
|
+
selected: value ? [plainDateToJsDate(value)] : [],
|
|
6324
|
+
defaultMonth: plainDateToJsDate(value ?? todayPlainDate()),
|
|
6156
6325
|
onDayClick: (day, modifiers) => {
|
|
6157
6326
|
if (modifiers.disabled) return;
|
|
6158
|
-
onSelect(day);
|
|
6327
|
+
onSelect(jsDateToPlainDate(day));
|
|
6159
6328
|
},
|
|
6160
|
-
disabled: disabledDays,
|
|
6329
|
+
disabled: dateMatchersToDayPickerMatchers(disabledDays),
|
|
6161
6330
|
modifiers: {
|
|
6162
|
-
indicatorDot: dottedDays ?? []
|
|
6331
|
+
indicatorDot: dateMatchersToDayPickerMatchers(dottedDays) ?? []
|
|
6163
6332
|
}
|
|
6164
6333
|
}
|
|
6165
6334
|
) });
|
|
@@ -6186,21 +6355,21 @@ function DateRangePicker(props) {
|
|
|
6186
6355
|
useYearPicker
|
|
6187
6356
|
} = props;
|
|
6188
6357
|
const tid = useTestIds(props, "datePicker");
|
|
6189
|
-
return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected: range, components: {
|
|
6358
|
+
return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected: dateRangeToJsDateRange(range), components: {
|
|
6190
6359
|
Caption: useYearPicker ? YearSkipHeader : Header,
|
|
6191
6360
|
Head: WeekHeader,
|
|
6192
6361
|
Day
|
|
6193
|
-
}, defaultMonth: range?.to ??
|
|
6362
|
+
}, defaultMonth: plainDateToJsDate(range?.to ?? range?.from ?? todayPlainDate()), onSelect: (selection, day, activeModifiers) => {
|
|
6194
6363
|
if (activeModifiers.disabled) return;
|
|
6195
|
-
onSelect(selection);
|
|
6196
|
-
}, disabled: disabledDays, modifiers: {
|
|
6197
|
-
indicatorDot: dottedDays ?? []
|
|
6364
|
+
onSelect(jsDateRangeToDateRange(selection));
|
|
6365
|
+
}, disabled: dateMatchersToDayPickerMatchers(disabledDays), modifiers: {
|
|
6366
|
+
indicatorDot: dateMatchersToDayPickerMatchers(dottedDays) ?? []
|
|
6198
6367
|
} }) });
|
|
6199
6368
|
}
|
|
6200
6369
|
|
|
6201
6370
|
// src/components/internal/Menu.tsx
|
|
6202
6371
|
import { camelCase } from "change-case";
|
|
6203
|
-
import { useEffect as useEffect8, useMemo as useMemo9, useRef as
|
|
6372
|
+
import { useEffect as useEffect8, useMemo as useMemo9, useRef as useRef11, useState as useState11 } from "react";
|
|
6204
6373
|
import { FocusScope, useFilter as useFilter2, useMenu } from "react-aria";
|
|
6205
6374
|
import { Item, Section, useTreeData, useTreeState } from "react-stately";
|
|
6206
6375
|
|
|
@@ -6245,7 +6414,7 @@ import { trussProps as trussProps21 } from "@homebound/truss/runtime";
|
|
|
6245
6414
|
|
|
6246
6415
|
// src/inputs/internal/MenuSearchField.tsx
|
|
6247
6416
|
import { useTextField } from "@react-aria/textfield";
|
|
6248
|
-
import { useRef as
|
|
6417
|
+
import { useRef as useRef10 } from "react";
|
|
6249
6418
|
|
|
6250
6419
|
// src/inputs/TextFieldBase.tsx
|
|
6251
6420
|
import { useState as useState10 } from "react";
|
|
@@ -6344,7 +6513,7 @@ function InlineLabel({
|
|
|
6344
6513
|
|
|
6345
6514
|
// src/components/Table/components/Row.tsx
|
|
6346
6515
|
import { observer } from "mobx-react";
|
|
6347
|
-
import React6, { useCallback as useCallback6, useContext as useContext10, useRef as
|
|
6516
|
+
import React6, { useCallback as useCallback6, useContext as useContext10, useRef as useRef9 } from "react";
|
|
6348
6517
|
import { mergeProps as mergeProps5 } from "react-aria";
|
|
6349
6518
|
|
|
6350
6519
|
// src/components/Table/components/cell.tsx
|
|
@@ -6410,7 +6579,7 @@ var rowClickRenderFn = (as, api, colSpan) => (key, css2, content, row, rowStyle,
|
|
|
6410
6579
|
};
|
|
6411
6580
|
|
|
6412
6581
|
// src/components/Table/components/ColumnResizeHandle.tsx
|
|
6413
|
-
import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as
|
|
6582
|
+
import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as useRef8, useState as useState9 } from "react";
|
|
6414
6583
|
import { trussProps as trussProps16 } from "@homebound/truss/runtime";
|
|
6415
6584
|
import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6416
6585
|
function findScrollableParent(element) {
|
|
@@ -6448,13 +6617,13 @@ function ColumnResizeHandle({
|
|
|
6448
6617
|
const [guideLineX, setGuideLineX] = useState9(null);
|
|
6449
6618
|
const [guideLineTop, setGuideLineTop] = useState9(0);
|
|
6450
6619
|
const [guideLineHeight, setGuideLineHeight] = useState9(0);
|
|
6451
|
-
const startXRef =
|
|
6452
|
-
const startWidthRef =
|
|
6453
|
-
const startHandleRightRef =
|
|
6454
|
-
const handleRef =
|
|
6455
|
-
const rafRef =
|
|
6456
|
-
const pendingMouseXRef =
|
|
6457
|
-
const scrollableParentRef =
|
|
6620
|
+
const startXRef = useRef8(0);
|
|
6621
|
+
const startWidthRef = useRef8(0);
|
|
6622
|
+
const startHandleRightRef = useRef8(0);
|
|
6623
|
+
const handleRef = useRef8(null);
|
|
6624
|
+
const rafRef = useRef8(null);
|
|
6625
|
+
const pendingMouseXRef = useRef8(null);
|
|
6626
|
+
const scrollableParentRef = useRef8(null);
|
|
6458
6627
|
const tid = useTestIds({}, "columnResizeHandle");
|
|
6459
6628
|
const handleMouseDown = useCallback5((e) => {
|
|
6460
6629
|
e.preventDefault();
|
|
@@ -7347,6 +7516,7 @@ var RowState = class {
|
|
|
7347
7516
|
};
|
|
7348
7517
|
|
|
7349
7518
|
// src/components/Table/utils/sortRows.ts
|
|
7519
|
+
import { Temporal as Temporal2 } from "temporal-polyfill";
|
|
7350
7520
|
function sortRows(columns, rows, sortState, caseSensitive) {
|
|
7351
7521
|
const fn = sortFn(columns, sortState, caseSensitive);
|
|
7352
7522
|
const sorted = [...rows].sort(fn);
|
|
@@ -7411,7 +7581,7 @@ function sortValue(value, caseSensitive) {
|
|
|
7411
7581
|
if (maybeFn instanceof Function) {
|
|
7412
7582
|
maybeFn = maybeFn();
|
|
7413
7583
|
}
|
|
7414
|
-
return
|
|
7584
|
+
return normalizeSortValue(maybeFn, caseSensitive);
|
|
7415
7585
|
}
|
|
7416
7586
|
function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, maybeContent) {
|
|
7417
7587
|
if (process.env.NODE_ENV !== "production" && !isHeader && sortOn === "client" && column2.clientSideSort !== false) {
|
|
@@ -7426,7 +7596,24 @@ function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, may
|
|
|
7426
7596
|
}
|
|
7427
7597
|
function canClientSideSort(value) {
|
|
7428
7598
|
const t = typeof value;
|
|
7429
|
-
return value === null || t === "undefined" || t === "number" || t === "string" || t === "boolean" || value instanceof Date;
|
|
7599
|
+
return value === null || t === "undefined" || t === "number" || t === "string" || t === "bigint" || t === "boolean" || value instanceof Date || isPlainDate2(value) || isZonedDateTime(value);
|
|
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;
|
|
7430
7617
|
}
|
|
7431
7618
|
|
|
7432
7619
|
// src/components/Table/components/Row.tsx
|
|
@@ -7596,7 +7783,7 @@ function RowImpl(props) {
|
|
|
7596
7783
|
let foundFirstContentColumn = false;
|
|
7597
7784
|
let minStickyLeftOffset = 0;
|
|
7598
7785
|
let expandColumnHidden = false;
|
|
7599
|
-
const ref =
|
|
7786
|
+
const ref = useRef9(null);
|
|
7600
7787
|
const dragOverCallback = useCallback6((row2, evt) => onDragOver?.(row2, evt), [onDragOver]);
|
|
7601
7788
|
const onDragOverDebounced = useDebouncedCallback2(dragOverCallback, 100);
|
|
7602
7789
|
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) => {
|
|
@@ -8362,7 +8549,7 @@ var textFieldBaseMultilineTopPadding = 11;
|
|
|
8362
8549
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
8363
8550
|
function MenuSearchField(props) {
|
|
8364
8551
|
const tid = useTestIds(props);
|
|
8365
|
-
const inputRef =
|
|
8552
|
+
const inputRef = useRef10(null);
|
|
8366
8553
|
const { labelProps, inputProps } = useTextField({ ...props }, inputRef);
|
|
8367
8554
|
return /* @__PURE__ */ jsx31(
|
|
8368
8555
|
TextFieldBase,
|
|
@@ -8446,7 +8633,7 @@ function Menu(props) {
|
|
|
8446
8633
|
keys !== "all" && onChange && onChange([...keys.values()].map((k) => k.toString())[0]);
|
|
8447
8634
|
}
|
|
8448
8635
|
});
|
|
8449
|
-
const menuRef =
|
|
8636
|
+
const menuRef = useRef11(null);
|
|
8450
8637
|
const {
|
|
8451
8638
|
menuProps
|
|
8452
8639
|
} = useMenu({
|
|
@@ -8488,7 +8675,7 @@ function Menu(props) {
|
|
|
8488
8675
|
}
|
|
8489
8676
|
|
|
8490
8677
|
// src/components/internal/MenuItem.tsx
|
|
8491
|
-
import { useRef as
|
|
8678
|
+
import { useRef as useRef14 } from "react";
|
|
8492
8679
|
import { useHover as useHover7, useMenuItem } from "react-aria";
|
|
8493
8680
|
import { useHistory } from "react-router";
|
|
8494
8681
|
import { Link as Link3 } from "react-router-dom";
|
|
@@ -8743,12 +8930,12 @@ var pressedOverlayCss = {
|
|
|
8743
8930
|
};
|
|
8744
8931
|
|
|
8745
8932
|
// src/components/ButtonModal.tsx
|
|
8746
|
-
import { useRef as
|
|
8933
|
+
import { useRef as useRef13 } from "react";
|
|
8747
8934
|
import { useMenuTrigger } from "react-aria";
|
|
8748
8935
|
import { useMenuTriggerState } from "react-stately";
|
|
8749
8936
|
|
|
8750
8937
|
// src/components/internal/OverlayTrigger.tsx
|
|
8751
|
-
import { useMemo as useMemo13, useRef as
|
|
8938
|
+
import { useMemo as useMemo13, useRef as useRef12 } from "react";
|
|
8752
8939
|
import { useOverlayPosition } from "react-aria";
|
|
8753
8940
|
|
|
8754
8941
|
// src/components/Button.tsx
|
|
@@ -9438,7 +9625,7 @@ function OverlayTrigger(props) {
|
|
|
9438
9625
|
}
|
|
9439
9626
|
}
|
|
9440
9627
|
}), [menuTriggerProps, state]);
|
|
9441
|
-
const popoverRef =
|
|
9628
|
+
const popoverRef = useRef12(null);
|
|
9442
9629
|
const {
|
|
9443
9630
|
overlayProps: positionProps
|
|
9444
9631
|
} = useOverlayPosition({
|
|
@@ -9500,7 +9687,7 @@ import { jsx as jsx39 } from "react/jsx-runtime";
|
|
|
9500
9687
|
function ButtonModal(props) {
|
|
9501
9688
|
const { storybookDefaultOpen, trigger, disabled, content, title } = props;
|
|
9502
9689
|
const state = useMenuTriggerState({ isOpen: storybookDefaultOpen });
|
|
9503
|
-
const buttonRef =
|
|
9690
|
+
const buttonRef = useRef13(null);
|
|
9504
9691
|
const { menuTriggerProps } = useMenuTrigger({ isDisabled: !!disabled }, state, buttonRef);
|
|
9505
9692
|
const tid = useTestIds(
|
|
9506
9693
|
props,
|
|
@@ -9584,7 +9771,7 @@ function MenuItemImpl(props) {
|
|
|
9584
9771
|
const isDisabled = Boolean(disabled);
|
|
9585
9772
|
const isSelected = state.selectionManager.selectedKeys.has(label);
|
|
9586
9773
|
const isFocused = state.selectionManager.focusedKey === item.key;
|
|
9587
|
-
const ref =
|
|
9774
|
+
const ref = useRef14(null);
|
|
9588
9775
|
const history = useHistory();
|
|
9589
9776
|
const {
|
|
9590
9777
|
hoverProps,
|
|
@@ -9731,7 +9918,7 @@ function Popover(props) {
|
|
|
9731
9918
|
}
|
|
9732
9919
|
|
|
9733
9920
|
// src/inputs/internal/ComboBoxBase.tsx
|
|
9734
|
-
import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as
|
|
9921
|
+
import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as useRef23, useState as useState19 } from "react";
|
|
9735
9922
|
import { useButton as useButton7, useComboBox as useComboBox2, useFilter as useFilter4, useOverlayPosition as useOverlayPosition4 } from "react-aria";
|
|
9736
9923
|
import { Item as Item4, useComboBoxState as useComboBoxState2 } from "react-stately";
|
|
9737
9924
|
import { trussProps as trussProps39 } from "@homebound/truss/runtime";
|
|
@@ -9802,13 +9989,13 @@ function useGrowingTextField({ inputRef, inputWrapRef, value, disabled, maxLines
|
|
|
9802
9989
|
}
|
|
9803
9990
|
|
|
9804
9991
|
// src/inputs/TreeSelectField/TreeSelectField.tsx
|
|
9805
|
-
import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as
|
|
9992
|
+
import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as useRef22, useState as useState17 } from "react";
|
|
9806
9993
|
import { useButton as useButton6, useComboBox, useFilter as useFilter3, useOverlayPosition as useOverlayPosition3 } from "react-aria";
|
|
9807
9994
|
import { Item as Item3, useComboBoxState } from "react-stately";
|
|
9808
9995
|
import { trussProps as trussProps37 } from "@homebound/truss/runtime";
|
|
9809
9996
|
|
|
9810
9997
|
// src/inputs/internal/ListBox.tsx
|
|
9811
|
-
import { useEffect as useEffect12, useRef as
|
|
9998
|
+
import { useEffect as useEffect12, useRef as useRef21, useState as useState16 } from "react";
|
|
9812
9999
|
import { useListBox } from "react-aria";
|
|
9813
10000
|
import { trussProps as trussProps36 } from "@homebound/truss/runtime";
|
|
9814
10001
|
|
|
@@ -9821,17 +10008,17 @@ import { useListBoxSection, useSeparator as useSeparator2 } from "react-aria";
|
|
|
9821
10008
|
import { trussProps as trussProps35 } from "@homebound/truss/runtime";
|
|
9822
10009
|
|
|
9823
10010
|
// src/inputs/internal/Option.tsx
|
|
9824
|
-
import { useRef as
|
|
10011
|
+
import { useRef as useRef17 } from "react";
|
|
9825
10012
|
import { mergeProps as mergeProps12, useHover as useHover8, useOption } from "react-aria";
|
|
9826
10013
|
|
|
9827
10014
|
// src/inputs/ChipSelectField.tsx
|
|
9828
10015
|
import { camelCase as camelCase2 } from "change-case";
|
|
9829
|
-
import { useEffect as useEffect10, useMemo as useMemo14, useRef as
|
|
10016
|
+
import { useEffect as useEffect10, useMemo as useMemo14, useRef as useRef16, useState as useState15 } from "react";
|
|
9830
10017
|
import { mergeProps as mergeProps11, useButton as useButton5, useFocus as useFocus2, useOverlayPosition as useOverlayPosition2, useSelect } from "react-aria";
|
|
9831
10018
|
import { Item as Item2, Section as Section2, useListData, useSelectState } from "react-stately";
|
|
9832
10019
|
|
|
9833
10020
|
// src/inputs/ChipTextField.tsx
|
|
9834
|
-
import { useEffect as useEffect9, useRef as
|
|
10021
|
+
import { useEffect as useEffect9, useRef as useRef15, useState as useState14 } from "react";
|
|
9835
10022
|
import { useFocus } from "react-aria";
|
|
9836
10023
|
import { trussProps as trussProps28 } from "@homebound/truss/runtime";
|
|
9837
10024
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
@@ -9850,7 +10037,7 @@ function ChipTextField(props) {
|
|
|
9850
10037
|
const {
|
|
9851
10038
|
fieldProps
|
|
9852
10039
|
} = usePresentationContext();
|
|
9853
|
-
const valueRef =
|
|
10040
|
+
const valueRef = useRef15(value);
|
|
9854
10041
|
const tid = useTestIds(props, "chipField");
|
|
9855
10042
|
const [isFocused, setIsFocused] = useState14(false);
|
|
9856
10043
|
const {
|
|
@@ -9871,7 +10058,7 @@ function ChipTextField(props) {
|
|
|
9871
10058
|
onBlur: () => maybeCall(onBlur),
|
|
9872
10059
|
onFocusChange: setIsFocused
|
|
9873
10060
|
});
|
|
9874
|
-
const fieldRef =
|
|
10061
|
+
const fieldRef = useRef15(null);
|
|
9875
10062
|
useEffect9(
|
|
9876
10063
|
() => {
|
|
9877
10064
|
autoFocus && fieldRef.current?.focus();
|
|
@@ -9978,7 +10165,7 @@ function defaultOptionLabel(opt) {
|
|
|
9978
10165
|
import { trussProps as trussProps30 } from "@homebound/truss/runtime";
|
|
9979
10166
|
import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9980
10167
|
function ChipSelectField(props) {
|
|
9981
|
-
const firstRender =
|
|
10168
|
+
const firstRender = useRef16(true);
|
|
9982
10169
|
const {
|
|
9983
10170
|
fieldProps
|
|
9984
10171
|
} = usePresentationContext();
|
|
@@ -10036,10 +10223,10 @@ function ChipSelectField(props) {
|
|
|
10036
10223
|
} = useFocus2({
|
|
10037
10224
|
onFocusChange: setIsClearFocused
|
|
10038
10225
|
});
|
|
10039
|
-
const buttonRef =
|
|
10040
|
-
const popoverRef =
|
|
10041
|
-
const listBoxRef =
|
|
10042
|
-
const wrapperRef =
|
|
10226
|
+
const buttonRef = useRef16(null);
|
|
10227
|
+
const popoverRef = useRef16(null);
|
|
10228
|
+
const listBoxRef = useRef16(null);
|
|
10229
|
+
const wrapperRef = useRef16(null);
|
|
10043
10230
|
const listData = useListData({
|
|
10044
10231
|
initialItems: !onCreateNew ? options : [{
|
|
10045
10232
|
title: "Options",
|
|
@@ -10243,7 +10430,7 @@ function Option(props) {
|
|
|
10243
10430
|
scrollToIndex,
|
|
10244
10431
|
disabledReason
|
|
10245
10432
|
} = props;
|
|
10246
|
-
const ref =
|
|
10433
|
+
const ref = useRef17(null);
|
|
10247
10434
|
const {
|
|
10248
10435
|
hoverProps,
|
|
10249
10436
|
isHovered
|
|
@@ -10322,7 +10509,7 @@ function Option(props) {
|
|
|
10322
10509
|
|
|
10323
10510
|
// src/inputs/internal/VirtualizedOptions.tsx
|
|
10324
10511
|
import { getInteractionModality } from "@react-aria/interactions";
|
|
10325
|
-
import { useEffect as useEffect11, useRef as
|
|
10512
|
+
import { useEffect as useEffect11, useRef as useRef20 } from "react";
|
|
10326
10513
|
import { Virtuoso } from "react-virtuoso";
|
|
10327
10514
|
|
|
10328
10515
|
// src/inputs/internal/LoadingDots.tsx
|
|
@@ -10370,11 +10557,11 @@ function LoadingDots({
|
|
|
10370
10557
|
}
|
|
10371
10558
|
|
|
10372
10559
|
// src/inputs/TreeSelectField/TreeOption.tsx
|
|
10373
|
-
import { useRef as
|
|
10560
|
+
import { useRef as useRef19 } from "react";
|
|
10374
10561
|
import { useHover as useHover10, useOption as useOption2 } from "react-aria";
|
|
10375
10562
|
|
|
10376
10563
|
// src/inputs/CheckboxBase.tsx
|
|
10377
|
-
import { useRef as
|
|
10564
|
+
import { useRef as useRef18 } from "react";
|
|
10378
10565
|
import { mergeProps as mergeProps13, useFocusRing as useFocusRing5, useHover as useHover9, VisuallyHidden as VisuallyHidden3 } from "react-aria";
|
|
10379
10566
|
import { trussProps as trussProps33 } from "@homebound/truss/runtime";
|
|
10380
10567
|
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
@@ -10393,7 +10580,7 @@ function CheckboxBase(props) {
|
|
|
10393
10580
|
tooltip,
|
|
10394
10581
|
fullWidth = false
|
|
10395
10582
|
} = props;
|
|
10396
|
-
const ref =
|
|
10583
|
+
const ref = useRef18(null);
|
|
10397
10584
|
const {
|
|
10398
10585
|
isFocusVisible,
|
|
10399
10586
|
focusProps
|
|
@@ -10538,7 +10725,7 @@ function TreeOption(props) {
|
|
|
10538
10725
|
const leveledOption = item.value;
|
|
10539
10726
|
if (!leveledOption) return null;
|
|
10540
10727
|
const [option, level] = leveledOption;
|
|
10541
|
-
const ref =
|
|
10728
|
+
const ref = useRef19(null);
|
|
10542
10729
|
const {
|
|
10543
10730
|
hoverProps,
|
|
10544
10731
|
isHovered
|
|
@@ -10688,7 +10875,7 @@ function VirtualizedOptions(props) {
|
|
|
10688
10875
|
isTree,
|
|
10689
10876
|
allowCollapsing
|
|
10690
10877
|
} = props;
|
|
10691
|
-
const virtuosoRef =
|
|
10878
|
+
const virtuosoRef = useRef20(null);
|
|
10692
10879
|
const focusedKey = state.selectionManager.focusedKey;
|
|
10693
10880
|
const focusedItem = focusedKey != null ? state.collection.getItem(focusedKey) : null;
|
|
10694
10881
|
const selectedItem = state.selectionManager.selectedKeys.size > 0 ? state.collection.getItem([...state.selectionManager.selectedKeys.values()][0]) : void 0;
|
|
@@ -10843,9 +11030,9 @@ function ListBox(props) {
|
|
|
10843
11030
|
const isMultiSelect = state.selectionManager.selectionMode === "multiple";
|
|
10844
11031
|
const firstItem = state.collection.at(0);
|
|
10845
11032
|
const hasSections = firstItem && firstItem.type === "section";
|
|
10846
|
-
const selectedList =
|
|
10847
|
-
const firstRender =
|
|
10848
|
-
const virtuosoListHeight =
|
|
11033
|
+
const selectedList = useRef21(null);
|
|
11034
|
+
const firstRender = useRef21(true);
|
|
11035
|
+
const virtuosoListHeight = useRef21(0);
|
|
10849
11036
|
const onListHeightChange = (listHeight) => {
|
|
10850
11037
|
virtuosoListHeight.current = listHeight;
|
|
10851
11038
|
const height = (selectedList.current?.offsetHeight || 0) + listHeight;
|
|
@@ -11088,7 +11275,7 @@ function TreeSelectFieldBase(props) {
|
|
|
11088
11275
|
}));
|
|
11089
11276
|
}
|
|
11090
11277
|
}, []);
|
|
11091
|
-
const firstOpen =
|
|
11278
|
+
const firstOpen = useRef22(true);
|
|
11092
11279
|
function onOpenChange(isOpen) {
|
|
11093
11280
|
if (firstOpen.current && isOpen) {
|
|
11094
11281
|
maybeInitLoad(options, setFieldState);
|
|
@@ -11249,12 +11436,12 @@ function TreeSelectFieldBase(props) {
|
|
|
11249
11436
|
}));
|
|
11250
11437
|
}
|
|
11251
11438
|
}
|
|
11252
|
-
const comboBoxRef =
|
|
11253
|
-
const triggerRef =
|
|
11254
|
-
const inputRef =
|
|
11255
|
-
const inputWrapRef =
|
|
11256
|
-
const listBoxRef =
|
|
11257
|
-
const popoverRef =
|
|
11439
|
+
const comboBoxRef = useRef22(null);
|
|
11440
|
+
const triggerRef = useRef22(null);
|
|
11441
|
+
const inputRef = useRef22(null);
|
|
11442
|
+
const inputWrapRef = useRef22(null);
|
|
11443
|
+
const listBoxRef = useRef22(null);
|
|
11444
|
+
const popoverRef = useRef22(null);
|
|
11258
11445
|
const {
|
|
11259
11446
|
buttonProps: triggerProps,
|
|
11260
11447
|
inputProps,
|
|
@@ -11625,7 +11812,7 @@ function ComboBoxBase(props) {
|
|
|
11625
11812
|
}));
|
|
11626
11813
|
}
|
|
11627
11814
|
}
|
|
11628
|
-
const firstOpen =
|
|
11815
|
+
const firstOpen = useRef23(true);
|
|
11629
11816
|
function onOpenChange(isOpen) {
|
|
11630
11817
|
if (firstOpen.current && isOpen) {
|
|
11631
11818
|
maybeInitLoad();
|
|
@@ -11638,12 +11825,12 @@ function ComboBoxBase(props) {
|
|
|
11638
11825
|
}));
|
|
11639
11826
|
}
|
|
11640
11827
|
}
|
|
11641
|
-
const comboBoxRef =
|
|
11642
|
-
const triggerRef =
|
|
11643
|
-
const inputRef =
|
|
11644
|
-
const inputWrapRef =
|
|
11645
|
-
const listBoxRef =
|
|
11646
|
-
const popoverRef =
|
|
11828
|
+
const comboBoxRef = useRef23(null);
|
|
11829
|
+
const triggerRef = useRef23(null);
|
|
11830
|
+
const inputRef = useRef23(null);
|
|
11831
|
+
const inputWrapRef = useRef23(null);
|
|
11832
|
+
const listBoxRef = useRef23(null);
|
|
11833
|
+
const popoverRef = useRef23(null);
|
|
11647
11834
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
11648
11835
|
const comboBoxChildren = useCallback9((item) => /* @__PURE__ */ jsx56(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))), [getOptionValue, getOptionLabel, getOptionMenuLabel]);
|
|
11649
11836
|
const selectedKeys = useMemo16(() => {
|
|
@@ -11877,10 +12064,10 @@ function Autocomplete(props) {
|
|
|
11877
12064
|
...others
|
|
11878
12065
|
};
|
|
11879
12066
|
const state = useComboBoxState3(comboBoxProps);
|
|
11880
|
-
const inputWrapRef =
|
|
11881
|
-
const inputRef =
|
|
11882
|
-
const listBoxRef =
|
|
11883
|
-
const popoverRef =
|
|
12067
|
+
const inputWrapRef = useRef24(null);
|
|
12068
|
+
const inputRef = useRef24(null);
|
|
12069
|
+
const listBoxRef = useRef24(null);
|
|
12070
|
+
const popoverRef = useRef24(null);
|
|
11884
12071
|
const { inputProps, listBoxProps, labelProps } = useComboBox3(
|
|
11885
12072
|
{
|
|
11886
12073
|
...comboBoxProps,
|
|
@@ -11947,7 +12134,7 @@ function Autocomplete(props) {
|
|
|
11947
12134
|
}
|
|
11948
12135
|
|
|
11949
12136
|
// src/inputs/Checkbox.tsx
|
|
11950
|
-
import { useRef as
|
|
12137
|
+
import { useRef as useRef25 } from "react";
|
|
11951
12138
|
import { useCheckbox } from "react-aria";
|
|
11952
12139
|
import { useToggleState } from "react-stately";
|
|
11953
12140
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -11957,7 +12144,7 @@ function Checkbox(props) {
|
|
|
11957
12144
|
const isIndeterminate = selected === "indeterminate";
|
|
11958
12145
|
const ariaProps = { isSelected, isDisabled: !!disabled, isIndeterminate, ...otherProps };
|
|
11959
12146
|
const checkboxProps = { ...ariaProps, "aria-label": label };
|
|
11960
|
-
const ref =
|
|
12147
|
+
const ref = useRef25(null);
|
|
11961
12148
|
const toggleState = useToggleState(ariaProps);
|
|
11962
12149
|
const { inputProps } = useCheckbox(checkboxProps, toggleState, ref);
|
|
11963
12150
|
return /* @__PURE__ */ jsx58(
|
|
@@ -11976,7 +12163,7 @@ function Checkbox(props) {
|
|
|
11976
12163
|
}
|
|
11977
12164
|
|
|
11978
12165
|
// src/inputs/CheckboxGroup.tsx
|
|
11979
|
-
import { useRef as
|
|
12166
|
+
import { useRef as useRef26 } from "react";
|
|
11980
12167
|
import { useCheckboxGroup, useCheckboxGroupItem } from "react-aria";
|
|
11981
12168
|
import { useCheckboxGroupState } from "react-stately";
|
|
11982
12169
|
import { trussProps as trussProps40 } from "@homebound/truss/runtime";
|
|
@@ -12051,7 +12238,7 @@ function CheckboxGroupItem(props) {
|
|
|
12051
12238
|
...ariaProps,
|
|
12052
12239
|
"aria-label": label
|
|
12053
12240
|
};
|
|
12054
|
-
const ref =
|
|
12241
|
+
const ref = useRef26(null);
|
|
12055
12242
|
const {
|
|
12056
12243
|
inputProps
|
|
12057
12244
|
} = useCheckboxGroupItem(checkboxProps, groupState, ref);
|
|
@@ -12059,69 +12246,37 @@ function CheckboxGroupItem(props) {
|
|
|
12059
12246
|
}
|
|
12060
12247
|
|
|
12061
12248
|
// src/inputs/DateFields/DateField.mock.tsx
|
|
12062
|
-
import { format as format3, parse } from "date-fns";
|
|
12063
12249
|
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";
|
|
12095
12250
|
|
|
12096
12251
|
// src/inputs/DateFields/utils.ts
|
|
12097
|
-
import {
|
|
12252
|
+
import { Temporal as Temporal3 } from "temporal-polyfill";
|
|
12098
12253
|
var dateFormats = {
|
|
12099
|
-
short: "
|
|
12100
|
-
medium: "
|
|
12101
|
-
long: "
|
|
12254
|
+
short: "shortDate",
|
|
12255
|
+
medium: "shortWeekdayMonthDay",
|
|
12256
|
+
long: "longWeekdayMonthDayYear"
|
|
12102
12257
|
};
|
|
12103
|
-
function getDateFormat(
|
|
12104
|
-
return
|
|
12258
|
+
function getDateFormat(format) {
|
|
12259
|
+
return format ? dateFormats[format] : dateFormats.short;
|
|
12105
12260
|
}
|
|
12106
|
-
function formatDate(date,
|
|
12261
|
+
function formatDate(date, format) {
|
|
12107
12262
|
if (!date) return "";
|
|
12108
|
-
return
|
|
12263
|
+
return formatPlainDate(date, format);
|
|
12109
12264
|
}
|
|
12110
|
-
function formatDateRange(date,
|
|
12265
|
+
function formatDateRange(date, format) {
|
|
12111
12266
|
if (!date) return "";
|
|
12112
12267
|
const { from, to } = date;
|
|
12113
|
-
const fromFormatted = from ?
|
|
12114
|
-
const toFormatted = to ?
|
|
12268
|
+
const fromFormatted = from ? formatPlainDate(from, format) : "";
|
|
12269
|
+
const toFormatted = to ? formatPlainDate(to, format) : "";
|
|
12115
12270
|
return !fromFormatted && !toFormatted ? void 0 : `${fromFormatted} - ${toFormatted}`;
|
|
12116
12271
|
}
|
|
12117
|
-
function parseDate(str,
|
|
12118
|
-
return parseDateString(str,
|
|
12272
|
+
function parseDate(str, format) {
|
|
12273
|
+
return parseDateString(str, format);
|
|
12119
12274
|
}
|
|
12120
|
-
function parseDateRange(str,
|
|
12275
|
+
function parseDateRange(str, format) {
|
|
12121
12276
|
const [from = "", to = ""] = str.split("-");
|
|
12122
|
-
const fromDate = parseDateString(from.trim(),
|
|
12123
|
-
const toDate = parseDateString(to.trim(),
|
|
12124
|
-
if (toDate && fromDate && toDate <
|
|
12277
|
+
const fromDate = parseDateString(from.trim(), format);
|
|
12278
|
+
const toDate = parseDateString(to.trim(), format);
|
|
12279
|
+
if (toDate && fromDate && Temporal3.PlainDate.compare(toDate, fromDate) < 0) {
|
|
12125
12280
|
return { from: toDate, to: fromDate };
|
|
12126
12281
|
}
|
|
12127
12282
|
if (toDate === void 0 && fromDate === void 0) {
|
|
@@ -12129,31 +12284,81 @@ function parseDateRange(str, format4) {
|
|
|
12129
12284
|
}
|
|
12130
12285
|
return { from: fromDate, to: toDate };
|
|
12131
12286
|
}
|
|
12132
|
-
function parseDateString(str,
|
|
12287
|
+
function parseDateString(str, format) {
|
|
12288
|
+
if (format !== dateFormats.short && format !== "date") {
|
|
12289
|
+
return void 0;
|
|
12290
|
+
}
|
|
12133
12291
|
const split = str.split("/");
|
|
12134
12292
|
if (split.length !== 3) {
|
|
12135
12293
|
return void 0;
|
|
12136
12294
|
}
|
|
12137
|
-
|
|
12295
|
+
const yearLength = format === dateFormats.short ? 2 : 4;
|
|
12296
|
+
if (split[2].length !== yearLength) {
|
|
12138
12297
|
return void 0;
|
|
12139
12298
|
}
|
|
12140
|
-
const month = parseInt(split[0], 10)
|
|
12299
|
+
const month = parseInt(split[0], 10);
|
|
12141
12300
|
const day = parseInt(split[1], 10);
|
|
12142
12301
|
const year = parseInt(split[2], 10);
|
|
12143
|
-
if (isNaN(year) ||
|
|
12302
|
+
if (Number.isNaN(year) || Number.isNaN(month) || Number.isNaN(day) || day <= 0 || day > 31 || month <= 0 || month > 12) {
|
|
12144
12303
|
return void 0;
|
|
12145
12304
|
}
|
|
12146
|
-
|
|
12147
|
-
|
|
12305
|
+
try {
|
|
12306
|
+
return Temporal3.PlainDate.from({
|
|
12307
|
+
year: yearLength === 2 ? normalizeTwoDigitYear(year, todayPlainDate().year) : year,
|
|
12308
|
+
month,
|
|
12309
|
+
day
|
|
12310
|
+
});
|
|
12311
|
+
} catch {
|
|
12148
12312
|
return void 0;
|
|
12149
12313
|
}
|
|
12150
|
-
return parsed;
|
|
12151
12314
|
}
|
|
12152
12315
|
function isValidDate(d) {
|
|
12153
|
-
return d !== void 0 &&
|
|
12316
|
+
return d !== void 0 && isPlainDate(d);
|
|
12317
|
+
}
|
|
12318
|
+
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
12319
|
+
const isCommonEra = currentYear > 0;
|
|
12320
|
+
const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
12321
|
+
if (absCurrentYear <= 50) {
|
|
12322
|
+
return isCommonEra ? twoDigitYear || 100 : 1 - (twoDigitYear || 100);
|
|
12323
|
+
}
|
|
12324
|
+
const rangeEnd = absCurrentYear + 50;
|
|
12325
|
+
const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
12326
|
+
const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
12327
|
+
const normalizedYear = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
12328
|
+
return isCommonEra ? normalizedYear : 1 - normalizedYear;
|
|
12329
|
+
}
|
|
12330
|
+
|
|
12331
|
+
// src/inputs/DateFields/DateField.mock.tsx
|
|
12332
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
12333
|
+
function DateFieldMock(props) {
|
|
12334
|
+
const { onChange = () => {
|
|
12335
|
+
}, errorMsg, onBlur, onFocus } = props;
|
|
12336
|
+
const [value, setValue] = useState20(formatDate(props.value, dateFormats.short));
|
|
12337
|
+
const tid = useTestIds(props, "date");
|
|
12338
|
+
return /* @__PURE__ */ jsx60(
|
|
12339
|
+
"input",
|
|
12340
|
+
{
|
|
12341
|
+
...tid,
|
|
12342
|
+
"data-error": !!errorMsg,
|
|
12343
|
+
value,
|
|
12344
|
+
onChange: (e) => {
|
|
12345
|
+
const { value: value2 } = e.target;
|
|
12346
|
+
setValue(value2);
|
|
12347
|
+
onChange(parseDate(value2, dateFormats.short));
|
|
12348
|
+
},
|
|
12349
|
+
onBlur: () => maybeCall(onBlur),
|
|
12350
|
+
onFocus: () => maybeCall(onFocus),
|
|
12351
|
+
disabled: !!props.disabled,
|
|
12352
|
+
readOnly: !!props.readOnly,
|
|
12353
|
+
"data-disabled-days": JSON.stringify(props.disabledDays)
|
|
12354
|
+
}
|
|
12355
|
+
);
|
|
12154
12356
|
}
|
|
12155
12357
|
|
|
12156
12358
|
// src/inputs/DateFields/DateFieldBase.tsx
|
|
12359
|
+
import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef27, useState as useState21 } from "react";
|
|
12360
|
+
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
12361
|
+
import { useOverlayTriggerState } from "react-stately";
|
|
12157
12362
|
import { trussProps as trussProps41 } from "@homebound/truss/runtime";
|
|
12158
12363
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12159
12364
|
function DateFieldBase(props) {
|
|
@@ -12169,7 +12374,7 @@ function DateFieldBase(props) {
|
|
|
12169
12374
|
errorMsg,
|
|
12170
12375
|
helperText,
|
|
12171
12376
|
readOnly,
|
|
12172
|
-
format
|
|
12377
|
+
format = "short",
|
|
12173
12378
|
iconLeft = false,
|
|
12174
12379
|
hideCalendarIcon = false,
|
|
12175
12380
|
disabledDays,
|
|
@@ -12181,12 +12386,12 @@ function DateFieldBase(props) {
|
|
|
12181
12386
|
...others
|
|
12182
12387
|
} = props;
|
|
12183
12388
|
const isRangeMode = mode === "range";
|
|
12184
|
-
const inputRef =
|
|
12185
|
-
const inputWrapRef =
|
|
12186
|
-
const buttonRef =
|
|
12187
|
-
const overlayRef =
|
|
12188
|
-
const isFocused =
|
|
12189
|
-
const dateFormat = getDateFormat(
|
|
12389
|
+
const inputRef = useRef27(null);
|
|
12390
|
+
const inputWrapRef = useRef27(null);
|
|
12391
|
+
const buttonRef = useRef27(null);
|
|
12392
|
+
const overlayRef = useRef27(null);
|
|
12393
|
+
const isFocused = useRef27(false);
|
|
12394
|
+
const dateFormat = getDateFormat(format);
|
|
12190
12395
|
const [wipValue, setWipValue] = useState21(value);
|
|
12191
12396
|
const [inputValue, setInputValue] = useState21((isRangeMode ? formatDateRange(props.value, dateFormat) : formatDate(props.value, dateFormat)) ?? "");
|
|
12192
12397
|
const tid = useTestIds(props, defaultTestId(label));
|
|
@@ -12275,16 +12480,20 @@ function DateFieldBase(props) {
|
|
|
12275
12480
|
(d) => {
|
|
12276
12481
|
setWipValue(d);
|
|
12277
12482
|
if (d && isParsedDateValid(d)) {
|
|
12278
|
-
if (isRangeMode &&
|
|
12483
|
+
if (isRangeMode && isDateRangeValue(d)) {
|
|
12279
12484
|
props.onChange(d);
|
|
12280
12485
|
return;
|
|
12281
12486
|
}
|
|
12282
|
-
if (!isRangeMode && !
|
|
12487
|
+
if (!isRangeMode && !isDateRangeValue(d)) {
|
|
12283
12488
|
props.onChange(d);
|
|
12284
12489
|
return;
|
|
12285
12490
|
}
|
|
12286
12491
|
} else {
|
|
12287
|
-
|
|
12492
|
+
if (isRangeMode) {
|
|
12493
|
+
props.onChange(void 0);
|
|
12494
|
+
} else {
|
|
12495
|
+
props.onChange(void 0);
|
|
12496
|
+
}
|
|
12288
12497
|
return;
|
|
12289
12498
|
}
|
|
12290
12499
|
},
|
|
@@ -12292,7 +12501,7 @@ function DateFieldBase(props) {
|
|
|
12292
12501
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12293
12502
|
[isRangeMode, props.onChange]
|
|
12294
12503
|
);
|
|
12295
|
-
const inputSize = !isRangeMode ?
|
|
12504
|
+
const inputSize = !isRangeMode ? format === "short" ? 8 : format === "medium" ? 10 : void 0 : void 0;
|
|
12296
12505
|
const clearButton = /* @__PURE__ */ jsx61(Fragment18, { children: inputValue !== "" && !state.isOpen && /* @__PURE__ */ jsx61(IconButton, { icon: "xCircle", color: "rgba(100, 100, 100, 1)" /* Gray700 */, onClick: () => {
|
|
12297
12506
|
setInputValue("");
|
|
12298
12507
|
onChange(void 0);
|
|
@@ -12354,7 +12563,10 @@ function DateFieldBase(props) {
|
|
|
12354
12563
|
] });
|
|
12355
12564
|
}
|
|
12356
12565
|
function isParsedDateValid(d) {
|
|
12357
|
-
return d !== void 0 && (!
|
|
12566
|
+
return d !== void 0 && (!isDateRangeValue(d) || isValidDate(d.from) && isValidDate(d.to));
|
|
12567
|
+
}
|
|
12568
|
+
function isDateRangeValue(value) {
|
|
12569
|
+
return typeof value === "object" && value !== null && ("from" in value || "to" in value);
|
|
12358
12570
|
}
|
|
12359
12571
|
|
|
12360
12572
|
// src/utils/withTestMock.tsx
|
|
@@ -12541,7 +12753,7 @@ function MultiSelectField(props) {
|
|
|
12541
12753
|
|
|
12542
12754
|
// src/inputs/NumberField.tsx
|
|
12543
12755
|
import { NumberParser } from "@internationalized/number";
|
|
12544
|
-
import { useMemo as useMemo18, useRef as
|
|
12756
|
+
import { useMemo as useMemo18, useRef as useRef28, useState as useState23 } from "react";
|
|
12545
12757
|
import { mergeProps as mergeProps15, useLocale, useNumberField } from "react-aria";
|
|
12546
12758
|
import { useNumberFieldState } from "react-stately";
|
|
12547
12759
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
@@ -12628,11 +12840,11 @@ function NumberField(props) {
|
|
|
12628
12840
|
};
|
|
12629
12841
|
}, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
|
|
12630
12842
|
const numberParser = useMemo18(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
|
|
12631
|
-
const valueRef =
|
|
12843
|
+
const valueRef = useRef28({
|
|
12632
12844
|
wip: false
|
|
12633
12845
|
});
|
|
12634
|
-
const lastSentRef =
|
|
12635
|
-
const focusValueRef =
|
|
12846
|
+
const lastSentRef = useRef28(void 0);
|
|
12847
|
+
const focusValueRef = useRef28(void 0);
|
|
12636
12848
|
const [, forceRender] = useState23(0);
|
|
12637
12849
|
const propValue = value === void 0 ? Number.NaN : value / factor;
|
|
12638
12850
|
if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
|
|
@@ -12680,7 +12892,7 @@ function NumberField(props) {
|
|
|
12680
12892
|
...otherProps
|
|
12681
12893
|
};
|
|
12682
12894
|
const state = useNumberFieldState(useProps);
|
|
12683
|
-
const inputRef =
|
|
12895
|
+
const inputRef = useRef28(null);
|
|
12684
12896
|
const {
|
|
12685
12897
|
labelProps,
|
|
12686
12898
|
inputProps,
|
|
@@ -12732,7 +12944,7 @@ function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiv
|
|
|
12732
12944
|
}
|
|
12733
12945
|
|
|
12734
12946
|
// src/inputs/RadioGroupField.tsx
|
|
12735
|
-
import { Fragment as Fragment19, useMemo as useMemo19, useRef as
|
|
12947
|
+
import { Fragment as Fragment19, useMemo as useMemo19, useRef as useRef29 } from "react";
|
|
12736
12948
|
import { useFocusRing as useFocusRing6, useHover as useHover12, useRadio, useRadioGroup } from "react-aria";
|
|
12737
12949
|
import { useRadioGroupState } from "react-stately";
|
|
12738
12950
|
import { trussProps as trussProps44 } from "@homebound/truss/runtime";
|
|
@@ -12808,7 +13020,7 @@ function Radio(props) {
|
|
|
12808
13020
|
} = props;
|
|
12809
13021
|
const labelId = `${parentId}-${value}-label`;
|
|
12810
13022
|
const descriptionId = `${parentId}-${value}-description`;
|
|
12811
|
-
const ref =
|
|
13023
|
+
const ref = useRef29(null);
|
|
12812
13024
|
const {
|
|
12813
13025
|
inputProps,
|
|
12814
13026
|
isDisabled
|
|
@@ -12978,7 +13190,7 @@ var radioDisabled = {
|
|
|
12978
13190
|
|
|
12979
13191
|
// src/inputs/RichTextField.tsx
|
|
12980
13192
|
import DOMPurify from "dompurify";
|
|
12981
|
-
import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as
|
|
13193
|
+
import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as useRef30, useState as useState25 } from "react";
|
|
12982
13194
|
|
|
12983
13195
|
// src/inputs/RichTextField.mock.tsx
|
|
12984
13196
|
import { camelCase as camelCase3 } from "change-case";
|
|
@@ -13034,13 +13246,13 @@ function RichTextFieldImpl(props) {
|
|
|
13034
13246
|
fullWidth = fieldProps?.fullWidth ?? false
|
|
13035
13247
|
} = props;
|
|
13036
13248
|
const [editor, setEditor] = useState25();
|
|
13037
|
-
const editorElement =
|
|
13038
|
-
const currentHtml =
|
|
13039
|
-
const onChangeRef =
|
|
13249
|
+
const editorElement = useRef30();
|
|
13250
|
+
const currentHtml = useRef30(void 0);
|
|
13251
|
+
const onChangeRef = useRef30(onChange);
|
|
13040
13252
|
onChangeRef.current = onChange;
|
|
13041
|
-
const onBlurRef =
|
|
13253
|
+
const onBlurRef = useRef30(onBlur);
|
|
13042
13254
|
onBlurRef.current = onBlur;
|
|
13043
|
-
const onFocusRef =
|
|
13255
|
+
const onFocusRef = useRef30(onFocus);
|
|
13044
13256
|
onFocusRef.current = onFocus;
|
|
13045
13257
|
const id = useMemo20(() => {
|
|
13046
13258
|
if (readOnly) return;
|
|
@@ -13191,7 +13403,7 @@ function SelectField(props) {
|
|
|
13191
13403
|
}
|
|
13192
13404
|
|
|
13193
13405
|
// src/inputs/Switch.tsx
|
|
13194
|
-
import { useRef as
|
|
13406
|
+
import { useRef as useRef31 } from "react";
|
|
13195
13407
|
import { useFocusRing as useFocusRing7, useHover as useHover13, useSwitch, VisuallyHidden as VisuallyHidden5 } from "react-aria";
|
|
13196
13408
|
import { trussProps as trussProps46 } from "@homebound/truss/runtime";
|
|
13197
13409
|
import { jsx as jsx73, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -13224,7 +13436,7 @@ function Switch(props) {
|
|
|
13224
13436
|
...otherProps
|
|
13225
13437
|
};
|
|
13226
13438
|
const state = toToggleState(isSelected, onChange);
|
|
13227
|
-
const ref =
|
|
13439
|
+
const ref = useRef31(null);
|
|
13228
13440
|
const {
|
|
13229
13441
|
inputProps
|
|
13230
13442
|
} = useSwitch({
|
|
@@ -13376,7 +13588,7 @@ function switchCircleSelectedStyles(isCompact) {
|
|
|
13376
13588
|
}
|
|
13377
13589
|
|
|
13378
13590
|
// src/inputs/TextAreaField.tsx
|
|
13379
|
-
import { useRef as
|
|
13591
|
+
import { useRef as useRef32 } from "react";
|
|
13380
13592
|
import { mergeProps as mergeProps16, useTextField as useTextField3 } from "react-aria";
|
|
13381
13593
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
13382
13594
|
function TextAreaField(props) {
|
|
@@ -13394,8 +13606,8 @@ function TextAreaField(props) {
|
|
|
13394
13606
|
const isDisabled = !!disabled;
|
|
13395
13607
|
const isReadOnly = !!readOnly;
|
|
13396
13608
|
const textFieldProps = { ...otherProps, value, isDisabled, isReadOnly };
|
|
13397
|
-
const inputRef =
|
|
13398
|
-
const inputWrapRef =
|
|
13609
|
+
const inputRef = useRef32(null);
|
|
13610
|
+
const inputWrapRef = useRef32(null);
|
|
13399
13611
|
useGrowingTextField({ inputRef, inputWrapRef, value, maxLines });
|
|
13400
13612
|
const { labelProps, inputProps } = useTextField3(
|
|
13401
13613
|
{
|
|
@@ -13433,7 +13645,7 @@ function TextAreaField(props) {
|
|
|
13433
13645
|
}
|
|
13434
13646
|
|
|
13435
13647
|
// src/inputs/TextField.tsx
|
|
13436
|
-
import { useRef as
|
|
13648
|
+
import { useRef as useRef33 } from "react";
|
|
13437
13649
|
import { mergeProps as mergeProps17, useTextField as useTextField4 } from "react-aria";
|
|
13438
13650
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
13439
13651
|
function TextField(props) {
|
|
@@ -13461,7 +13673,7 @@ function TextField(props) {
|
|
|
13461
13673
|
validationState: errorMsg ? "invalid" : "valid",
|
|
13462
13674
|
value
|
|
13463
13675
|
};
|
|
13464
|
-
const inputRef =
|
|
13676
|
+
const inputRef = useRef33(null);
|
|
13465
13677
|
const { labelProps, inputProps } = useTextField4(
|
|
13466
13678
|
{
|
|
13467
13679
|
...textFieldProps,
|
|
@@ -13497,7 +13709,7 @@ function TextField(props) {
|
|
|
13497
13709
|
}
|
|
13498
13710
|
|
|
13499
13711
|
// src/inputs/ToggleButton.tsx
|
|
13500
|
-
import { useRef as
|
|
13712
|
+
import { useRef as useRef34, useState as useState26 } from "react";
|
|
13501
13713
|
import { useFocusRing as useFocusRing8, useHover as useHover14, usePress, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden6 } from "react-aria";
|
|
13502
13714
|
import { useToggleState as useToggleState3 } from "react-stately";
|
|
13503
13715
|
import { trussProps as trussProps47 } from "@homebound/truss/runtime";
|
|
@@ -13531,8 +13743,8 @@ function ToggleButton(props) {
|
|
|
13531
13743
|
return result;
|
|
13532
13744
|
}
|
|
13533
13745
|
});
|
|
13534
|
-
const labelRef =
|
|
13535
|
-
const ref =
|
|
13746
|
+
const labelRef = useRef34(null);
|
|
13747
|
+
const ref = useRef34(null);
|
|
13536
13748
|
const tid = useTestIds(otherProps, label);
|
|
13537
13749
|
const {
|
|
13538
13750
|
isPressed: isPressedFromEvents,
|
|
@@ -13618,7 +13830,7 @@ var togglePressStyles = {
|
|
|
13618
13830
|
};
|
|
13619
13831
|
|
|
13620
13832
|
// src/inputs/ToggleChipGroup.tsx
|
|
13621
|
-
import { useRef as
|
|
13833
|
+
import { useRef as useRef35 } from "react";
|
|
13622
13834
|
import { useCheckboxGroup as useCheckboxGroup2, useCheckboxGroupItem as useCheckboxGroupItem2, useFocusRing as useFocusRing9, VisuallyHidden as VisuallyHidden7 } from "react-aria";
|
|
13623
13835
|
import { useCheckboxGroupState as useCheckboxGroupState2 } from "react-stately";
|
|
13624
13836
|
import { trussProps as trussProps48 } from "@homebound/truss/runtime";
|
|
@@ -13691,7 +13903,7 @@ function ToggleChip2(props) {
|
|
|
13691
13903
|
} = props;
|
|
13692
13904
|
const isDisabled = !!disabled;
|
|
13693
13905
|
const isReadOnly = !!readonly;
|
|
13694
|
-
const ref =
|
|
13906
|
+
const ref = useRef35(null);
|
|
13695
13907
|
const {
|
|
13696
13908
|
inputProps
|
|
13697
13909
|
} = useCheckboxGroupItem2({
|
|
@@ -14741,9 +14953,9 @@ function maybeApply(maybeFn) {
|
|
|
14741
14953
|
}
|
|
14742
14954
|
|
|
14743
14955
|
// src/components/Table/hooks/useColumnResizeHandlers.ts
|
|
14744
|
-
import { useCallback as useCallback12, useRef as
|
|
14956
|
+
import { useCallback as useCallback12, useRef as useRef36 } from "react";
|
|
14745
14957
|
function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
|
|
14746
|
-
const hasLockedColumnsRef =
|
|
14958
|
+
const hasLockedColumnsRef = useRef36(false);
|
|
14747
14959
|
const distributeAdjustment = useCallback12(
|
|
14748
14960
|
(rightColumns, totalRightWidth, adjustment) => {
|
|
14749
14961
|
const updates = {};
|
|
@@ -14872,7 +15084,7 @@ function useScrollStorage(tableId, enabled = true) {
|
|
|
14872
15084
|
|
|
14873
15085
|
// src/components/Table/hooks/useSetupColumnSizes.ts
|
|
14874
15086
|
import { useResizeObserver } from "@react-aria/utils";
|
|
14875
|
-
import { useCallback as useCallback14, useEffect as useEffect18, useRef as
|
|
15087
|
+
import { useCallback as useCallback14, useEffect as useEffect18, useRef as useRef37, useState as useState28 } from "react";
|
|
14876
15088
|
|
|
14877
15089
|
// src/components/Table/hooks/useColumnResizing.ts
|
|
14878
15090
|
import { useCallback as useCallback13, useEffect as useEffect17, useState as useState27 } from "react";
|
|
@@ -14931,9 +15143,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
14931
15143
|
const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
|
|
14932
15144
|
disableColumnResizing ? void 0 : visibleColumnsStorageKey
|
|
14933
15145
|
);
|
|
14934
|
-
const calculateImmediately =
|
|
15146
|
+
const calculateImmediately = useRef37(true);
|
|
14935
15147
|
const [tableWidth, setTableWidth] = useState28();
|
|
14936
|
-
const prevTableWidthRef =
|
|
15148
|
+
const prevTableWidthRef = useRef37(tableWidth);
|
|
14937
15149
|
const [columnSizes, setColumnSizes] = useState28(
|
|
14938
15150
|
calcColumnSizes(columns, tableWidth, style.minWidthPx, expandedColumnIds, resizedWidths)
|
|
14939
15151
|
);
|
|
@@ -15000,9 +15212,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
|
|
|
15000
15212
|
}
|
|
15001
15213
|
|
|
15002
15214
|
// src/hooks/useRenderCount.ts
|
|
15003
|
-
import { useCallback as useCallback15, useRef as
|
|
15215
|
+
import { useCallback as useCallback15, useRef as useRef38 } from "react";
|
|
15004
15216
|
function useRenderCount() {
|
|
15005
|
-
const ref =
|
|
15217
|
+
const ref = useRef38(/* @__PURE__ */ new Map());
|
|
15006
15218
|
const getCount = useCallback15((id) => {
|
|
15007
15219
|
const count = ref.current.get(id) || 1;
|
|
15008
15220
|
ref.current.set(id, count + 1);
|
|
@@ -15059,10 +15271,10 @@ function GridTable(props) {
|
|
|
15059
15271
|
disableColumnResizing = false
|
|
15060
15272
|
} = props;
|
|
15061
15273
|
const columnsWithIds = useMemo24(() => assignDefaultColumnIds(_columns), [_columns]);
|
|
15062
|
-
const virtuosoRef =
|
|
15063
|
-
const virtuosoRangeRef =
|
|
15064
|
-
const resizeRef =
|
|
15065
|
-
const tableContainerRef =
|
|
15274
|
+
const virtuosoRef = useRef39(null);
|
|
15275
|
+
const virtuosoRangeRef = useRef39(null);
|
|
15276
|
+
const resizeRef = useRef39(null);
|
|
15277
|
+
const tableContainerRef = useRef39(null);
|
|
15066
15278
|
const api = useMemo24(
|
|
15067
15279
|
() => {
|
|
15068
15280
|
const api2 = props.api ?? new GridTableApiImpl();
|
|
@@ -15077,7 +15289,7 @@ function GridTable(props) {
|
|
|
15077
15289
|
[props.api]
|
|
15078
15290
|
);
|
|
15079
15291
|
const [draggedRow, _setDraggedRow] = useState29(void 0);
|
|
15080
|
-
const draggedRowRef =
|
|
15292
|
+
const draggedRowRef = useRef39(draggedRow);
|
|
15081
15293
|
const setDraggedRow = (row) => {
|
|
15082
15294
|
draggedRowRef.current = row;
|
|
15083
15295
|
_setDraggedRow(row);
|
|
@@ -15923,17 +16135,17 @@ var variantStyles2 = {
|
|
|
15923
16135
|
};
|
|
15924
16136
|
|
|
15925
16137
|
// src/components/BeamContext.tsx
|
|
15926
|
-
import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as
|
|
16138
|
+
import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as useRef46 } from "react";
|
|
15927
16139
|
import { OverlayProvider } from "react-aria";
|
|
15928
16140
|
|
|
15929
16141
|
// src/components/Modal/Modal.tsx
|
|
15930
16142
|
import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
|
|
15931
|
-
import { useCallback as useCallback17, useEffect as useEffect23, useRef as
|
|
16143
|
+
import { useCallback as useCallback17, useEffect as useEffect23, useRef as useRef41, useState as useState32 } from "react";
|
|
15932
16144
|
import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
|
|
15933
16145
|
import { createPortal as createPortal3 } from "react-dom";
|
|
15934
16146
|
|
|
15935
16147
|
// src/components/Modal/useModal.tsx
|
|
15936
|
-
import { useEffect as useEffect22, useMemo as useMemo27, useRef as
|
|
16148
|
+
import { useEffect as useEffect22, useMemo as useMemo27, useRef as useRef40 } from "react";
|
|
15937
16149
|
|
|
15938
16150
|
// src/components/Modal/ModalContext.tsx
|
|
15939
16151
|
import { createContext as createContext4, useContext as useContext13, useMemo as useMemo26 } from "react";
|
|
@@ -15951,8 +16163,8 @@ function useModalContext() {
|
|
|
15951
16163
|
function useModal() {
|
|
15952
16164
|
const { modalState, modalCanCloseChecks } = useBeamContext();
|
|
15953
16165
|
const { inModal } = useModalContext();
|
|
15954
|
-
const lastCanClose =
|
|
15955
|
-
const api =
|
|
16166
|
+
const lastCanClose = useRef40();
|
|
16167
|
+
const api = useRef40();
|
|
15956
16168
|
useEffect22(() => {
|
|
15957
16169
|
return () => {
|
|
15958
16170
|
modalCanCloseChecks.current = modalCanCloseChecks.current.filter((c) => c !== lastCanClose.current);
|
|
@@ -16005,7 +16217,7 @@ function Modal(props) {
|
|
|
16005
16217
|
allowClosing = true
|
|
16006
16218
|
} = props;
|
|
16007
16219
|
const isFixedHeight = typeof size !== "string";
|
|
16008
|
-
const ref =
|
|
16220
|
+
const ref = useRef41(null);
|
|
16009
16221
|
const {
|
|
16010
16222
|
modalBodyDiv,
|
|
16011
16223
|
modalFooterDiv,
|
|
@@ -16036,9 +16248,9 @@ function Modal(props) {
|
|
|
16036
16248
|
role: "dialog"
|
|
16037
16249
|
}, ref);
|
|
16038
16250
|
const [[width2, height], setSize] = useState32(getSize(size));
|
|
16039
|
-
const modalBodyRef =
|
|
16040
|
-
const modalFooterRef =
|
|
16041
|
-
const modalHeaderRef =
|
|
16251
|
+
const modalBodyRef = useRef41(null);
|
|
16252
|
+
const modalFooterRef = useRef41(null);
|
|
16253
|
+
const modalHeaderRef = useRef41(null);
|
|
16042
16254
|
const testId = useTestIds({}, testIdPrefix);
|
|
16043
16255
|
usePreventScroll();
|
|
16044
16256
|
const {
|
|
@@ -16334,7 +16546,7 @@ function useSnackbarContext() {
|
|
|
16334
16546
|
|
|
16335
16547
|
// src/components/SuperDrawer/SuperDrawer.tsx
|
|
16336
16548
|
import { AnimatePresence, motion } from "framer-motion";
|
|
16337
|
-
import { useEffect as useEffect24, useRef as
|
|
16549
|
+
import { useEffect as useEffect24, useRef as useRef42 } from "react";
|
|
16338
16550
|
import { createPortal as createPortal4 } from "react-dom";
|
|
16339
16551
|
|
|
16340
16552
|
// src/components/SuperDrawer/utils.ts
|
|
@@ -16356,7 +16568,7 @@ function SuperDrawer() {
|
|
|
16356
16568
|
const {
|
|
16357
16569
|
closeDrawer
|
|
16358
16570
|
} = useSuperDrawer();
|
|
16359
|
-
const headerRef =
|
|
16571
|
+
const headerRef = useRef42(null);
|
|
16360
16572
|
const testId = useTestIds({}, "superDrawer");
|
|
16361
16573
|
const currentContent = contentStack.current[contentStack.current.length - 1]?.opts;
|
|
16362
16574
|
const {
|
|
@@ -16451,7 +16663,7 @@ function SuperDrawer() {
|
|
|
16451
16663
|
}
|
|
16452
16664
|
|
|
16453
16665
|
// src/components/Layout/FormPageLayout.tsx
|
|
16454
|
-
import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as
|
|
16666
|
+
import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as useRef43, useState as useState39 } from "react";
|
|
16455
16667
|
import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
|
|
16456
16668
|
|
|
16457
16669
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -18119,7 +18331,7 @@ function SectionNavLink(props) {
|
|
|
18119
18331
|
});
|
|
18120
18332
|
}, [sectionRef]);
|
|
18121
18333
|
const tids = useTestIds(props);
|
|
18122
|
-
const buttonRef =
|
|
18334
|
+
const buttonRef = useRef43(null);
|
|
18123
18335
|
const {
|
|
18124
18336
|
buttonProps,
|
|
18125
18337
|
isPressed
|
|
@@ -18269,7 +18481,7 @@ function invertSpacing(value) {
|
|
|
18269
18481
|
import React17, { useEffect as useEffect27, useMemo as useMemo38, useState as useState42 } from "react";
|
|
18270
18482
|
|
|
18271
18483
|
// src/components/ButtonMenu.tsx
|
|
18272
|
-
import { useRef as
|
|
18484
|
+
import { useRef as useRef44 } from "react";
|
|
18273
18485
|
import { useMenuTrigger as useMenuTrigger2 } from "react-aria";
|
|
18274
18486
|
import { useMenuTriggerState as useMenuTriggerState2 } from "react-stately";
|
|
18275
18487
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
@@ -18281,7 +18493,7 @@ function ButtonMenu(props) {
|
|
|
18281
18493
|
onChange = props.onChange;
|
|
18282
18494
|
}
|
|
18283
18495
|
const state = useMenuTriggerState2({ isOpen: defaultOpen });
|
|
18284
|
-
const buttonRef =
|
|
18496
|
+
const buttonRef = useRef44(null);
|
|
18285
18497
|
const { menuTriggerProps, menuProps } = useMenuTrigger2({ isDisabled: !!disabled }, state, buttonRef);
|
|
18286
18498
|
const tid = useTestIds(
|
|
18287
18499
|
props,
|
|
@@ -18388,8 +18600,16 @@ function dateFilter(props) {
|
|
|
18388
18600
|
}
|
|
18389
18601
|
var anyOption = {};
|
|
18390
18602
|
var DateFilter = class extends BaseFilter {
|
|
18603
|
+
hydrate(value) {
|
|
18604
|
+
if (!isDateFilterValue(value)) return void 0;
|
|
18605
|
+
const hydratedValue = parsePersistedPlainDate(value.value);
|
|
18606
|
+
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18607
|
+
}
|
|
18608
|
+
dehydrate(value) {
|
|
18609
|
+
return value ? { op: value.op, value: dehydratePlainDate(value.value) } : void 0;
|
|
18610
|
+
}
|
|
18391
18611
|
render(value, setValue, tid, inModal, vertical) {
|
|
18392
|
-
const { label, operations, getOperationValue, getOperationLabel } = this.props;
|
|
18612
|
+
const { label, operations, getOperationValue, getOperationLabel, defaultValue } = this.props;
|
|
18393
18613
|
return /* @__PURE__ */ jsxs65(Fragment28, { children: [
|
|
18394
18614
|
vertical && /* @__PURE__ */ jsx127(Label, { label }),
|
|
18395
18615
|
/* @__PURE__ */ jsxs65(CompoundField, { children: [
|
|
@@ -18406,8 +18626,8 @@ var DateFilter = class extends BaseFilter {
|
|
|
18406
18626
|
getOptionLabel: (o) => o === anyOption ? "Any" : getOperationLabel(o),
|
|
18407
18627
|
value: value?.op,
|
|
18408
18628
|
onSelect: (op) => (
|
|
18409
|
-
// default the selected date to today if it doesn't exist in the filter's value
|
|
18410
|
-
setValue(op ? { op, value: value?.value
|
|
18629
|
+
// default the selected date to the filter's default date or today if it doesn't exist in the filter's value
|
|
18630
|
+
setValue(op ? { op, value: value?.value ?? defaultValue?.value ?? todayPlainDate() } : void 0)
|
|
18411
18631
|
),
|
|
18412
18632
|
label: inModal ? `${label} date filter operation` : label,
|
|
18413
18633
|
labelStyle: !inModal && !vertical ? "inline" : inModal || vertical ? "hidden" : "above",
|
|
@@ -18419,9 +18639,13 @@ var DateFilter = class extends BaseFilter {
|
|
|
18419
18639
|
DateField,
|
|
18420
18640
|
{
|
|
18421
18641
|
labelStyle: "inline",
|
|
18422
|
-
value: value?.value
|
|
18642
|
+
value: value?.value ?? defaultValue?.value ?? todayPlainDate(),
|
|
18423
18643
|
label: "Date",
|
|
18424
|
-
onChange: (d) =>
|
|
18644
|
+
onChange: (d) => {
|
|
18645
|
+
if (d && value) {
|
|
18646
|
+
setValue({ ...value, value: d });
|
|
18647
|
+
}
|
|
18648
|
+
},
|
|
18425
18649
|
disabled: !value,
|
|
18426
18650
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18427
18651
|
}
|
|
@@ -18430,6 +18654,9 @@ var DateFilter = class extends BaseFilter {
|
|
|
18430
18654
|
] });
|
|
18431
18655
|
}
|
|
18432
18656
|
};
|
|
18657
|
+
function isDateFilterValue(value) {
|
|
18658
|
+
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18659
|
+
}
|
|
18433
18660
|
|
|
18434
18661
|
// src/components/Filters/DateRangeFilter.tsx
|
|
18435
18662
|
import { Fragment as Fragment29, jsx as jsx128, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
@@ -18437,6 +18664,17 @@ function dateRangeFilter(props) {
|
|
|
18437
18664
|
return (key) => new DateRangeFilter(key, props);
|
|
18438
18665
|
}
|
|
18439
18666
|
var DateRangeFilter = class extends BaseFilter {
|
|
18667
|
+
hydrate(value) {
|
|
18668
|
+
if (!isDateRangeFilterValue(value)) return void 0;
|
|
18669
|
+
const hydratedValue = hydrateDateRange(value.value);
|
|
18670
|
+
return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
|
|
18671
|
+
}
|
|
18672
|
+
dehydrate(value) {
|
|
18673
|
+
return value ? {
|
|
18674
|
+
op: value.op,
|
|
18675
|
+
value: value.value ? { from: dehydratePlainDate(value.value.from), to: dehydratePlainDate(value.value.to) } : void 0
|
|
18676
|
+
} : void 0;
|
|
18677
|
+
}
|
|
18440
18678
|
render(value, setValue, tid, inModal, vertical) {
|
|
18441
18679
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
18442
18680
|
return /* @__PURE__ */ jsxs66(Fragment29, { children: [
|
|
@@ -18448,8 +18686,17 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18448
18686
|
isRangeFilterField: true,
|
|
18449
18687
|
placeholder: placeholderText,
|
|
18450
18688
|
label: testFieldLabel ?? "Date",
|
|
18451
|
-
value: value?.value
|
|
18452
|
-
onChange: (d) =>
|
|
18689
|
+
value: value?.value,
|
|
18690
|
+
onChange: (d) => {
|
|
18691
|
+
if (!d) {
|
|
18692
|
+
setValue(void 0);
|
|
18693
|
+
return;
|
|
18694
|
+
}
|
|
18695
|
+
const op = value?.op ?? defaultValue?.op;
|
|
18696
|
+
if (op !== void 0) {
|
|
18697
|
+
setValue({ op, value: d });
|
|
18698
|
+
}
|
|
18699
|
+
},
|
|
18453
18700
|
disabledDays,
|
|
18454
18701
|
...tid[`${defaultTestId(this.label)}_dateField`]
|
|
18455
18702
|
}
|
|
@@ -18457,6 +18704,17 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
18457
18704
|
] });
|
|
18458
18705
|
}
|
|
18459
18706
|
};
|
|
18707
|
+
function isDateRangeFilterValue(value) {
|
|
18708
|
+
return typeof value === "object" && value !== null && "op" in value && "value" in value;
|
|
18709
|
+
}
|
|
18710
|
+
function hydrateDateRange(value) {
|
|
18711
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
18712
|
+
const { from, to } = value;
|
|
18713
|
+
const hydratedFrom = parsePersistedPlainDate(from);
|
|
18714
|
+
const hydratedTo = parsePersistedPlainDate(to);
|
|
18715
|
+
if (hydratedFrom === void 0 && hydratedTo === void 0) return void 0;
|
|
18716
|
+
return { from: hydratedFrom, to: hydratedTo };
|
|
18717
|
+
}
|
|
18460
18718
|
|
|
18461
18719
|
// src/components/Filters/MultiFilter.tsx
|
|
18462
18720
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -19018,7 +19276,7 @@ function toPageNumberSize(page) {
|
|
|
19018
19276
|
}
|
|
19019
19277
|
|
|
19020
19278
|
// src/components/Table/components/EditColumnsButton.tsx
|
|
19021
|
-
import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as
|
|
19279
|
+
import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as useRef45 } from "react";
|
|
19022
19280
|
import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
|
|
19023
19281
|
import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
|
|
19024
19282
|
import { jsx as jsx141, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -19033,7 +19291,7 @@ function EditColumnsButton(props) {
|
|
|
19033
19291
|
const state = useMenuTriggerState3({
|
|
19034
19292
|
isOpen: defaultOpen
|
|
19035
19293
|
});
|
|
19036
|
-
const buttonRef =
|
|
19294
|
+
const buttonRef = useRef45(null);
|
|
19037
19295
|
const {
|
|
19038
19296
|
menuTriggerProps
|
|
19039
19297
|
} = useMenuTrigger3({
|
|
@@ -19262,10 +19520,10 @@ function useGridTableLayoutState({
|
|
|
19262
19520
|
});
|
|
19263
19521
|
useEffect27(() => {
|
|
19264
19522
|
if (page.limit !== persistedPageSize) setPersistedPageSize(page.limit);
|
|
19265
|
-
setPage((prev) =>
|
|
19523
|
+
setPage((prev) => prev.offset === 0 ? prev : {
|
|
19266
19524
|
...prev,
|
|
19267
19525
|
offset: 0
|
|
19268
|
-
})
|
|
19526
|
+
});
|
|
19269
19527
|
}, [page.limit, persistedPageSize, setPersistedPageSize, filter, searchString]);
|
|
19270
19528
|
return {
|
|
19271
19529
|
filter,
|
|
@@ -19526,18 +19784,18 @@ var BeamContext = createContext7({
|
|
|
19526
19784
|
});
|
|
19527
19785
|
function BeamProvider({ children, ...presentationProps }) {
|
|
19528
19786
|
const [, tick] = useReducer((prev) => prev + 1, 0);
|
|
19529
|
-
const modalRef =
|
|
19787
|
+
const modalRef = useRef46();
|
|
19530
19788
|
const modalHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19531
19789
|
const modalBodyDiv = useMemo40(() => {
|
|
19532
19790
|
const el = document.createElement("div");
|
|
19533
19791
|
el.style.height = "100%";
|
|
19534
19792
|
return el;
|
|
19535
19793
|
}, []);
|
|
19536
|
-
const modalCanCloseChecksRef =
|
|
19794
|
+
const modalCanCloseChecksRef = useRef46([]);
|
|
19537
19795
|
const modalFooterDiv = useMemo40(() => document.createElement("div"), []);
|
|
19538
|
-
const drawerContentStackRef =
|
|
19539
|
-
const drawerCanCloseChecks =
|
|
19540
|
-
const drawerCanCloseDetailsChecks =
|
|
19796
|
+
const drawerContentStackRef = useRef46([]);
|
|
19797
|
+
const drawerCanCloseChecks = useRef46([]);
|
|
19798
|
+
const drawerCanCloseDetailsChecks = useRef46([]);
|
|
19541
19799
|
const sdHeaderDiv = useMemo40(() => document.createElement("div"), []);
|
|
19542
19800
|
const context = useMemo40(() => {
|
|
19543
19801
|
return {
|
|
@@ -19580,14 +19838,14 @@ function useBeamContext() {
|
|
|
19580
19838
|
}
|
|
19581
19839
|
|
|
19582
19840
|
// src/components/ButtonDatePicker.tsx
|
|
19583
|
-
import { useRef as
|
|
19841
|
+
import { useRef as useRef47 } from "react";
|
|
19584
19842
|
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
19585
19843
|
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
19586
19844
|
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
19587
19845
|
function ButtonDatePicker(props) {
|
|
19588
19846
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
19589
19847
|
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
19590
|
-
const buttonRef =
|
|
19848
|
+
const buttonRef = useRef47(null);
|
|
19591
19849
|
const {
|
|
19592
19850
|
menuTriggerProps,
|
|
19593
19851
|
menuProps: { autoFocus: _af, ...menuProps }
|
|
@@ -19610,7 +19868,7 @@ function ButtonDatePicker(props) {
|
|
|
19610
19868
|
}
|
|
19611
19869
|
|
|
19612
19870
|
// src/components/ButtonGroup.tsx
|
|
19613
|
-
import { useRef as
|
|
19871
|
+
import { useRef as useRef48 } from "react";
|
|
19614
19872
|
import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
|
|
19615
19873
|
import { trussProps as trussProps73 } from "@homebound/truss/runtime";
|
|
19616
19874
|
import { jsx as jsx151, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
@@ -19658,7 +19916,7 @@ function GroupButton(props) {
|
|
|
19658
19916
|
isDisabled: !!disabled,
|
|
19659
19917
|
...otherProps
|
|
19660
19918
|
};
|
|
19661
|
-
const ref =
|
|
19919
|
+
const ref = useRef48(null);
|
|
19662
19920
|
const {
|
|
19663
19921
|
buttonProps,
|
|
19664
19922
|
isPressed
|
|
@@ -19781,7 +20039,7 @@ import { useHover as useHover16 } from "react-aria";
|
|
|
19781
20039
|
|
|
19782
20040
|
// src/components/Tag.tsx
|
|
19783
20041
|
import { useResizeObserver as useResizeObserver4 } from "@react-aria/utils";
|
|
19784
|
-
import { useRef as
|
|
20042
|
+
import { useRef as useRef49, useState as useState44 } from "react";
|
|
19785
20043
|
import { trussProps as trussProps74 } from "@homebound/truss/runtime";
|
|
19786
20044
|
import { jsx as jsx152, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
19787
20045
|
function Tag(props) {
|
|
@@ -19795,7 +20053,7 @@ function Tag(props) {
|
|
|
19795
20053
|
const typeStyles2 = getStyles(type);
|
|
19796
20054
|
const tid = useTestIds(otherProps);
|
|
19797
20055
|
const [showTooltip, setShowTooltip] = useState44(false);
|
|
19798
|
-
const ref =
|
|
20056
|
+
const ref = useRef49(null);
|
|
19799
20057
|
useResizeObserver4({
|
|
19800
20058
|
ref,
|
|
19801
20059
|
onResize: () => {
|
|
@@ -20004,7 +20262,7 @@ function Copy(props) {
|
|
|
20004
20262
|
|
|
20005
20263
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
20006
20264
|
import equal2 from "fast-deep-equal";
|
|
20007
|
-
import { useCallback as useCallback24, useRef as
|
|
20265
|
+
import { useCallback as useCallback24, useRef as useRef50 } from "react";
|
|
20008
20266
|
|
|
20009
20267
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
20010
20268
|
import { createContext as createContext8, useContext as useContext18 } from "react";
|
|
@@ -20027,12 +20285,12 @@ function DnDGrid(props) {
|
|
|
20027
20285
|
onReorder,
|
|
20028
20286
|
activeItemStyles
|
|
20029
20287
|
} = props;
|
|
20030
|
-
const gridEl =
|
|
20031
|
-
const dragEl =
|
|
20032
|
-
const cloneEl =
|
|
20033
|
-
const initialOrder =
|
|
20034
|
-
const reorderViaKeyboard =
|
|
20035
|
-
const transformFrom =
|
|
20288
|
+
const gridEl = useRef50(null);
|
|
20289
|
+
const dragEl = useRef50();
|
|
20290
|
+
const cloneEl = useRef50();
|
|
20291
|
+
const initialOrder = useRef50();
|
|
20292
|
+
const reorderViaKeyboard = useRef50(false);
|
|
20293
|
+
const transformFrom = useRef50({
|
|
20036
20294
|
x: 0,
|
|
20037
20295
|
y: 0
|
|
20038
20296
|
});
|
|
@@ -20494,14 +20752,14 @@ function HbSpinnerProvider({
|
|
|
20494
20752
|
|
|
20495
20753
|
// src/components/MaxLines.tsx
|
|
20496
20754
|
import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
20497
|
-
import { useCallback as useCallback25, useEffect as useEffect30, useRef as
|
|
20755
|
+
import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef51, useState as useState45 } from "react";
|
|
20498
20756
|
import { trussProps as trussProps80 } from "@homebound/truss/runtime";
|
|
20499
20757
|
import { jsx as jsx160, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
20500
20758
|
function MaxLines({
|
|
20501
20759
|
maxLines,
|
|
20502
20760
|
children
|
|
20503
20761
|
}) {
|
|
20504
|
-
const elRef =
|
|
20762
|
+
const elRef = useRef51(null);
|
|
20505
20763
|
const [hasMore, setHasMore] = useState45(false);
|
|
20506
20764
|
const [expanded, setExpanded] = useState45(false);
|
|
20507
20765
|
useLayoutEffect2(() => {
|
|
@@ -20537,7 +20795,7 @@ function MaxLines({
|
|
|
20537
20795
|
|
|
20538
20796
|
// src/components/ScrollShadows.tsx
|
|
20539
20797
|
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
20540
|
-
import { useCallback as useCallback26, useMemo as useMemo47, useRef as
|
|
20798
|
+
import { useCallback as useCallback26, useMemo as useMemo47, useRef as useRef52, useState as useState46 } from "react";
|
|
20541
20799
|
import { trussProps as trussProps81 } from "@homebound/truss/runtime";
|
|
20542
20800
|
import { jsx as jsx161, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
20543
20801
|
function ScrollShadows(props) {
|
|
@@ -20557,7 +20815,7 @@ function ScrollShadows(props) {
|
|
|
20557
20815
|
}
|
|
20558
20816
|
const [showStartShadow, setShowStartShadow] = useState46(false);
|
|
20559
20817
|
const [showEndShadow, setShowEndShadow] = useState46(false);
|
|
20560
|
-
const scrollRef =
|
|
20818
|
+
const scrollRef = useRef52(null);
|
|
20561
20819
|
const [startShadowStyles, endShadowStyles] = useMemo47(() => {
|
|
20562
20820
|
const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
|
|
20563
20821
|
const commonStyles = {
|
|
@@ -20730,7 +20988,7 @@ function useSnackbar() {
|
|
|
20730
20988
|
var snackbarId = 1;
|
|
20731
20989
|
|
|
20732
20990
|
// src/components/Stepper.tsx
|
|
20733
|
-
import { useRef as
|
|
20991
|
+
import { useRef as useRef53 } from "react";
|
|
20734
20992
|
import { useButton as useButton11, useFocusRing as useFocusRing14, useHover as useHover18 } from "react-aria";
|
|
20735
20993
|
import { trussProps as trussProps82 } from "@homebound/truss/runtime";
|
|
20736
20994
|
import { jsx as jsx162, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
@@ -20808,7 +21066,7 @@ function StepButton(props) {
|
|
|
20808
21066
|
onPress: onClick,
|
|
20809
21067
|
isDisabled: disabled
|
|
20810
21068
|
};
|
|
20811
|
-
const ref =
|
|
21069
|
+
const ref = useRef53(null);
|
|
20812
21070
|
const {
|
|
20813
21071
|
buttonProps,
|
|
20814
21072
|
isPressed
|
|
@@ -21202,7 +21460,7 @@ function visit(rows, fn) {
|
|
|
21202
21460
|
|
|
21203
21461
|
// src/components/Tabs.tsx
|
|
21204
21462
|
import { camelCase as camelCase5 } from "change-case";
|
|
21205
|
-
import { useEffect as useEffect32, useMemo as useMemo49, useRef as
|
|
21463
|
+
import { useEffect as useEffect32, useMemo as useMemo49, useRef as useRef54, useState as useState47 } from "react";
|
|
21206
21464
|
import { mergeProps as mergeProps26, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
|
|
21207
21465
|
import { matchPath, Route } from "react-router";
|
|
21208
21466
|
import { Link as Link5, useLocation } from "react-router-dom";
|
|
@@ -21261,7 +21519,7 @@ function Tabs(props) {
|
|
|
21261
21519
|
} = useFocusRing15();
|
|
21262
21520
|
const tid = useTestIds(others, "tabs");
|
|
21263
21521
|
const [active, setActive] = useState47(selected);
|
|
21264
|
-
const ref =
|
|
21522
|
+
const ref = useRef54(null);
|
|
21265
21523
|
useEffect32(() => setActive(selected), [selected]);
|
|
21266
21524
|
function onKeyUp(e) {
|
|
21267
21525
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
@@ -21659,6 +21917,7 @@ export {
|
|
|
21659
21917
|
filterTestIdPrefix,
|
|
21660
21918
|
formatDate,
|
|
21661
21919
|
formatDateRange,
|
|
21920
|
+
formatPlainDate,
|
|
21662
21921
|
formatValue,
|
|
21663
21922
|
generateColumnId,
|
|
21664
21923
|
getAlignment,
|