@homebound/beam 2.369.3 → 2.369.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Css.js +7 -7
- package/dist/components/Accordion.js +1 -2
- package/dist/components/AccordionList.js +1 -2
- package/dist/components/AutoSaveIndicator.js +1 -2
- package/dist/components/AutoSaveStatus/AutoSaveStatusProvider.js +3 -3
- package/dist/components/AutoSaveStatus/useAutoSaveStatus.js +1 -2
- package/dist/components/Avatar/Avatar.js +1 -2
- package/dist/components/Avatar/AvatarButton.js +2 -2
- package/dist/components/Avatar/AvatarGroup.js +1 -2
- package/dist/components/Banner.js +1 -2
- package/dist/components/BeamContext.js +3 -3
- package/dist/components/Button.js +1 -2
- package/dist/components/ButtonDatePicker.js +1 -2
- package/dist/components/ButtonGroup.js +1 -2
- package/dist/components/ButtonMenu.js +1 -2
- package/dist/components/ButtonModal.js +1 -2
- package/dist/components/Chip.d.ts +1 -1
- package/dist/components/Chip.js +3 -3
- package/dist/components/Chips.js +1 -2
- package/dist/components/Copy.js +1 -2
- package/dist/components/CssReset.js +2 -2
- package/dist/components/DnDGrid/DnDGrid.js +2 -2
- package/dist/components/DnDGrid/DnDGridContext.js +2 -2
- package/dist/components/DnDGrid/DnDGridItemHandle.js +1 -2
- package/dist/components/DnDGrid/useDnDGridItem.js +1 -2
- package/dist/components/Filters/BooleanFilter.js +1 -2
- package/dist/components/Filters/CheckboxFilter.js +1 -2
- package/dist/components/Filters/DateFilter.js +1 -2
- package/dist/components/Filters/DateRangeFilter.js +1 -2
- package/dist/components/Filters/FilterModal.js +2 -3
- package/dist/components/Filters/MultiFilter.js +1 -2
- package/dist/components/Filters/NumberRangeFilter.js +1 -2
- package/dist/components/Filters/SingleFilter.js +2 -3
- package/dist/components/Filters/ToggleFilter.js +1 -2
- package/dist/components/Filters/TreeFilter.js +1 -2
- package/dist/components/Filters/index.d.ts +1 -1
- package/dist/components/Filters/index.js +3 -3
- package/dist/components/Filters/testDomain.js +3 -3
- package/dist/components/Filters/types.d.ts +0 -1
- package/dist/components/Filters/utils.js +2 -2
- package/dist/components/Grid/ResponsiveGrid.js +1 -2
- package/dist/components/Grid/ResponsiveGridItem.js +1 -2
- package/dist/components/Grid/useResponsiveGrid.js +1 -2
- package/dist/components/Grid/useResponsiveGridItem.js +1 -2
- package/dist/components/HbLoadingSpinner.js +3 -3
- package/dist/components/HelperText.js +1 -2
- package/dist/components/IconButton.js +2 -2
- package/dist/components/Label.js +3 -3
- package/dist/components/Layout/FullBleed.js +1 -2
- package/dist/components/Layout/PreventBrowserScroll.js +1 -2
- package/dist/components/Layout/RightPaneLayout/RightPaneContext.js +3 -3
- package/dist/components/Layout/RightPaneLayout/RightPaneLayout.js +1 -2
- package/dist/components/Layout/RightPaneLayout/useRightPane.js +1 -2
- package/dist/components/Layout/ScrollableContent.js +1 -2
- package/dist/components/Layout/ScrollableParent.js +3 -3
- package/dist/components/Loader.js +1 -2
- package/dist/components/LoadingSkeleton.js +1 -2
- package/dist/components/MaxLines.js +3 -4
- package/dist/components/Modal/Modal.js +5 -6
- package/dist/components/Modal/ModalContext.js +3 -3
- package/dist/components/Modal/OpenModal.d.ts +0 -1
- package/dist/components/Modal/OpenModal.js +1 -2
- package/dist/components/Modal/TestModalContent.js +3 -4
- package/dist/components/Modal/useModal.js +1 -2
- package/dist/components/NavLink.js +2 -3
- package/dist/components/Pagination.js +4 -4
- package/dist/components/PresentationContext.js +3 -3
- package/dist/components/ScrollShadows.js +1 -2
- package/dist/components/Snackbar/Snackbar.js +1 -2
- package/dist/components/Snackbar/SnackbarContext.js +3 -3
- package/dist/components/Snackbar/SnackbarNotice.js +1 -2
- package/dist/components/Snackbar/useSnackbar.js +1 -2
- package/dist/components/Stepper.js +1 -2
- package/dist/components/SuperDrawer/ConfirmCloseModal.js +1 -2
- package/dist/components/SuperDrawer/SuperDrawer.js +1 -2
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +1 -2
- package/dist/components/SuperDrawer/useSuperDrawer.js +1 -2
- package/dist/components/SuperDrawer/utils.js +1 -1
- package/dist/components/Table/GridTable.js +13 -16
- package/dist/components/Table/GridTableApi.js +3 -3
- package/dist/components/Table/TableActions.js +1 -2
- package/dist/components/Table/TableStyles.js +2 -2
- package/dist/components/Table/components/CollapseToggle.js +1 -2
- package/dist/components/Table/components/EditColumnsButton.js +1 -2
- package/dist/components/Table/components/ExpandableHeader.js +1 -2
- package/dist/components/Table/components/KeptGroupRow.js +1 -2
- package/dist/components/Table/components/SelectToggle.js +1 -2
- package/dist/components/Table/components/SortHeader.js +1 -2
- package/dist/components/Table/components/cell.js +1 -1
- package/dist/components/Table/hooks/useSetupColumnSizes.js +1 -2
- package/dist/components/Table/utils/ColumnState.js +1 -1
- package/dist/components/Table/utils/GridRowLookup.js +2 -3
- package/dist/components/Table/utils/RowState.d.ts +1 -1
- package/dist/components/Table/utils/RowState.js +1 -1
- package/dist/components/Table/utils/TableState.js +2 -2
- package/dist/components/Table/utils/columns.js +12 -12
- package/dist/components/Table/utils/simpleHelpers.js +2 -2
- package/dist/components/Table/utils/sortRows.js +4 -5
- package/dist/components/Table/utils/utils.js +15 -15
- package/dist/components/Table/utils/visitor.js +1 -2
- package/dist/components/Tabs.js +6 -7
- package/dist/components/Tag.d.ts +1 -1
- package/dist/components/Tag.js +6 -7
- package/dist/components/Toast/Toast.js +1 -2
- package/dist/components/Toast/ToastContext.js +3 -3
- package/dist/components/Toast/useToast.js +1 -2
- package/dist/components/ToggleChip.js +1 -2
- package/dist/components/ToggleChips.js +1 -2
- package/dist/components/Tooltip.js +7 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/internal/CompoundField.d.ts +0 -1
- package/dist/components/internal/CompoundField.js +1 -2
- package/dist/components/internal/ContextualModal.js +1 -2
- package/dist/components/internal/DatePicker/DatePicker.js +1 -2
- package/dist/components/internal/DatePicker/DatePickerOverlay.js +1 -2
- package/dist/components/internal/DatePicker/DateRangePicker.js +1 -2
- package/dist/components/internal/DatePicker/Day.js +1 -2
- package/dist/components/internal/DatePicker/Header.js +2 -3
- package/dist/components/internal/DatePicker/WeekHeader.js +1 -2
- package/dist/components/internal/Menu.js +1 -2
- package/dist/components/internal/MenuItem.js +1 -2
- package/dist/components/internal/MenuSection.js +1 -2
- package/dist/components/internal/OverlayTrigger.js +5 -6
- package/dist/components/internal/Popover.js +2 -3
- package/dist/components/testData.js +2 -2
- package/dist/forms/BoundCheckboxField.js +1 -2
- package/dist/forms/BoundCheckboxGroupField.js +1 -2
- package/dist/forms/BoundChipSelectField.d.ts +0 -1
- package/dist/forms/BoundChipSelectField.js +1 -2
- package/dist/forms/BoundDateField.js +1 -2
- package/dist/forms/BoundDateRangeField.js +1 -2
- package/dist/forms/BoundIconCardField.d.ts +1 -1
- package/dist/forms/BoundIconCardField.js +3 -4
- package/dist/forms/BoundIconCardGroupField.d.ts +1 -1
- package/dist/forms/BoundIconCardGroupField.js +1 -2
- package/dist/forms/BoundMultiLineSelectField.d.ts +0 -1
- package/dist/forms/BoundMultiLineSelectField.js +1 -2
- package/dist/forms/BoundMultiSelectField.d.ts +0 -1
- package/dist/forms/BoundMultiSelectField.js +1 -2
- package/dist/forms/BoundNumberField.js +1 -2
- package/dist/forms/BoundRadioGroupField.js +1 -2
- package/dist/forms/BoundRichTextField.js +1 -2
- package/dist/forms/BoundSelectAndTextField.d.ts +0 -1
- package/dist/forms/BoundSelectAndTextField.js +1 -2
- package/dist/forms/BoundSelectField.d.ts +0 -1
- package/dist/forms/BoundSelectField.js +2 -3
- package/dist/forms/BoundSwitchField.js +1 -2
- package/dist/forms/BoundTextAreaField.js +1 -2
- package/dist/forms/BoundTextField.js +1 -2
- package/dist/forms/BoundToggleChipGroupField.js +1 -2
- package/dist/forms/BoundTreeSelectField.d.ts +0 -1
- package/dist/forms/BoundTreeSelectField.js +1 -2
- package/dist/forms/FormHeading.js +1 -2
- package/dist/forms/FormLines.js +4 -5
- package/dist/forms/FormStateApp.js +3 -3
- package/dist/forms/StaticField.js +1 -2
- package/dist/forms/StepperFormApp.js +1 -2
- package/dist/forms/SubmitButton.js +1 -2
- package/dist/forms/formStateDomain.js +1 -1
- package/dist/forms/index.d.ts +2 -2
- package/dist/forms/index.js +2 -2
- package/dist/forms/labelUtils.js +1 -2
- package/dist/hooks/useBreakpoint.js +1 -2
- package/dist/hooks/useComputed.d.ts +42 -1
- package/dist/hooks/useComputed.js +43 -3
- package/dist/hooks/useFilter.js +1 -2
- package/dist/hooks/useGroupBy.js +1 -2
- package/dist/hooks/useHover.js +1 -2
- package/dist/hooks/usePersistedFilter.js +2 -3
- package/dist/hooks/useQueryState.js +1 -2
- package/dist/hooks/useRenderCount.js +1 -2
- package/dist/hooks/useSessionStorage.js +1 -2
- package/dist/inputs/Autocomplete.js +1 -2
- package/dist/inputs/Checkbox.js +1 -2
- package/dist/inputs/CheckboxBase.js +2 -3
- package/dist/inputs/CheckboxGroup.js +1 -2
- package/dist/inputs/ChipSelectField.js +5 -5
- package/dist/inputs/ChipTextField.js +1 -2
- package/dist/inputs/DateFields/DateField.js +1 -2
- package/dist/inputs/DateFields/DateField.mock.js +1 -2
- package/dist/inputs/DateFields/DateFieldBase.js +2 -3
- package/dist/inputs/DateFields/DateRangeField.js +1 -2
- package/dist/inputs/DateFields/utils.js +7 -7
- package/dist/inputs/ErrorMessage.js +1 -2
- package/dist/inputs/IconCard.js +2 -2
- package/dist/inputs/IconCardGroup.js +5 -6
- package/dist/inputs/MultiLineSelectField.d.ts +0 -1
- package/dist/inputs/MultiLineSelectField.js +1 -2
- package/dist/inputs/MultiSelectField.js +1 -2
- package/dist/inputs/NumberField.js +2 -3
- package/dist/inputs/RadioGroupField.js +2 -2
- package/dist/inputs/RichTextField.d.ts +1 -1
- package/dist/inputs/RichTextField.js +2 -3
- package/dist/inputs/RichTextField.mock.js +1 -2
- package/dist/inputs/SelectField.d.ts +0 -1
- package/dist/inputs/SelectField.js +1 -2
- package/dist/inputs/Switch.js +3 -3
- package/dist/inputs/SwitchGroup.js +1 -2
- package/dist/inputs/TextAreaField.js +1 -2
- package/dist/inputs/TextField.js +1 -2
- package/dist/inputs/TextFieldBase.js +2 -3
- package/dist/inputs/ToggleButton.js +2 -2
- package/dist/inputs/ToggleChipGroup.d.ts +1 -1
- package/dist/inputs/ToggleChipGroup.js +2 -3
- package/dist/inputs/TreeSelectField/TreeOption.js +1 -2
- package/dist/inputs/TreeSelectField/TreeSelectField.js +5 -5
- package/dist/inputs/TreeSelectField/utils.js +5 -6
- package/dist/inputs/Value.js +2 -3
- package/dist/inputs/hooks/useGrowingTextField.js +1 -2
- package/dist/inputs/index.d.ts +1 -1
- package/dist/inputs/index.js +1 -1
- package/dist/inputs/internal/ComboBoxBase.js +6 -6
- package/dist/inputs/internal/ComboBoxInput.js +2 -3
- package/dist/inputs/internal/ListBox.js +1 -2
- package/dist/inputs/internal/ListBoxChip.js +1 -2
- package/dist/inputs/internal/ListBoxSection.js +1 -2
- package/dist/inputs/internal/ListBoxToggleChip.js +1 -2
- package/dist/inputs/internal/LoadingDots.js +1 -2
- package/dist/inputs/internal/MenuSearchField.js +1 -2
- package/dist/inputs/internal/Option.js +1 -2
- package/dist/inputs/internal/VirtualizedOptions.d.ts +0 -1
- package/dist/inputs/internal/VirtualizedOptions.js +1 -2
- package/dist/inputs/utils.js +1 -2
- package/dist/types.js +1 -2
- package/dist/utils/defaultLabel.js +1 -2
- package/dist/utils/defaultTestId.js +1 -2
- package/dist/utils/getInteractiveElement.js +1 -2
- package/dist/utils/index.js +12 -12
- package/dist/utils/options.js +2 -3
- package/dist/utils/rtl.d.ts +2 -3
- package/dist/utils/rtl.js +13 -13
- package/dist/utils/sb.d.ts +3 -3
- package/dist/utils/sb.js +7 -7
- package/dist/utils/shallowEqual.js +1 -2
- package/dist/utils/useTestIds.js +2 -3
- package/package.json +38 -45
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextFieldBase =
|
|
3
|
+
exports.TextFieldBase = TextFieldBase;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
@@ -12,9 +12,9 @@ const Css_1 = require("../Css");
|
|
|
12
12
|
const labelUtils_1 = require("../forms/labelUtils");
|
|
13
13
|
const useGetRef_1 = require("../hooks/useGetRef");
|
|
14
14
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
15
16
|
const defaultTestId_1 = require("../utils/defaultTestId");
|
|
16
17
|
const useTestIds_1 = require("../utils/useTestIds");
|
|
17
|
-
const utils_1 = require("./utils");
|
|
18
18
|
// Used by both TextField and TextArea
|
|
19
19
|
function TextFieldBase(props) {
|
|
20
20
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -164,4 +164,3 @@ function TextFieldBase(props) {
|
|
|
164
164
|
// Reduces the margin between the error/helper text and input field
|
|
165
165
|
(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.mtPx(-8).$, children: [errorMsg && !errorInTooltip && ((0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { id: errorMessageId, errorMsg: errorMsg, hidden: hideErrorMessage, ...tid.errorMsg })), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText, ...tid.helperText })] }))] }));
|
|
166
166
|
}
|
|
167
|
-
exports.TextFieldBase = TextFieldBase;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.togglePressStyles = exports.toggleFocusStyles = exports.toggleHoverStyles =
|
|
3
|
+
exports.togglePressStyles = exports.toggleFocusStyles = exports.toggleHoverStyles = void 0;
|
|
4
|
+
exports.ToggleButton = ToggleButton;
|
|
4
5
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_aria_1 = require("react-aria");
|
|
@@ -53,7 +54,6 @@ function ToggleButton(props) {
|
|
|
53
54
|
children: ((0, jsx_runtime_1.jsxs)("label", { ...labelAttrs, children: [icon && (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: icon }), label, (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...inputProps, ...tid.value }) })] })),
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
exports.ToggleButton = ToggleButton;
|
|
57
57
|
/** Styles */
|
|
58
58
|
// Toggle element styles
|
|
59
59
|
exports.toggleHoverStyles = Css_1.Css.bgGray100.$;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { Xss } from "../Css";
|
|
3
2
|
import { PresentationFieldProps } from "../components/PresentationContext";
|
|
3
|
+
import { Xss } from "../Css";
|
|
4
4
|
type ToggleChipXss = Xss<"color" | "backgroundColor">;
|
|
5
5
|
type ToggleChipItemProps = {
|
|
6
6
|
label: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToggleChipGroup =
|
|
3
|
+
exports.ToggleChipGroup = ToggleChipGroup;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
7
7
|
const react_stately_1 = require("react-stately");
|
|
8
8
|
const components_1 = require("../components");
|
|
9
9
|
const Label_1 = require("../components/Label");
|
|
10
|
+
const PresentationContext_1 = require("../components/PresentationContext");
|
|
10
11
|
const Css_1 = require("../Css");
|
|
11
12
|
const useTestIds_1 = require("../utils/useTestIds");
|
|
12
|
-
const PresentationContext_1 = require("../components/PresentationContext");
|
|
13
13
|
function ToggleChipGroup(props) {
|
|
14
14
|
var _a;
|
|
15
15
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
@@ -23,7 +23,6 @@ function ToggleChipGroup(props) {
|
|
|
23
23
|
.if(labelStyle === "left")
|
|
24
24
|
.w(labelLeftFieldWidth).$, children: options.map((o) => ((0, jsx_runtime_1.jsx)(ToggleChip, { value: o.value, groupState: state, selected: state.value.includes(o.value), label: o.label, disabled: o.disabled, startAdornment: o.startAdornment, xss: xss, ...tid[o.value] }, o.value))) })] }));
|
|
25
25
|
}
|
|
26
|
-
exports.ToggleChipGroup = ToggleChipGroup;
|
|
27
26
|
function ToggleChip(props) {
|
|
28
27
|
var _a, _b, _c;
|
|
29
28
|
const { label, value, groupState, selected: isSelected, disabled = false, startAdornment, xss, ...others } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TreeOption =
|
|
3
|
+
exports.TreeOption = TreeOption;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
@@ -55,7 +55,6 @@ function TreeOption(props) {
|
|
|
55
55
|
return false;
|
|
56
56
|
}, css: Css_1.Css.br4.hPx(16).wPx(16).bgTransparent.onHover.bgGray300.$, ...tid[`collapseToggle_${item.key}`], children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: collapsedKeys.includes(item.key) ? "triangleRight" : "triangleDown", inc: 2 }) })) })), (0, jsx_runtime_1.jsxs)("span", { css: Css_1.Css.df.aic.gap1.h100.fg1.py1.pr2.$, ref: ref, ...optionProps, "data-label": item.textValue, children: [(0, jsx_runtime_1.jsx)(CheckboxBase_1.StyledCheckbox, { isDisabled: isDisabled, isSelected: isSelected, isIndeterminate: isIndeterminate, ...tid[item.key.toString()] }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.pl1.$, children: item.rendered })] })] }));
|
|
57
57
|
}
|
|
58
|
-
exports.TreeOption = TreeOption;
|
|
59
58
|
function hasSelectedChildren(childOption, state, getOptionValue) {
|
|
60
59
|
if (childOption.children && childOption.children.length > 0) {
|
|
61
60
|
return childOption.children.some((child) => hasSelectedChildren(child, state, getOptionValue));
|
|
@@ -23,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.CollapsedContext =
|
|
26
|
+
exports.CollapsedContext = void 0;
|
|
27
|
+
exports.TreeSelectField = TreeSelectField;
|
|
28
|
+
exports.useTreeSelectFieldProvider = useTreeSelectFieldProvider;
|
|
27
29
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
28
30
|
const react_1 = __importStar(require("react"));
|
|
29
31
|
const react_aria_1 = require("react-aria");
|
|
@@ -32,12 +34,12 @@ const components_1 = require("../../components");
|
|
|
32
34
|
const internal_1 = require("../../components/internal");
|
|
33
35
|
const PresentationContext_1 = require("../../components/PresentationContext");
|
|
34
36
|
const Css_1 = require("../../Css");
|
|
37
|
+
const ComboBoxBase_1 = require("../internal/ComboBoxBase");
|
|
35
38
|
const ComboBoxInput_1 = require("../internal/ComboBoxInput");
|
|
36
39
|
const ListBox_1 = require("../internal/ListBox");
|
|
37
40
|
const utils_1 = require("./utils");
|
|
38
|
-
const Value_1 = require("../Value");
|
|
39
41
|
const utils_2 = require("../utils");
|
|
40
|
-
const
|
|
42
|
+
const Value_1 = require("../Value");
|
|
41
43
|
function TreeSelectField(props) {
|
|
42
44
|
const { getOptionValue = (opt) => opt.id, // if unset, assume O implements HasId
|
|
43
45
|
getOptionLabel = (opt) => opt.name, // if unset, assume O implements HasName
|
|
@@ -63,11 +65,9 @@ function TreeSelectField(props) {
|
|
|
63
65
|
onSelect({ all, leaf, root });
|
|
64
66
|
} }) }));
|
|
65
67
|
}
|
|
66
|
-
exports.TreeSelectField = TreeSelectField;
|
|
67
68
|
function useTreeSelectFieldProvider() {
|
|
68
69
|
return (0, react_1.useContext)(exports.CollapsedContext);
|
|
69
70
|
}
|
|
70
|
-
exports.useTreeSelectFieldProvider = useTreeSelectFieldProvider;
|
|
71
71
|
// create the context to hold the collapsed state, default should be false
|
|
72
72
|
exports.CollapsedContext = react_1.default.createContext({
|
|
73
73
|
collapsedKeys: [],
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findOption = findOption;
|
|
4
|
+
exports.findOptions = findOptions;
|
|
5
|
+
exports.flattenOptions = flattenOptions;
|
|
6
|
+
exports.isLeveledOption = isLeveledOption;
|
|
7
|
+
exports.isLeveledNode = isLeveledNode;
|
|
4
8
|
/** Finds first option by Key, and returns it + any parents. */
|
|
5
9
|
function findOption(options, key, getOptionValue) {
|
|
6
10
|
// This is technically an array of "maybe FoundOption"
|
|
@@ -17,7 +21,6 @@ function findOption(options, key, getOptionValue) {
|
|
|
17
21
|
}
|
|
18
22
|
return undefined;
|
|
19
23
|
}
|
|
20
|
-
exports.findOption = findOption;
|
|
21
24
|
/** Finds all options by Key, and returns it + any parents. */
|
|
22
25
|
function findOptions(options, key, getOptionValue) {
|
|
23
26
|
// This is technically an array of "maybe FoundOption"
|
|
@@ -35,17 +38,13 @@ function findOptions(options, key, getOptionValue) {
|
|
|
35
38
|
}
|
|
36
39
|
return found;
|
|
37
40
|
}
|
|
38
|
-
exports.findOptions = findOptions;
|
|
39
41
|
function flattenOptions(o) {
|
|
40
42
|
var _a;
|
|
41
43
|
return [o, ...(((_a = o.children) === null || _a === void 0 ? void 0 : _a.length) ? o.children.flatMap((oc) => flattenOptions(oc)) : [])];
|
|
42
44
|
}
|
|
43
|
-
exports.flattenOptions = flattenOptions;
|
|
44
45
|
function isLeveledOption(option) {
|
|
45
46
|
return Array.isArray(option) && option.length === 2 && typeof option[1] === "number";
|
|
46
47
|
}
|
|
47
|
-
exports.isLeveledOption = isLeveledOption;
|
|
48
48
|
function isLeveledNode(node) {
|
|
49
49
|
return isLeveledOption(node.value);
|
|
50
50
|
}
|
|
51
|
-
exports.isLeveledNode = isLeveledNode;
|
package/dist/inputs/Value.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.keyToValue = keyToValue;
|
|
4
|
+
exports.valueToKey = valueToKey;
|
|
4
5
|
function keyToValue(key) {
|
|
5
6
|
if (typeof key === "number") {
|
|
6
7
|
// react-aria's selection manager always returns strings, so we probably
|
|
@@ -28,7 +29,6 @@ function keyToValue(key) {
|
|
|
28
29
|
throw new Error(`Unsupported key ${key}`);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
exports.keyToValue = keyToValue;
|
|
32
32
|
function valueToKey(value) {
|
|
33
33
|
if (typeof value === "string") {
|
|
34
34
|
return value;
|
|
@@ -51,4 +51,3 @@ function valueToKey(value) {
|
|
|
51
51
|
throw new Error(`Unsupported value ${value}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
exports.valueToKey = valueToKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGrowingTextField =
|
|
3
|
+
exports.useGrowingTextField = useGrowingTextField;
|
|
4
4
|
const utils_1 = require("@react-aria/utils");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
function useGrowingTextField({ inputRef, inputWrapRef, value, disabled }) {
|
|
@@ -39,4 +39,3 @@ function useGrowingTextField({ inputRef, inputWrapRef, value, disabled }) {
|
|
|
39
39
|
}
|
|
40
40
|
}, [onHeightChange, value, inputRef, disabled, inputWrapRef]);
|
|
41
41
|
}
|
|
42
|
-
exports.useGrowingTextField = useGrowingTextField;
|
package/dist/inputs/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./CheckboxGroup";
|
|
|
4
4
|
export * from "./ChipSelectField";
|
|
5
5
|
export * from "./DateFields";
|
|
6
6
|
export * from "./ErrorMessage";
|
|
7
|
+
export * from "./IconCard";
|
|
7
8
|
export * from "./MultiLineSelectField";
|
|
8
9
|
export * from "./MultiSelectField";
|
|
9
10
|
export * from "./NumberField";
|
|
@@ -19,5 +20,4 @@ export type { TextFieldApi } from "./TextField";
|
|
|
19
20
|
export * from "./ToggleButton";
|
|
20
21
|
export * from "./ToggleChipGroup";
|
|
21
22
|
export * from "./TreeSelectField";
|
|
22
|
-
export * from "./IconCard";
|
|
23
23
|
export type { Value } from "./Value";
|
package/dist/inputs/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./CheckboxGroup"), exports);
|
|
|
21
21
|
__exportStar(require("./ChipSelectField"), exports);
|
|
22
22
|
__exportStar(require("./DateFields"), exports);
|
|
23
23
|
__exportStar(require("./ErrorMessage"), exports);
|
|
24
|
+
__exportStar(require("./IconCard"), exports);
|
|
24
25
|
__exportStar(require("./MultiLineSelectField"), exports);
|
|
25
26
|
__exportStar(require("./MultiSelectField"), exports);
|
|
26
27
|
__exportStar(require("./NumberField"), exports);
|
|
@@ -34,4 +35,3 @@ __exportStar(require("./TextField"), exports);
|
|
|
34
35
|
__exportStar(require("./ToggleButton"), exports);
|
|
35
36
|
__exportStar(require("./ToggleChipGroup"), exports);
|
|
36
37
|
__exportStar(require("./TreeSelectField"), exports);
|
|
37
|
-
__exportStar(require("./IconCard"), exports);
|
|
@@ -3,8 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.addNewOption = exports.unsetOption = void 0;
|
|
7
|
+
exports.ComboBoxBase = ComboBoxBase;
|
|
8
|
+
exports.initializeOptions = initializeOptions;
|
|
9
|
+
exports.disabledOptionToKeyedTuple = disabledOptionToKeyedTuple;
|
|
7
10
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
11
|
+
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
12
|
const react_1 = require("react");
|
|
9
13
|
const react_aria_1 = require("react-aria");
|
|
10
14
|
const react_stately_1 = require("react-stately");
|
|
@@ -14,10 +18,9 @@ const PresentationContext_1 = require("../../components/PresentationContext");
|
|
|
14
18
|
const Css_1 = require("../../Css");
|
|
15
19
|
const ComboBoxInput_1 = require("./ComboBoxInput");
|
|
16
20
|
const ListBox_1 = require("./ListBox");
|
|
17
|
-
const Value_1 = require("../Value");
|
|
18
21
|
const utils_1 = require("../utils");
|
|
22
|
+
const Value_1 = require("../Value");
|
|
19
23
|
const use_debounce_1 = require("use-debounce");
|
|
20
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
21
24
|
/**
|
|
22
25
|
* Provides a non-native select/dropdown widget that allows the user to type to filter the options.
|
|
23
26
|
*
|
|
@@ -251,7 +254,6 @@ function ComboBoxBase(props) {
|
|
|
251
254
|
const fieldMaxWidth = (0, utils_1.getFieldWidth)(fullWidth);
|
|
252
255
|
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.fdc.w100.maxw(fieldMaxWidth).if(labelStyle === "left").maxw100.$, ref: comboBoxRef, children: [(0, jsx_runtime_1.jsx)(ComboBoxInput_1.ComboBoxInput, { ...otherProps, fullWidth: fullWidth, buttonProps: buttonProps, buttonRef: triggerRef, inputProps: inputProps, inputRef: inputRef, inputWrapRef: inputWrapRef, listBoxRef: listBoxRef, state: state, labelProps: labelProps, selectedOptions: selectedOptions, getOptionValue: getOptionValue, getOptionLabel: getOptionLabel, contrast: contrast, nothingSelectedText: nothingSelectedText, borderless: borderless, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly), resetField: resetField }), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: triggerRef, popoverRef: popoverRef, positionProps: positionProps, onClose: () => state.close(), isOpen: state.isOpen, minWidth: 200, children: (0, jsx_runtime_1.jsx)(ListBox_1.ListBox, { ...listBoxProps, positionProps: positionProps, state: state, listBoxRef: listBoxRef, selectedOptions: selectedOptions, getOptionLabel: getOptionLabel, getOptionValue: (o) => (0, Value_1.valueToKey)(getOptionValue(o)), contrast: contrast, horizontalLayout: labelStyle === "left", loading: fieldState.optionsLoading, disabledOptionsWithReasons: disabledOptionsWithReasons }) }))] }));
|
|
253
256
|
}
|
|
254
|
-
exports.ComboBoxBase = ComboBoxBase;
|
|
255
257
|
function getInputValue(selectedOptions, getOptionLabel, multiselect, nothingSelectedText, readOnly) {
|
|
256
258
|
return selectedOptions.length === 1
|
|
257
259
|
? getOptionLabel(selectedOptions[0])
|
|
@@ -292,7 +294,6 @@ function initializeOptions(optionsOrLoad, getOptionValue, unsetLabel, addNew) {
|
|
|
292
294
|
}
|
|
293
295
|
return opts;
|
|
294
296
|
}
|
|
295
|
-
exports.initializeOptions = initializeOptions;
|
|
296
297
|
/** A marker option to automatically add an "Unset" option to the start of options. */
|
|
297
298
|
exports.unsetOption = {};
|
|
298
299
|
exports.addNewOption = { id: "new", name: "Add New" };
|
|
@@ -304,4 +305,3 @@ function disabledOptionToKeyedTuple(disabledOption) {
|
|
|
304
305
|
return [(0, Value_1.valueToKey)(disabledOption), undefined];
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
|
-
exports.disabledOptionToKeyedTuple = disabledOptionToKeyedTuple;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComboBoxInput =
|
|
3
|
+
exports.ComboBoxInput = ComboBoxInput;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
7
7
|
const components_1 = require("../../components");
|
|
8
8
|
const PresentationContext_1 = require("../../components/PresentationContext");
|
|
9
9
|
const Css_1 = require("../../Css");
|
|
10
|
+
const useGrowingTextField_1 = require("../hooks/useGrowingTextField");
|
|
10
11
|
const TextFieldBase_1 = require("../TextFieldBase");
|
|
11
12
|
const TreeSelectField_1 = require("../TreeSelectField/TreeSelectField");
|
|
12
13
|
const utils_1 = require("../TreeSelectField/utils");
|
|
13
14
|
const utils_2 = require("../../utils");
|
|
14
|
-
const useGrowingTextField_1 = require("../hooks/useGrowingTextField");
|
|
15
15
|
function ComboBoxInput(props) {
|
|
16
16
|
const { inputProps, buttonProps, buttonRef, errorMsg, state, fieldDecoration, onBlur, onFocus, selectedOptions, selectedOptionsLabels, getOptionValue, getOptionLabel, sizeToContent = false, contrast = false, nothingSelectedText, resetField, isTree, listBoxRef, inputRef, inputWrapRef, multiline = false, ...otherProps } = props;
|
|
17
17
|
const { wrap = false } = (0, PresentationContext_1.usePresentationContext)();
|
|
@@ -150,7 +150,6 @@ function ComboBoxInput(props) {
|
|
|
150
150
|
},
|
|
151
151
|
} }));
|
|
152
152
|
}
|
|
153
|
-
exports.ComboBoxInput = ComboBoxInput;
|
|
154
153
|
function SelectedOptionBullets({ labels = [] }) {
|
|
155
154
|
return (0, jsx_runtime_1.jsx)("div", { children: labels === null || labels === void 0 ? void 0 : labels.map((label) => (0, jsx_runtime_1.jsx)("li", { children: label }, label)) });
|
|
156
155
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListBox =
|
|
3
|
+
exports.ListBox = ListBox;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
@@ -66,6 +66,5 @@ function ListBox(props) {
|
|
|
66
66
|
// Only scroll on focus if using VirtualFocus (used for ComboBoxState (SelectField), but not SelectState (ChipSelectField))
|
|
67
67
|
scrollOnFocus: props.shouldUseVirtualFocus, loading: loading, disabledOptionsWithReasons: disabledOptionsWithReasons, isTree: isTree, allowCollapsing: allowCollapsing })) })] }));
|
|
68
68
|
}
|
|
69
|
-
exports.ListBox = ListBox;
|
|
70
69
|
// UX specified maximum height for a ListBox (in pixels)
|
|
71
70
|
const maxPopoverHeight = 512;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListBoxChip =
|
|
3
|
+
exports.ListBoxChip = ListBoxChip;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const PresentationContext_1 = require("../../components/PresentationContext");
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
@@ -9,4 +9,3 @@ function ListBoxChip({ label }) {
|
|
|
9
9
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
10
10
|
return ((0, jsx_runtime_1.jsx)("span", { css: Css_1.Css[(_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _a !== void 0 ? _a : "sm"].tal.bgGray300.gray900.br16.pxPx(10).pyPx(2).lineClamp1.wbba.$, title: label, children: label }));
|
|
11
11
|
}
|
|
12
|
-
exports.ListBoxChip = ListBoxChip;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListBoxSection =
|
|
3
|
+
exports.ListBoxSection = ListBoxSection;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_aria_1 = require("react-aria");
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
@@ -17,4 +17,3 @@ function ListBoxSection(props) {
|
|
|
17
17
|
const childNodes = [...section.childNodes];
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isPersistentSection && (0, jsx_runtime_1.jsx)("li", { ...separatorProps, css: Css_1.Css.bt.bcGray200.$ }), (0, jsx_runtime_1.jsx)("li", { ...itemProps, css: Css_1.Css.if(!isPersistentSection).oa.$, children: (0, jsx_runtime_1.jsx)("ul", { css: Css_1.Css.listReset.if(!isPersistentSection).hPx(popoverHeight - constants_1.sectionSeparatorHeight - constants_1.persistentItemHeight).$, ...groupProps, children: isPersistentSection ? (childNodes.map((item) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { item: item, state: state, contrast: contrast, disabledReason: disabledOptionsWithReasons[item.key] }, item.key)))) : ((0, jsx_runtime_1.jsx)(VirtualizedOptions_1.VirtualizedOptions, { state: state, items: childNodes, onListHeightChange: onListHeightChange, contrast: contrast, scrollOnFocus: scrollOnFocus, disabledOptionsWithReasons: disabledOptionsWithReasons })) }) })] }));
|
|
19
19
|
}
|
|
20
|
-
exports.ListBoxSection = ListBoxSection;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListBoxToggleChip =
|
|
3
|
+
exports.ListBoxToggleChip = ListBoxToggleChip;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const components_1 = require("../../components");
|
|
6
6
|
const Css_1 = require("../../Css");
|
|
@@ -11,4 +11,3 @@ function ListBoxToggleChip(props) {
|
|
|
11
11
|
state.selectionManager.toggleSelection(String(getOptionValue(option)));
|
|
12
12
|
}, disabled: disabled }) }));
|
|
13
13
|
}
|
|
14
|
-
exports.ListBoxToggleChip = ListBoxToggleChip;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LoadingDots =
|
|
3
|
+
exports.LoadingDots = LoadingDots;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const Css_1 = require("../../Css");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
@@ -26,4 +26,3 @@ function LoadingDots({ contrast }) {
|
|
|
26
26
|
.addIn("&:after", Css_1.Css.rightPx(-12).add("animationDelay", "600ms").$).$,
|
|
27
27
|
} }) }));
|
|
28
28
|
}
|
|
29
|
-
exports.LoadingDots = LoadingDots;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuSearchField =
|
|
3
|
+
exports.MenuSearchField = MenuSearchField;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const textfield_1 = require("@react-aria/textfield");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -13,4 +13,3 @@ function MenuSearchField(props) {
|
|
|
13
13
|
const { labelProps, inputProps } = (0, textfield_1.useTextField)({ ...props }, inputRef);
|
|
14
14
|
return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { label: "", labelProps: labelProps, inputProps: inputProps, startAdornment: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "search" }), ...tid.search }));
|
|
15
15
|
}
|
|
16
|
-
exports.MenuSearchField = MenuSearchField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Option =
|
|
3
|
+
exports.Option = Option;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_aria_1 = require("react-aria");
|
|
@@ -42,4 +42,3 @@ function Option(props) {
|
|
|
42
42
|
: Css_1.Palette.White }) }))] })),
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
exports.Option = Option;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VirtualizedOptions =
|
|
3
|
+
exports.VirtualizedOptions = VirtualizedOptions;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_virtuoso_1 = require("react-virtuoso");
|
|
@@ -58,4 +58,3 @@ function VirtualizedOptions(props) {
|
|
|
58
58
|
Footer: typeof loading === "function" ? loading : () => (0, jsx_runtime_1.jsx)(LoadingDots_1.LoadingDots, { contrast: contrast }),
|
|
59
59
|
} }));
|
|
60
60
|
}
|
|
61
|
-
exports.VirtualizedOptions = VirtualizedOptions;
|
package/dist/inputs/utils.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFieldWidth =
|
|
3
|
+
exports.getFieldWidth = getFieldWidth;
|
|
4
4
|
function getFieldWidth(fullWidth) {
|
|
5
5
|
return fullWidth ? "100%" : "550px";
|
|
6
6
|
}
|
|
7
|
-
exports.getFieldWidth = getFieldWidth;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultLabel =
|
|
3
|
+
exports.defaultLabel = defaultLabel;
|
|
4
4
|
const change_case_1 = require("change-case");
|
|
5
5
|
/**
|
|
6
6
|
* Guesses a label based on an `id`-ish string, i.e. even an id of
|
|
@@ -12,4 +12,3 @@ const change_case_1 = require("change-case");
|
|
|
12
12
|
function defaultLabel(id) {
|
|
13
13
|
return (0, change_case_1.capitalCase)(id).replace(/Ids?$/, "").trim();
|
|
14
14
|
}
|
|
15
|
-
exports.defaultLabel = defaultLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultTestId =
|
|
3
|
+
exports.defaultTestId = defaultTestId;
|
|
4
4
|
const change_case_1 = require("change-case");
|
|
5
5
|
/**
|
|
6
6
|
* Guesses an id based on a label string, i.e. given `Homeowner Contract`,
|
|
@@ -16,4 +16,3 @@ function defaultTestId(label) {
|
|
|
16
16
|
// means "the 4th element with a data-testid value of 'm'".
|
|
17
17
|
return (0, change_case_1.camelCase)(label.replace(":", ""));
|
|
18
18
|
}
|
|
19
|
-
exports.defaultTestId = defaultTestId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getButtonOrLink =
|
|
3
|
+
exports.getButtonOrLink = getButtonOrLink;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
6
6
|
const index_1 = require("./index");
|
|
@@ -12,4 +12,3 @@ onClick, attrs, openInNew = false, downloadLink = false) {
|
|
|
12
12
|
// Type `(e: PressEvent) => {}` is only used but Button.tsx, which passes the `onClick` prop as part of the `attrs`.
|
|
13
13
|
(0, jsx_runtime_1.jsx)("button", { onClick: onClick, ...attrs, children: content }));
|
|
14
14
|
}
|
|
15
|
-
exports.getButtonOrLink = getButtonOrLink;
|
package/dist/utils/index.js
CHANGED
|
@@ -14,11 +14,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.isAbsoluteUrl = exports.EmptyRef = exports.noop = exports.omitKey = void 0;
|
|
18
|
+
exports.fail = fail;
|
|
19
|
+
exports.toToggleState = toToggleState;
|
|
20
|
+
exports.toGroupState = toGroupState;
|
|
21
|
+
exports.maybeCall = maybeCall;
|
|
22
|
+
exports.safeKeys = safeKeys;
|
|
23
|
+
exports.safeEntries = safeEntries;
|
|
24
|
+
exports.areArraysEqual = areArraysEqual;
|
|
25
|
+
exports.isPromise = isPromise;
|
|
26
|
+
exports.isFunction = isFunction;
|
|
27
|
+
exports.isDefined = isDefined;
|
|
28
|
+
exports.pluralize = pluralize;
|
|
18
29
|
function fail(message) {
|
|
19
30
|
throw new Error(message || "Failed");
|
|
20
31
|
}
|
|
21
|
-
exports.fail = fail;
|
|
22
32
|
/** Adapts our state to what useToggleState returns in a stateless manner. */
|
|
23
33
|
function toToggleState(isSelected, onChange) {
|
|
24
34
|
return {
|
|
@@ -27,7 +37,6 @@ function toToggleState(isSelected, onChange) {
|
|
|
27
37
|
toggle: () => onChange(!isSelected),
|
|
28
38
|
};
|
|
29
39
|
}
|
|
30
|
-
exports.toToggleState = toToggleState;
|
|
31
40
|
/** Adapts our state to what use*Group returns in a stateless manner. */
|
|
32
41
|
function toGroupState(values, onChange) {
|
|
33
42
|
const addValue = (value) => onChange([...values, value]);
|
|
@@ -46,7 +55,6 @@ function toGroupState(values, onChange) {
|
|
|
46
55
|
validationState: "valid",
|
|
47
56
|
};
|
|
48
57
|
}
|
|
49
|
-
exports.toGroupState = toGroupState;
|
|
50
58
|
/**
|
|
51
59
|
* Utility to maybe call a function if undefined with arguments
|
|
52
60
|
*
|
|
@@ -58,13 +66,11 @@ exports.toGroupState = toGroupState;
|
|
|
58
66
|
function maybeCall(callback, ...args) {
|
|
59
67
|
return callback && callback(...args);
|
|
60
68
|
}
|
|
61
|
-
exports.maybeCall = maybeCall;
|
|
62
69
|
__exportStar(require("./useTestIds"), exports);
|
|
63
70
|
/** Casts `Object.keys` to "what it should be", as long as your instance doesn't have keys it shouldn't. */
|
|
64
71
|
function safeKeys(instance) {
|
|
65
72
|
return Object.getOwnPropertyNames(instance);
|
|
66
73
|
}
|
|
67
|
-
exports.safeKeys = safeKeys;
|
|
68
74
|
// Returns object with specified key removed
|
|
69
75
|
const omitKey = (key, { [key]: _, ...obj }) => obj;
|
|
70
76
|
exports.omitKey = omitKey;
|
|
@@ -73,7 +79,6 @@ exports.noop = noop;
|
|
|
73
79
|
function safeEntries(obj) {
|
|
74
80
|
return Object.entries(obj);
|
|
75
81
|
}
|
|
76
|
-
exports.safeEntries = safeEntries;
|
|
77
82
|
class EmptyRef {
|
|
78
83
|
get current() {
|
|
79
84
|
throw new Error("BeamProvider is missing");
|
|
@@ -88,22 +93,17 @@ exports.isAbsoluteUrl = isAbsoluteUrl;
|
|
|
88
93
|
function areArraysEqual(a, b) {
|
|
89
94
|
return a.length === b.length && a.every((val, idx) => val === b[idx]);
|
|
90
95
|
}
|
|
91
|
-
exports.areArraysEqual = areArraysEqual;
|
|
92
96
|
function isPromise(obj) {
|
|
93
97
|
return typeof obj === "object" && "then" in obj && typeof obj.then === "function";
|
|
94
98
|
}
|
|
95
|
-
exports.isPromise = isPromise;
|
|
96
99
|
function isFunction(f) {
|
|
97
100
|
return typeof f === "function";
|
|
98
101
|
}
|
|
99
|
-
exports.isFunction = isFunction;
|
|
100
102
|
function isDefined(param) {
|
|
101
103
|
return param !== null && param !== undefined;
|
|
102
104
|
}
|
|
103
|
-
exports.isDefined = isDefined;
|
|
104
105
|
function pluralize(count, noun, pluralNoun) {
|
|
105
106
|
if ((Array.isArray(count) ? count.length : count) === 1)
|
|
106
107
|
return noun;
|
|
107
108
|
return pluralNoun || `${noun}s`;
|
|
108
109
|
}
|
|
109
|
-
exports.pluralize = pluralize;
|
package/dist/utils/options.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defaultOptionValue = defaultOptionValue;
|
|
4
|
+
exports.defaultOptionLabel = defaultOptionLabel;
|
|
4
5
|
const utils_1 = require("./");
|
|
5
6
|
// This `any` is currently on purpose to ignore type errors in ChipSelectField
|
|
6
7
|
function defaultOptionValue(opt) {
|
|
@@ -9,7 +10,6 @@ function defaultOptionValue(opt) {
|
|
|
9
10
|
// Use `in` because returning undefined is fine
|
|
10
11
|
return "id" in opt ? opt.id : "code" in opt ? opt.code : (0, utils_1.fail)(`Option ${JSON.stringify(opt)} has no id or code`);
|
|
11
12
|
}
|
|
12
|
-
exports.defaultOptionValue = defaultOptionValue;
|
|
13
13
|
function defaultOptionLabel(opt) {
|
|
14
14
|
if (typeof opt !== "object" || !opt)
|
|
15
15
|
(0, utils_1.fail)(`Option ${opt} has no id or code`);
|
|
@@ -22,4 +22,3 @@ function defaultOptionLabel(opt) {
|
|
|
22
22
|
? opt.label
|
|
23
23
|
: (0, utils_1.fail)(`Option ${JSON.stringify(opt)} has no displayName, label, or name`);
|
|
24
24
|
}
|
|
25
|
-
exports.defaultOptionLabel = defaultOptionLabel;
|
package/dist/utils/rtl.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { newLocation as _newLocation, withRouter as _withRouter } from "@homebound/rtl-react-router-utils";
|
|
2
|
-
import { blur as _blur, change as _change, click as _click, clickAndWait as _clickAndWait, focus as _focus, getOptions as _getOptions, input as _input,
|
|
2
|
+
import { blur as _blur, change as _change, click as _click, clickAndWait as _clickAndWait, focus as _focus, getOptions as _getOptions, input as _input, select as _select, type as _type, typeAndWait as _typeAndWait, wait as _wait, RenderResult, Wrapper } from "@homebound/rtl-utils";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
|
-
export { _blur as blur, _change as change, _click as click, _clickAndWait as clickAndWait, _focus as focus,
|
|
5
|
-
export { _newLocation as newLocation, _withRouter as withRouter };
|
|
4
|
+
export { _blur as blur, _change as change, _click as click, _clickAndWait as clickAndWait, _focus as focus, _input as input, _newLocation as newLocation, _getOptions as rtlUtilGetOptions, _select as rtlUtilSelect, _type as type, _typeAndWait as typeAndWait, _wait as wait, _withRouter as withRouter, };
|
|
6
5
|
interface RenderOpts {
|
|
7
6
|
at?: {
|
|
8
7
|
url: string;
|