@homebound/beam 2.415.5 → 2.416.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/{chunk-ZQBDHF22.js → chunk-XH44AYND.js} +2 -1
- package/dist/chunk-XH44AYND.js.map +1 -0
- package/dist/index.cjs +57 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +105 -78
- package/dist/index.js.map +1 -1
- package/dist/utils/rtlUtils.cjs.map +1 -1
- package/dist/utils/rtlUtils.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-ZQBDHF22.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
safeKeys,
|
|
16
16
|
toToggleState,
|
|
17
17
|
useTestIds
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XH44AYND.js";
|
|
19
19
|
|
|
20
20
|
// src/Css.ts
|
|
21
21
|
var CssBuilder = class _CssBuilder {
|
|
@@ -5127,7 +5127,7 @@ function CollapseToggle(props) {
|
|
|
5127
5127
|
import { useContext as useContext11 } from "react";
|
|
5128
5128
|
|
|
5129
5129
|
// src/inputs/Autocomplete.tsx
|
|
5130
|
-
import { useRef as useRef25 } from "react";
|
|
5130
|
+
import { useCallback as useCallback13, useRef as useRef25 } from "react";
|
|
5131
5131
|
import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition5 } from "react-aria";
|
|
5132
5132
|
import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stately";
|
|
5133
5133
|
|
|
@@ -8133,7 +8133,7 @@ var RowState = class {
|
|
|
8133
8133
|
}
|
|
8134
8134
|
}
|
|
8135
8135
|
/** Used by node when doing `console.log(rs)`. */
|
|
8136
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
8136
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
8137
8137
|
return `RowState@${this.row.id}`;
|
|
8138
8138
|
}
|
|
8139
8139
|
};
|
|
@@ -8709,7 +8709,7 @@ function Menu(props) {
|
|
|
8709
8709
|
const { items: items2, ...others } = tree;
|
|
8710
8710
|
const [itemsSection, persistentSection] = items2;
|
|
8711
8711
|
if (search) {
|
|
8712
|
-
const filteredChildren = itemsSection.children.filter((item) => contains(item.value.label, search));
|
|
8712
|
+
const filteredChildren = (itemsSection.children ?? []).filter((item) => contains(item.value.label, search));
|
|
8713
8713
|
const { items: items3, ...otherValues } = itemsSection.value;
|
|
8714
8714
|
const filteredValue = items3?.filter((item) => contains(item.label, search));
|
|
8715
8715
|
return {
|
|
@@ -9159,18 +9159,21 @@ function ListBoxChip({ label }) {
|
|
|
9159
9159
|
}
|
|
9160
9160
|
|
|
9161
9161
|
// src/inputs/Value.ts
|
|
9162
|
+
var VALUE_PREFIX = "__VALUE--";
|
|
9162
9163
|
function keyToValue(key) {
|
|
9163
9164
|
if (typeof key === "number") {
|
|
9164
9165
|
return key;
|
|
9165
9166
|
} else if (typeof key === "string") {
|
|
9166
|
-
if (key === "__VALUE:null") {
|
|
9167
|
+
if (key === `${VALUE_PREFIX}null` || key === "__VALUE:null") {
|
|
9167
9168
|
return null;
|
|
9168
|
-
} else if (key === "__VALUE:undefined") {
|
|
9169
|
+
} else if (key === `${VALUE_PREFIX}undefined` || key === "__VALUE:undefined") {
|
|
9169
9170
|
return void 0;
|
|
9170
|
-
} else if (key.startsWith("__VALUE:boolean:")) {
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9171
|
+
} else if (key.startsWith(`${VALUE_PREFIX}boolean--`) || key.startsWith("__VALUE:boolean:")) {
|
|
9172
|
+
const parts = key.includes("--boolean--") ? key.split("--") : key.split(":");
|
|
9173
|
+
return parts[parts.length - 1] === "true";
|
|
9174
|
+
} else if (key.startsWith(`${VALUE_PREFIX}number--`) || key.startsWith("__VALUE:number:")) {
|
|
9175
|
+
const parts = key.includes("--number--") ? key.split("--") : key.split(":");
|
|
9176
|
+
return Number(parts[parts.length - 1]);
|
|
9174
9177
|
} else {
|
|
9175
9178
|
return key;
|
|
9176
9179
|
}
|
|
@@ -9182,13 +9185,13 @@ function valueToKey(value) {
|
|
|
9182
9185
|
if (typeof value === "string") {
|
|
9183
9186
|
return value;
|
|
9184
9187
|
} else if (typeof value === "number") {
|
|
9185
|
-
return
|
|
9188
|
+
return `${VALUE_PREFIX}number--${value}`;
|
|
9186
9189
|
} else if (typeof value === "boolean") {
|
|
9187
|
-
return
|
|
9190
|
+
return `${VALUE_PREFIX}boolean--${value}`;
|
|
9188
9191
|
} else if (value === null) {
|
|
9189
|
-
return
|
|
9192
|
+
return `${VALUE_PREFIX}null`;
|
|
9190
9193
|
} else if (value === void 0) {
|
|
9191
|
-
return
|
|
9194
|
+
return `${VALUE_PREFIX}undefined`;
|
|
9192
9195
|
} else {
|
|
9193
9196
|
throw new Error(`Unsupported value ${value}`);
|
|
9194
9197
|
}
|
|
@@ -9759,7 +9762,8 @@ function VirtualizedOptions(props) {
|
|
|
9759
9762
|
allowCollapsing
|
|
9760
9763
|
} = props;
|
|
9761
9764
|
const virtuosoRef = useRef21(null);
|
|
9762
|
-
const
|
|
9765
|
+
const focusedKey = state.selectionManager.focusedKey;
|
|
9766
|
+
const focusedItem = focusedKey != null ? state.collection.getItem(focusedKey) : null;
|
|
9763
9767
|
const selectedItem = state.selectionManager.selectedKeys.size > 0 ? state.collection.getItem([...state.selectionManager.selectedKeys.values()][0]) : void 0;
|
|
9764
9768
|
useEffect12(
|
|
9765
9769
|
() => {
|
|
@@ -10203,23 +10207,22 @@ function TreeSelectFieldBase(props) {
|
|
|
10203
10207
|
}));
|
|
10204
10208
|
}
|
|
10205
10209
|
}
|
|
10210
|
+
const comboBoxChildren = useCallback11(
|
|
10211
|
+
([item]) => /* @__PURE__ */ jsx55(Item3, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
|
|
10212
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10213
|
+
);
|
|
10206
10214
|
const comboBoxProps = {
|
|
10207
10215
|
...otherProps,
|
|
10208
10216
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
10209
10217
|
placeholder: !values || values.length === 0 ? placeholder : "",
|
|
10210
10218
|
label: props.label,
|
|
10211
10219
|
inputValue: fieldState.inputValue,
|
|
10212
|
-
// where we might want to do flatmap and return diff kind of array (children ? add level prop) inside children callback - can put markup wrapper div adds padding
|
|
10213
|
-
// so we're not doing it multiple places
|
|
10214
10220
|
items: fieldState.filteredOptions,
|
|
10215
10221
|
isDisabled,
|
|
10216
10222
|
isReadOnly,
|
|
10217
10223
|
onInputChange,
|
|
10218
10224
|
onOpenChange,
|
|
10219
|
-
children:
|
|
10220
|
-
// what we're telling it to render. look at padding here - don't have to pass down to tree option - filtered options is where we're flat mapping
|
|
10221
|
-
/* @__PURE__ */ jsx55(Item3, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item)))
|
|
10222
|
-
)
|
|
10225
|
+
children: comboBoxChildren
|
|
10223
10226
|
};
|
|
10224
10227
|
const state = useComboBoxState({
|
|
10225
10228
|
...comboBoxProps,
|
|
@@ -10229,6 +10232,7 @@ function TreeSelectFieldBase(props) {
|
|
|
10229
10232
|
state.selectionManager.state = useMultipleSelectionState({
|
|
10230
10233
|
selectionMode: "multiple",
|
|
10231
10234
|
selectedKeys: fieldState.selectedKeys,
|
|
10235
|
+
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
10232
10236
|
onSelectionChange: (newKeys) => {
|
|
10233
10237
|
if (newKeys === "all") {
|
|
10234
10238
|
return;
|
|
@@ -10521,7 +10525,9 @@ function ComboBoxInput(props) {
|
|
|
10521
10525
|
onKeyDown: (e) => {
|
|
10522
10526
|
if (isMultiSelect) {
|
|
10523
10527
|
if (isTree) {
|
|
10524
|
-
const
|
|
10528
|
+
const focusedKey = state.selectionManager.focusedKey;
|
|
10529
|
+
if (focusedKey == null) return;
|
|
10530
|
+
const item = state.collection.getItem(focusedKey);
|
|
10525
10531
|
if (item && (e.key === "ArrowRight" || e.key === "ArrowLeft")) {
|
|
10526
10532
|
if (!isLeveledNode(item)) return;
|
|
10527
10533
|
const leveledOption = item.value;
|
|
@@ -10543,7 +10549,10 @@ function ComboBoxInput(props) {
|
|
|
10543
10549
|
if (state.isOpen) {
|
|
10544
10550
|
e.preventDefault();
|
|
10545
10551
|
}
|
|
10546
|
-
state.selectionManager.
|
|
10552
|
+
const focusedKey = state.selectionManager.focusedKey;
|
|
10553
|
+
if (focusedKey != null) {
|
|
10554
|
+
state.selectionManager.toggleSelection(focusedKey);
|
|
10555
|
+
}
|
|
10547
10556
|
return;
|
|
10548
10557
|
}
|
|
10549
10558
|
if (e.key === "Escape") {
|
|
@@ -10731,6 +10740,10 @@ function ComboBoxBase(props) {
|
|
|
10731
10740
|
const listBoxRef = useRef24(null);
|
|
10732
10741
|
const popoverRef = useRef24(null);
|
|
10733
10742
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
10743
|
+
const comboBoxChildren = useCallback12(
|
|
10744
|
+
(item) => /* @__PURE__ */ jsx57(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))),
|
|
10745
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10746
|
+
);
|
|
10734
10747
|
const comboBoxProps = {
|
|
10735
10748
|
...otherProps,
|
|
10736
10749
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
@@ -10740,7 +10753,7 @@ function ComboBoxBase(props) {
|
|
|
10740
10753
|
isReadOnly,
|
|
10741
10754
|
onInputChange,
|
|
10742
10755
|
onOpenChange,
|
|
10743
|
-
children:
|
|
10756
|
+
children: comboBoxChildren
|
|
10744
10757
|
};
|
|
10745
10758
|
const state = useComboBoxState2({
|
|
10746
10759
|
...comboBoxProps,
|
|
@@ -10765,7 +10778,8 @@ function ComboBoxBase(props) {
|
|
|
10765
10778
|
// Do not allow an empty selection if single select mode
|
|
10766
10779
|
disallowEmptySelection: !multiselect,
|
|
10767
10780
|
selectedKeys,
|
|
10768
|
-
onSelectionChange
|
|
10781
|
+
onSelectionChange,
|
|
10782
|
+
disabledKeys: Object.keys(disabledOptionsWithReasons)
|
|
10769
10783
|
});
|
|
10770
10784
|
const [debouncedSearch] = useDebounce(searchValue, 300);
|
|
10771
10785
|
useEffect15(() => {
|
|
@@ -10939,6 +10953,10 @@ function Autocomplete(props) {
|
|
|
10939
10953
|
...others
|
|
10940
10954
|
} = props;
|
|
10941
10955
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
10956
|
+
const comboBoxChildren = useCallback13(
|
|
10957
|
+
(item) => /* @__PURE__ */ jsx58(Item5, { textValue: getOptionLabel(item), children: getOptionMenuLabel ? getOptionMenuLabel(item) : getOptionLabel(item) }, getOptionValue(item)),
|
|
10958
|
+
[getOptionValue, getOptionLabel, getOptionMenuLabel]
|
|
10959
|
+
);
|
|
10942
10960
|
const comboBoxProps = {
|
|
10943
10961
|
isDisabled: !!disabled,
|
|
10944
10962
|
disabledKeys: Object.keys(disabledOptionsWithReasons),
|
|
@@ -10947,8 +10965,9 @@ function Autocomplete(props) {
|
|
|
10947
10965
|
items: options,
|
|
10948
10966
|
// Allow the user to type in a value that is not in the list. Allows for the text to stay in the input when the user clicks away
|
|
10949
10967
|
allowsCustomValue: true,
|
|
10950
|
-
children:
|
|
10968
|
+
children: comboBoxChildren,
|
|
10951
10969
|
onSelectionChange: (key) => {
|
|
10970
|
+
if (key == null) return;
|
|
10952
10971
|
const selectedItem = options.find((i) => getOptionValue(i) === key);
|
|
10953
10972
|
if (selectedItem) {
|
|
10954
10973
|
onInputChange(getOptionLabel(selectedItem));
|
|
@@ -11154,7 +11173,7 @@ function DateFieldMock(props) {
|
|
|
11154
11173
|
}
|
|
11155
11174
|
|
|
11156
11175
|
// src/inputs/DateFields/DateFieldBase.tsx
|
|
11157
|
-
import { useCallback as
|
|
11176
|
+
import { useCallback as useCallback14, useEffect as useEffect16, useRef as useRef28, useState as useState23 } from "react";
|
|
11158
11177
|
import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
|
|
11159
11178
|
import { isDateRange } from "react-day-picker";
|
|
11160
11179
|
import { useOverlayTriggerState } from "react-stately";
|
|
@@ -11334,7 +11353,7 @@ function DateFieldBase(props) {
|
|
|
11334
11353
|
);
|
|
11335
11354
|
}
|
|
11336
11355
|
}, [value, dateFormat]);
|
|
11337
|
-
const onChange =
|
|
11356
|
+
const onChange = useCallback14(
|
|
11338
11357
|
(d) => {
|
|
11339
11358
|
setWipValue(d);
|
|
11340
11359
|
if (d && isParsedDateValid(d)) {
|
|
@@ -11787,7 +11806,6 @@ function RadioGroupField(props) {
|
|
|
11787
11806
|
/* @__PURE__ */ jsx70(Label, { label, ...labelProps, ...tid.label, hidden: labelStyle === "hidden" }),
|
|
11788
11807
|
/* @__PURE__ */ jsxs41("div", { ...radioGroupProps, children: [
|
|
11789
11808
|
options.map((option) => {
|
|
11790
|
-
const isDisabled = state.isDisabled || !!option.disabled;
|
|
11791
11809
|
return /* @__PURE__ */ jsx70(Fragment18, { children: maybeTooltip({
|
|
11792
11810
|
title: resolveTooltip(option.disabled),
|
|
11793
11811
|
placement: "bottom",
|
|
@@ -11796,7 +11814,8 @@ function RadioGroupField(props) {
|
|
|
11796
11814
|
{
|
|
11797
11815
|
parentId: name,
|
|
11798
11816
|
option,
|
|
11799
|
-
state
|
|
11817
|
+
state,
|
|
11818
|
+
isOptionDisabled: !!option.disabled,
|
|
11800
11819
|
...otherProps,
|
|
11801
11820
|
...tid[option.value]
|
|
11802
11821
|
}
|
|
@@ -11814,13 +11833,18 @@ function Radio(props) {
|
|
|
11814
11833
|
parentId,
|
|
11815
11834
|
option: { description, label, value },
|
|
11816
11835
|
state,
|
|
11836
|
+
isOptionDisabled,
|
|
11817
11837
|
...others
|
|
11818
11838
|
} = props;
|
|
11819
|
-
const disabled = state.isDisabled;
|
|
11820
11839
|
const labelId = `${parentId}-${value}-label`;
|
|
11821
11840
|
const descriptionId = `${parentId}-${value}-description`;
|
|
11822
11841
|
const ref = useRef30(null);
|
|
11823
|
-
const { inputProps } = useRadio(
|
|
11842
|
+
const { inputProps, isDisabled } = useRadio(
|
|
11843
|
+
{ value, "aria-labelledby": labelId, isDisabled: isOptionDisabled },
|
|
11844
|
+
state,
|
|
11845
|
+
ref
|
|
11846
|
+
);
|
|
11847
|
+
const disabled = isDisabled;
|
|
11824
11848
|
const { focusProps, isFocusVisible } = useFocusRing6();
|
|
11825
11849
|
const { hoverProps, isHovered } = useHover12({ isDisabled: disabled });
|
|
11826
11850
|
return /* @__PURE__ */ jsxs41("label", { css: Css.df.cursorPointer.mb1.if(disabled).add("cursor", "initial").$, ...hoverProps, children: [
|
|
@@ -13428,10 +13452,10 @@ function maybeApply(maybeFn) {
|
|
|
13428
13452
|
}
|
|
13429
13453
|
|
|
13430
13454
|
// src/components/Table/hooks/useColumnResizeHandlers.ts
|
|
13431
|
-
import { useCallback as
|
|
13455
|
+
import { useCallback as useCallback15, useRef as useRef37 } from "react";
|
|
13432
13456
|
function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
|
|
13433
13457
|
const hasLockedColumnsRef = useRef37(false);
|
|
13434
|
-
const distributeAdjustment =
|
|
13458
|
+
const distributeAdjustment = useCallback15(
|
|
13435
13459
|
(rightColumns, totalRightWidth, adjustment) => {
|
|
13436
13460
|
const updates = {};
|
|
13437
13461
|
let remainingAdjustment = adjustment;
|
|
@@ -13446,7 +13470,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13446
13470
|
},
|
|
13447
13471
|
[]
|
|
13448
13472
|
);
|
|
13449
|
-
const calculateResizeUpdates =
|
|
13473
|
+
const calculateResizeUpdates = useCallback15(
|
|
13450
13474
|
(columnId, newWidth, columnIndex) => {
|
|
13451
13475
|
if (!tableWidth || !columnSizes || columnSizes.length === 0) {
|
|
13452
13476
|
return null;
|
|
@@ -13492,7 +13516,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13492
13516
|
},
|
|
13493
13517
|
[tableWidth, columnSizes, columns, distributeAdjustment]
|
|
13494
13518
|
);
|
|
13495
|
-
const calculatePreviewWidth =
|
|
13519
|
+
const calculatePreviewWidth = useCallback15(
|
|
13496
13520
|
(columnId, newWidth, columnIndex) => {
|
|
13497
13521
|
const result = calculateResizeUpdates(columnId, newWidth, columnIndex);
|
|
13498
13522
|
if (!result) {
|
|
@@ -13502,7 +13526,7 @@ function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWid
|
|
|
13502
13526
|
},
|
|
13503
13527
|
[calculateResizeUpdates]
|
|
13504
13528
|
);
|
|
13505
|
-
const handleColumnResize =
|
|
13529
|
+
const handleColumnResize = useCallback15(
|
|
13506
13530
|
(columnId, newWidth, columnIndex) => {
|
|
13507
13531
|
const result = calculateResizeUpdates(columnId, newWidth, columnIndex);
|
|
13508
13532
|
if (!result) {
|
|
@@ -13558,10 +13582,10 @@ function useScrollStorage(tableId, enabled = true) {
|
|
|
13558
13582
|
}
|
|
13559
13583
|
|
|
13560
13584
|
// src/hooks/useRenderCount.ts
|
|
13561
|
-
import { useCallback as
|
|
13585
|
+
import { useCallback as useCallback16, useRef as useRef38 } from "react";
|
|
13562
13586
|
function useRenderCount() {
|
|
13563
13587
|
const ref = useRef38(/* @__PURE__ */ new Map());
|
|
13564
|
-
const getCount =
|
|
13588
|
+
const getCount = useCallback16((id) => {
|
|
13565
13589
|
const count = ref.current.get(id) || 1;
|
|
13566
13590
|
ref.current.set(id, count + 1);
|
|
13567
13591
|
return { "data-render": count };
|
|
@@ -14078,7 +14102,7 @@ function ToggleChips(props) {
|
|
|
14078
14102
|
|
|
14079
14103
|
// src/components/Accordion.tsx
|
|
14080
14104
|
import { useId, useResizeObserver as useResizeObserver2 } from "@react-aria/utils";
|
|
14081
|
-
import { useCallback as
|
|
14105
|
+
import { useCallback as useCallback17, useEffect as useEffect19, useMemo as useMemo25, useRef as useRef40, useState as useState29 } from "react";
|
|
14082
14106
|
import { useFocusRing as useFocusRing10 } from "react-aria";
|
|
14083
14107
|
import { jsx as jsx84, jsxs as jsxs48 } from "@emotion/react/jsx-runtime";
|
|
14084
14108
|
function Accordion(props) {
|
|
@@ -14110,13 +14134,13 @@ function Accordion(props) {
|
|
|
14110
14134
|
useEffect19(() => {
|
|
14111
14135
|
setContentHeight(expanded && contentRef.current ? `${contentRef.current.scrollHeight}px` : "0");
|
|
14112
14136
|
}, [expanded]);
|
|
14113
|
-
const onResize =
|
|
14137
|
+
const onResize = useCallback17(() => {
|
|
14114
14138
|
if (contentRef.current && expanded) {
|
|
14115
14139
|
setContentHeight(`${contentRef.current.scrollHeight}px`);
|
|
14116
14140
|
}
|
|
14117
14141
|
}, [expanded, setContentHeight]);
|
|
14118
14142
|
useResizeObserver2({ ref: contentRef, onResize });
|
|
14119
|
-
const toggle =
|
|
14143
|
+
const toggle = useCallback17(() => {
|
|
14120
14144
|
setExpanded((prev) => !prev);
|
|
14121
14145
|
if (setExpandedIndex) setExpandedIndex(index);
|
|
14122
14146
|
if (onToggle) onToggle();
|
|
@@ -14308,7 +14332,7 @@ import { OverlayProvider } from "react-aria";
|
|
|
14308
14332
|
|
|
14309
14333
|
// src/components/Modal/Modal.tsx
|
|
14310
14334
|
import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
|
|
14311
|
-
import { useCallback as
|
|
14335
|
+
import { useCallback as useCallback18, useEffect as useEffect22, useRef as useRef42, useState as useState31 } from "react";
|
|
14312
14336
|
import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
|
|
14313
14337
|
import { createPortal as createPortal2 } from "react-dom";
|
|
14314
14338
|
|
|
@@ -14407,7 +14431,7 @@ function Modal(props) {
|
|
|
14407
14431
|
const [hasScroll, setHasScroll] = useState31(forceScrolling ?? false);
|
|
14408
14432
|
useResizeObserver3({
|
|
14409
14433
|
ref: modalBodyRef,
|
|
14410
|
-
onResize:
|
|
14434
|
+
onResize: useCallback18(
|
|
14411
14435
|
() => {
|
|
14412
14436
|
const target = modalBodyRef.current;
|
|
14413
14437
|
if (forceScrolling === void 0 && !isFixedHeight) {
|
|
@@ -14638,7 +14662,7 @@ function SuperDrawer() {
|
|
|
14638
14662
|
}
|
|
14639
14663
|
|
|
14640
14664
|
// src/components/Layout/FormPageLayout.tsx
|
|
14641
|
-
import React16, { createRef, useCallback as
|
|
14665
|
+
import React16, { createRef, useCallback as useCallback22, useEffect as useEffect24, useMemo as useMemo33, useRef as useRef44, useState as useState37 } from "react";
|
|
14642
14666
|
import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
|
|
14643
14667
|
|
|
14644
14668
|
// src/forms/BoundCheckboxField.tsx
|
|
@@ -14864,7 +14888,7 @@ function BoundDateRangeField(props) {
|
|
|
14864
14888
|
}
|
|
14865
14889
|
|
|
14866
14890
|
// src/forms/BoundForm.tsx
|
|
14867
|
-
import { useCallback as
|
|
14891
|
+
import { useCallback as useCallback20, useMemo as useMemo30 } from "react";
|
|
14868
14892
|
|
|
14869
14893
|
// src/forms/BoundIconCardField.tsx
|
|
14870
14894
|
import { Observer as Observer6 } from "mobx-react";
|
|
@@ -14893,7 +14917,7 @@ function BoundIconCardField(props) {
|
|
|
14893
14917
|
import { Observer as Observer7 } from "mobx-react";
|
|
14894
14918
|
|
|
14895
14919
|
// src/inputs/IconCardGroup.tsx
|
|
14896
|
-
import { useCallback as
|
|
14920
|
+
import { useCallback as useCallback19, useMemo as useMemo29, useState as useState33 } from "react";
|
|
14897
14921
|
import { mergeProps as mergeProps11, useField } from "react-aria";
|
|
14898
14922
|
import { jsx as jsx100, jsxs as jsxs55 } from "@emotion/react/jsx-runtime";
|
|
14899
14923
|
function IconCardGroup(props) {
|
|
@@ -14910,7 +14934,7 @@ function IconCardGroup(props) {
|
|
|
14910
14934
|
} = props;
|
|
14911
14935
|
const [selected, setSelected] = useState33(values);
|
|
14912
14936
|
const exclusiveOptions = useMemo29(() => options.filter((o) => o.exclusive), [options]);
|
|
14913
|
-
const toggleValue =
|
|
14937
|
+
const toggleValue = useCallback19(
|
|
14914
14938
|
(value) => {
|
|
14915
14939
|
if (isDisabled) return;
|
|
14916
14940
|
const option = options.find((o) => o.value === value);
|
|
@@ -15573,7 +15597,7 @@ var listFieldPrefix = "listField";
|
|
|
15573
15597
|
function BoundForm(props) {
|
|
15574
15598
|
const { rows, formState } = props;
|
|
15575
15599
|
const tid = useTestIds({}, "boundForm");
|
|
15576
|
-
const getRowKey =
|
|
15600
|
+
const getRowKey = useCallback20((row, rowType) => {
|
|
15577
15601
|
return `${rowType}-${Object.keys(row).join("-")}`;
|
|
15578
15602
|
}, []);
|
|
15579
15603
|
return /* @__PURE__ */ jsx115("div", { ...tid, children: /* @__PURE__ */ jsx115(FormLines, { width: "full", gap: 3.5, children: rows.map(
|
|
@@ -15915,7 +15939,7 @@ function IconButtonList({ content, selectedIcon, onIconClick }) {
|
|
|
15915
15939
|
}
|
|
15916
15940
|
|
|
15917
15941
|
// src/components/Toast/ToastContext.tsx
|
|
15918
|
-
import { createContext as createContext5, useCallback as
|
|
15942
|
+
import { createContext as createContext5, useCallback as useCallback21, useContext as useContext14, useMemo as useMemo31, useState as useState35 } from "react";
|
|
15919
15943
|
import { jsx as jsx122 } from "@emotion/react/jsx-runtime";
|
|
15920
15944
|
var ToastContext = createContext5({
|
|
15921
15945
|
setNotice: () => {
|
|
@@ -15927,7 +15951,7 @@ var ToastContext = createContext5({
|
|
|
15927
15951
|
});
|
|
15928
15952
|
function ToastProvider(props) {
|
|
15929
15953
|
const [notice, setNotice] = useState35();
|
|
15930
|
-
const clear =
|
|
15954
|
+
const clear = useCallback21(() => setNotice(void 0), [setNotice]);
|
|
15931
15955
|
const contextValue = useMemo31(() => ({ setNotice, notice, clear }), [notice, clear]);
|
|
15932
15956
|
return /* @__PURE__ */ jsx122(ToastContext.Provider, { value: contextValue, children: props.children });
|
|
15933
15957
|
}
|
|
@@ -16087,7 +16111,7 @@ function SectionNavLink(props) {
|
|
|
16087
16111
|
const { sectionWithRef, activeSection } = props;
|
|
16088
16112
|
const { section, ref: sectionRef } = sectionWithRef;
|
|
16089
16113
|
const active = activeSection === sectionWithRef.sectionKey;
|
|
16090
|
-
const handleNavClick =
|
|
16114
|
+
const handleNavClick = useCallback22(() => {
|
|
16091
16115
|
sectionRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
16092
16116
|
}, [sectionRef]);
|
|
16093
16117
|
const tids = useTestIds(props);
|
|
@@ -17299,7 +17323,7 @@ function PreventBrowserScroll({ children }) {
|
|
|
17299
17323
|
}
|
|
17300
17324
|
|
|
17301
17325
|
// src/components/Layout/RightPaneLayout/RightPaneContext.tsx
|
|
17302
|
-
import React18, { useCallback as
|
|
17326
|
+
import React18, { useCallback as useCallback23, useContext as useContext15, useMemo as useMemo38, useState as useState41 } from "react";
|
|
17303
17327
|
import { jsx as jsx148 } from "@emotion/react/jsx-runtime";
|
|
17304
17328
|
var RightPaneContext = React18.createContext({
|
|
17305
17329
|
openInPane: () => {
|
|
@@ -17314,15 +17338,15 @@ var RightPaneContext = React18.createContext({
|
|
|
17314
17338
|
function RightPaneProvider({ children }) {
|
|
17315
17339
|
const [rightPaneContent, setRightPaneContent] = useState41(void 0);
|
|
17316
17340
|
const [isRightPaneOpen, setIsRightPaneOpen] = useState41(false);
|
|
17317
|
-
const openInPane =
|
|
17341
|
+
const openInPane = useCallback23(
|
|
17318
17342
|
(opts) => {
|
|
17319
17343
|
setRightPaneContent(opts?.content);
|
|
17320
17344
|
setIsRightPaneOpen(true);
|
|
17321
17345
|
},
|
|
17322
17346
|
[setRightPaneContent]
|
|
17323
17347
|
);
|
|
17324
|
-
const closePane =
|
|
17325
|
-
const clearPane =
|
|
17348
|
+
const closePane = useCallback23(() => setIsRightPaneOpen(false), []);
|
|
17349
|
+
const clearPane = useCallback23(() => setRightPaneContent(void 0), [setRightPaneContent]);
|
|
17326
17350
|
const context = useMemo38(
|
|
17327
17351
|
() => ({ openInPane, closePane, clearPane, rightPaneContent, isRightPaneOpen }),
|
|
17328
17352
|
[openInPane, closePane, rightPaneContent, clearPane, isRightPaneOpen]
|
|
@@ -17466,7 +17490,10 @@ function ButtonDatePicker(props) {
|
|
|
17466
17490
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
17467
17491
|
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
17468
17492
|
const buttonRef = useRef47(null);
|
|
17469
|
-
const {
|
|
17493
|
+
const {
|
|
17494
|
+
menuTriggerProps,
|
|
17495
|
+
menuProps: { autoFocus: _af, ...menuProps }
|
|
17496
|
+
} = useMenuTrigger4({ isDisabled: !!disabled }, state, buttonRef);
|
|
17470
17497
|
const tid = useTestIds(
|
|
17471
17498
|
props,
|
|
17472
17499
|
isTextButton(trigger) ? defaultTestId(labelOr(trigger, "buttonDatePicker")) : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
@@ -17687,7 +17714,7 @@ function Copy(props) {
|
|
|
17687
17714
|
|
|
17688
17715
|
// src/components/DnDGrid/DnDGrid.tsx
|
|
17689
17716
|
import equal2 from "fast-deep-equal";
|
|
17690
|
-
import { useCallback as
|
|
17717
|
+
import { useCallback as useCallback24, useRef as useRef50 } from "react";
|
|
17691
17718
|
|
|
17692
17719
|
// src/components/DnDGrid/DnDGridContext.tsx
|
|
17693
17720
|
import { createContext as createContext7, useContext as useContext17 } from "react";
|
|
@@ -17711,19 +17738,19 @@ function DnDGrid(props) {
|
|
|
17711
17738
|
const reorderViaKeyboard = useRef50(false);
|
|
17712
17739
|
const transformFrom = useRef50({ x: 0, y: 0 });
|
|
17713
17740
|
const tid = useTestIds(props, "dndGrid");
|
|
17714
|
-
const getGridItems =
|
|
17741
|
+
const getGridItems = useCallback24(() => {
|
|
17715
17742
|
return gridEl.current ? Array.from(gridEl.current.querySelectorAll(`[${gridItemIdKey}]`)) : [];
|
|
17716
17743
|
}, []);
|
|
17717
|
-
const getGridItemIdOrder =
|
|
17744
|
+
const getGridItemIdOrder = useCallback24(() => {
|
|
17718
17745
|
return getGridItems().map((child) => child.getAttribute(gridItemIdKey)).filter(isDefined);
|
|
17719
17746
|
}, [getGridItems]);
|
|
17720
|
-
const initReorder =
|
|
17747
|
+
const initReorder = useCallback24(() => {
|
|
17721
17748
|
if (gridEl.current && dragEl.current) {
|
|
17722
17749
|
initialOrder.current = getGridItemIdOrder();
|
|
17723
17750
|
dragEl.current.classList.add(activeGridItemClass);
|
|
17724
17751
|
}
|
|
17725
17752
|
}, [getGridItemIdOrder]);
|
|
17726
|
-
const commitReorder =
|
|
17753
|
+
const commitReorder = useCallback24(() => {
|
|
17727
17754
|
if (gridEl.current && dragEl.current) {
|
|
17728
17755
|
const currentOrder = getGridItemIdOrder();
|
|
17729
17756
|
if (!equal2(currentOrder, initialOrder.current)) onReorder(currentOrder);
|
|
@@ -17733,7 +17760,7 @@ function DnDGrid(props) {
|
|
|
17733
17760
|
initialOrder.current = currentOrder;
|
|
17734
17761
|
}
|
|
17735
17762
|
}, [onReorder, getGridItemIdOrder]);
|
|
17736
|
-
const cancelReorder =
|
|
17763
|
+
const cancelReorder = useCallback24(() => {
|
|
17737
17764
|
if (gridEl.current && dragEl.current && initialOrder.current) {
|
|
17738
17765
|
const currentOrder = getGridItemIdOrder();
|
|
17739
17766
|
if (!equal2(currentOrder, initialOrder.current)) {
|
|
@@ -17755,7 +17782,7 @@ function DnDGrid(props) {
|
|
|
17755
17782
|
reorderViaKeyboard.current = false;
|
|
17756
17783
|
}
|
|
17757
17784
|
}, [getGridItemIdOrder, getGridItems]);
|
|
17758
|
-
const onMove =
|
|
17785
|
+
const onMove = useCallback24((e) => {
|
|
17759
17786
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
17760
17787
|
const clientX = "clientX" in e ? e.clientX : e.touches[0].clientX;
|
|
17761
17788
|
const clientY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
@@ -17776,7 +17803,7 @@ function DnDGrid(props) {
|
|
|
17776
17803
|
}
|
|
17777
17804
|
}
|
|
17778
17805
|
}, []);
|
|
17779
|
-
const onDragStart =
|
|
17806
|
+
const onDragStart = useCallback24(
|
|
17780
17807
|
(e) => {
|
|
17781
17808
|
if (!reorderViaKeyboard.current && dragEl.current && gridEl.current) {
|
|
17782
17809
|
initReorder();
|
|
@@ -17806,7 +17833,7 @@ function DnDGrid(props) {
|
|
|
17806
17833
|
},
|
|
17807
17834
|
[initReorder, onMove]
|
|
17808
17835
|
);
|
|
17809
|
-
const onDragEnd =
|
|
17836
|
+
const onDragEnd = useCallback24(
|
|
17810
17837
|
(e) => {
|
|
17811
17838
|
if (!reorderViaKeyboard.current && dragEl.current && cloneEl.current && gridEl.current) {
|
|
17812
17839
|
e.preventDefault();
|
|
@@ -17822,7 +17849,7 @@ function DnDGrid(props) {
|
|
|
17822
17849
|
},
|
|
17823
17850
|
[commitReorder, onMove]
|
|
17824
17851
|
);
|
|
17825
|
-
const onDragHandleKeyDown =
|
|
17852
|
+
const onDragHandleKeyDown = useCallback24(
|
|
17826
17853
|
(e) => {
|
|
17827
17854
|
const moveHandle = e.target;
|
|
17828
17855
|
if (dragEl.current instanceof HTMLElement && moveHandle instanceof HTMLElement && gridEl.current) {
|
|
@@ -18077,7 +18104,7 @@ function HbSpinnerProvider({ quips = [], children }) {
|
|
|
18077
18104
|
|
|
18078
18105
|
// src/components/MaxLines.tsx
|
|
18079
18106
|
import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
|
|
18080
|
-
import { useCallback as
|
|
18107
|
+
import { useCallback as useCallback25, useEffect as useEffect29, useRef as useRef51, useState as useState43 } from "react";
|
|
18081
18108
|
import { jsx as jsx161, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
|
|
18082
18109
|
function MaxLines({ maxLines, children }) {
|
|
18083
18110
|
const elRef = useRef51(null);
|
|
@@ -18090,7 +18117,7 @@ function MaxLines({ maxLines, children }) {
|
|
|
18090
18117
|
useEffect29(() => {
|
|
18091
18118
|
setExpanded(false);
|
|
18092
18119
|
}, [children]);
|
|
18093
|
-
const onResize =
|
|
18120
|
+
const onResize = useCallback25(() => {
|
|
18094
18121
|
if (!elRef.current) return;
|
|
18095
18122
|
!expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
|
|
18096
18123
|
}, [expanded]);
|
|
@@ -18103,7 +18130,7 @@ function MaxLines({ maxLines, children }) {
|
|
|
18103
18130
|
|
|
18104
18131
|
// src/components/ScrollShadows.tsx
|
|
18105
18132
|
import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
|
|
18106
|
-
import { useCallback as
|
|
18133
|
+
import { useCallback as useCallback26, useMemo as useMemo44, useRef as useRef52, useState as useState44 } from "react";
|
|
18107
18134
|
import { jsx as jsx162, jsxs as jsxs80 } from "@emotion/react/jsx-runtime";
|
|
18108
18135
|
function ScrollShadows(props) {
|
|
18109
18136
|
const { children, xss, horizontal = false, bgColor = "rgba(255,255,255,1)" /* White */ } = props;
|
|
@@ -18127,7 +18154,7 @@ function ScrollShadows(props) {
|
|
|
18127
18154
|
{ ...commonStyles, ...endShadowStyles2, ...Css.add("background", endGradient).$ }
|
|
18128
18155
|
];
|
|
18129
18156
|
}, [horizontal, bgColor]);
|
|
18130
|
-
const updateScrollProps =
|
|
18157
|
+
const updateScrollProps = useCallback26(
|
|
18131
18158
|
(el) => {
|
|
18132
18159
|
const { scrollTop, scrollHeight, clientHeight, scrollWidth, scrollLeft, clientWidth } = el;
|
|
18133
18160
|
const start = horizontal ? scrollLeft : scrollTop;
|
|
@@ -18138,7 +18165,7 @@ function ScrollShadows(props) {
|
|
|
18138
18165
|
},
|
|
18139
18166
|
[horizontal]
|
|
18140
18167
|
);
|
|
18141
|
-
const onResize =
|
|
18168
|
+
const onResize = useCallback26(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
|
|
18142
18169
|
useResizeObserver6({ ref: scrollRef, onResize });
|
|
18143
18170
|
return /* @__PURE__ */ jsxs80(
|
|
18144
18171
|
"div",
|
|
@@ -18166,10 +18193,10 @@ function ScrollShadows(props) {
|
|
|
18166
18193
|
}
|
|
18167
18194
|
|
|
18168
18195
|
// src/components/Snackbar/useSnackbar.tsx
|
|
18169
|
-
import { useCallback as
|
|
18196
|
+
import { useCallback as useCallback27, useEffect as useEffect30 } from "react";
|
|
18170
18197
|
function useSnackbar() {
|
|
18171
18198
|
const { setNotices, setOffset } = useSnackbarContext();
|
|
18172
|
-
const onClose =
|
|
18199
|
+
const onClose = useCallback27(
|
|
18173
18200
|
(noticeId) => {
|
|
18174
18201
|
setNotices((prev) => {
|
|
18175
18202
|
let returnValue = prev;
|
|
@@ -18186,7 +18213,7 @@ function useSnackbar() {
|
|
|
18186
18213
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18187
18214
|
[]
|
|
18188
18215
|
);
|
|
18189
|
-
const triggerNotice =
|
|
18216
|
+
const triggerNotice = useCallback27(
|
|
18190
18217
|
(props) => {
|
|
18191
18218
|
const noticeId = props.id ?? `beamSnackbar:${snackbarId++}`;
|
|
18192
18219
|
let maybeTimeout;
|
|
@@ -18215,7 +18242,7 @@ function useSnackbar() {
|
|
|
18215
18242
|
},
|
|
18216
18243
|
[onClose, setNotices]
|
|
18217
18244
|
);
|
|
18218
|
-
const closeNotice =
|
|
18245
|
+
const closeNotice = useCallback27((id) => onClose(id), [onClose]);
|
|
18219
18246
|
const useSnackbarOffset = ({ bottom }) => useEffect30(() => {
|
|
18220
18247
|
setOffset({ bottom });
|
|
18221
18248
|
return () => setOffset({});
|
|
@@ -18720,10 +18747,10 @@ function hideTabs(props) {
|
|
|
18720
18747
|
}
|
|
18721
18748
|
|
|
18722
18749
|
// src/components/Toast/useToast.tsx
|
|
18723
|
-
import { useCallback as
|
|
18750
|
+
import { useCallback as useCallback28 } from "react";
|
|
18724
18751
|
function useToast() {
|
|
18725
18752
|
const { setNotice, clear } = useToastContext();
|
|
18726
|
-
const showToast =
|
|
18753
|
+
const showToast = useCallback28((props) => setNotice(props), [setNotice]);
|
|
18727
18754
|
return { showToast, clear };
|
|
18728
18755
|
}
|
|
18729
18756
|
export {
|