@homebound/beam 2.387.1 → 2.388.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 +400 -302
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.js +420 -324
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ import { AriaButtonProps } from '@react-types/button';
|
|
|
9
9
|
import { Matcher, DateRange } from 'react-day-picker';
|
|
10
10
|
export { DateRange } from 'react-day-picker';
|
|
11
11
|
import { MenuTriggerState } from 'react-stately';
|
|
12
|
-
import { FieldState, ObjectState } from '@homebound/form-state';
|
|
12
|
+
import { FieldState, ListFieldState, ObjectState } from '@homebound/form-state';
|
|
13
13
|
import { NumberFieldAria } from '@react-aria/numberfield';
|
|
14
14
|
|
|
15
15
|
/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */
|
|
@@ -7349,6 +7349,21 @@ type BoundIconCardGroupFieldProps<V extends Value> = Omit<IconCardGroupProps<V>,
|
|
|
7349
7349
|
/** Wraps `IconCardGroup` and binds it to a form field. */
|
|
7350
7350
|
declare function BoundIconCardGroupField<V extends Value>(props: BoundIconCardGroupFieldProps<V>): _emotion_react_jsx_runtime.JSX.Element;
|
|
7351
7351
|
|
|
7352
|
+
type ListFieldKey<F> = {
|
|
7353
|
+
[K in keyof F]: F[K] extends (infer T)[] | null | undefined ? (T extends object ? K : never) : never;
|
|
7354
|
+
}[keyof F];
|
|
7355
|
+
type ListSubFields<F, K extends keyof F> = F[K] extends (infer T)[] | null | undefined ? T : never;
|
|
7356
|
+
type ListFieldConfig<F, K extends keyof F> = {
|
|
7357
|
+
name: string;
|
|
7358
|
+
onNew: (objectState: ListFieldState<ListSubFields<F, K>>) => void;
|
|
7359
|
+
rows: BoundFormInputConfig<ListSubFields<F, K>>;
|
|
7360
|
+
/** `onDelete` combined with `filterDeleted` specifies how to handle the deletion of a listField row.
|
|
7361
|
+
* it is passed the both the top-level `listFieldState` as well as the individual row/record `objectState`.
|
|
7362
|
+
* If left blank, the delete action menu will not be shown. */
|
|
7363
|
+
onDelete?: (listFieldState: ObjectState<F>[K], rowObjectState: ObjectState<ListSubFields<F, K>>) => void;
|
|
7364
|
+
filterDeleted?: (rowObjectState: ObjectState<ListSubFields<F, K>>) => boolean;
|
|
7365
|
+
};
|
|
7366
|
+
|
|
7352
7367
|
type BoundMultiLineSelectFieldProps<O, V extends Value> = Omit<MultiLineSelectFieldProps<O, V>, "values" | "onSelect" | "label"> & {
|
|
7353
7368
|
onSelect?: (values: V[], opts: O[]) => void;
|
|
7354
7369
|
field: FieldState<V[] | null | undefined>;
|
|
@@ -7490,12 +7505,17 @@ type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer
|
|
|
7490
7505
|
declare const reactNodePrefix = "reactNode";
|
|
7491
7506
|
type TReactNodePrefix<S extends string> = `${typeof reactNodePrefix}${CapitalizeFirstLetter<S>}`;
|
|
7492
7507
|
type CustomReactNodeKey = `${typeof reactNodePrefix}${string}`;
|
|
7508
|
+
type ReactNodeOrFn<F> = ReactNode | ((formState: ObjectState<F>) => ReactNode);
|
|
7509
|
+
declare const listFieldPrefix = "listField";
|
|
7510
|
+
type TListFieldPrefix<S extends string> = `${typeof listFieldPrefix}${CapitalizeFirstLetter<S>}`;
|
|
7493
7511
|
type BoundFormRowInputs<F> = Partial<{
|
|
7494
7512
|
[K in keyof F]: BoundFieldInputFn<F>;
|
|
7495
7513
|
} & {
|
|
7496
|
-
[K in CustomReactNodeKey]:
|
|
7514
|
+
[K in CustomReactNodeKey]: ReactNodeOrFn<F>;
|
|
7497
7515
|
} & {
|
|
7498
|
-
[K in keyof F as TReactNodePrefix<K & string>]:
|
|
7516
|
+
[K in keyof F as TReactNodePrefix<K & string>]: ReactNodeOrFn<F>;
|
|
7517
|
+
} & {
|
|
7518
|
+
[K in ListFieldKey<F> as TListFieldPrefix<K & string>]: ListFieldConfig<F, K>;
|
|
7499
7519
|
}>;
|
|
7500
7520
|
type BoundFormInputConfig<F> = BoundFormRowInputs<F>[];
|
|
7501
7521
|
type BoundFormProps<F> = {
|
|
@@ -7519,6 +7539,10 @@ type BoundFormProps<F> = {
|
|
|
7519
7539
|
* ```
|
|
7520
7540
|
*/
|
|
7521
7541
|
declare function BoundForm<F>(props: BoundFormProps<F>): _emotion_react_jsx_runtime.JSX.Element;
|
|
7542
|
+
declare function FormRow<F>({ row, formState }: {
|
|
7543
|
+
row: BoundFormRowInputs<F>;
|
|
7544
|
+
formState: ObjectState<F>;
|
|
7545
|
+
}): _emotion_react_jsx_runtime.JSX.Element;
|
|
7522
7546
|
/**
|
|
7523
7547
|
* These field component functions are thin wrappers around the `BoundFoo` components which omit
|
|
7524
7548
|
* certain props that the caller doesn't need to pass or we specifically want to restrict to drive UX consistency.
|
|
@@ -8156,4 +8180,4 @@ declare function useSessionStorage<T>(key: string, defaultValue: T): UseSessionS
|
|
|
8156
8180
|
*/
|
|
8157
8181
|
declare function defaultTestId(label: string): string;
|
|
8158
8182
|
|
|
8159
|
-
export { ASC, Accordion, AccordionList, type AccordionProps, type AccordionSize, AutoSaveIndicator, AutoSaveStatus, AutoSaveStatusContext, AutoSaveStatusProvider, Autocomplete, type AutocompleteProps, Avatar, AvatarButton, type AvatarButtonProps, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Banner, type BannerProps, type BannerTypes, BaseFilter, type BeamButtonProps, type BeamFocusableProps, BeamProvider, type BeamTextFieldProps, BoundCheckboxField, type BoundCheckboxFieldProps, BoundCheckboxGroupField, type BoundCheckboxGroupFieldProps, BoundChipSelectField, BoundDateField, type BoundDateFieldProps, BoundDateRangeField, type BoundDateRangeFieldProps, BoundForm, type BoundFormInputConfig, type BoundFormProps, BoundIconCardField, type BoundIconCardFieldProps, BoundIconCardGroupField, type BoundIconCardGroupFieldProps, BoundMultiLineSelectField, type BoundMultiLineSelectFieldProps, BoundMultiSelectField, type BoundMultiSelectFieldProps, BoundNumberField, type BoundNumberFieldProps, BoundRadioGroupField, type BoundRadioGroupFieldProps, BoundRichTextField, type BoundRichTextFieldProps, BoundSelectAndTextField, BoundSelectField, type BoundSelectFieldProps, BoundSwitchField, type BoundSwitchFieldProps, BoundTextAreaField, type BoundTextAreaFieldProps, BoundTextField, type BoundTextFieldProps, BoundToggleChipGroupField, type BoundToggleChipGroupFieldProps, BoundTreeSelectField, type BoundTreeSelectFieldProps, type Breakpoint, Breakpoints, Button, ButtonDatePicker, ButtonGroup, type ButtonGroupButton, type ButtonGroupProps, ButtonMenu, ButtonModal, type ButtonModalProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CheckFn, Checkbox, CheckboxGroup, type CheckboxGroupItemOption, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, ChipSelectField, type ChipSelectFieldProps, type ChipType, ChipTypes, type ChipValue, Chips, type ChipsProps, CollapseToggle, CollapsedContext, ConfirmCloseModal, Container, type ContentStack, Copy, Css, CssReset, DESC, DateField, type DateFieldMode, type DateFieldModeTuple, type DateFieldProps, type DateFilterValue, DateRangeField, type DateRangeFieldProps, type DateRangeFilterValue, type Direction, type DiscriminateUnion, type DividerMenuItemType, DnDGrid, DnDGridItemHandle, type DnDGridItemHandleProps, type DnDGridItemProps, type DnDGridProps, type DragData, EXPANDABLE_HEADER, EditColumnsButton, ErrorMessage, FieldGroup, type Filter, type FilterDefs, type FilterImpls, FilterModal, _Filters as Filters, type Font, FormDivider, FormHeading, type FormHeadingProps, FormLines, type FormLinesProps, FormPageLayout, type FormSectionConfig, type FormWidth, FullBleed, type GridCellAlignment, type GridCellContent, type GridColumn, type GridColumnWithId, type GridDataRow, type GridRowKind, type GridRowLookup, type GridSortConfig, type GridStyle, GridTable, type GridTableApi, type GridTableCollapseToggleProps, type GridTableDefaults, type GridTableProps, type GridTableScrollOptions, type GridTableXss, type GroupByHook, HB_QUIPS_FLAVOR, HB_QUIPS_MISSION, HEADER, type HasIdAndName, HbLoadingSpinner, HbSpinnerProvider, HelperText, Icon, IconButton, type IconButtonProps, IconCard, type IconCardProps, type IconKey, type IconMenuItemType, type IconProps, Icons, type IfAny, type ImageMenuItemType, type InfiniteScroll, type InputStylePalette, KEPT_GROUP, type Kinded, Loader, LoadingSkeleton, type LoadingSkeletonProps, type Margin, MaxLines, type MaxLinesProps, type MaybeFn, type MenuItem, type MenuSection, ModalBody, ModalFilterItem, ModalFooter, ModalHeader, type ModalProps, type ModalSize, MultiLineSelectField, type MultiLineSelectFieldProps, MultiSelectField, type MultiSelectFieldProps, NavLink, type NestedOption, type NestedOptionsOrLoad, NumberField, type NumberFieldProps, type NumberFieldType, type OffsetAndLimit, type OnRowDragEvent, type OnRowSelect, type Only, type OpenDetailOpts, type OpenInDrawerOpts, OpenModal, type OpenRightPaneOpts, type Optional, type Padding, type PageNumberAndSize, type PageSettings, Pagination, Palette, type Pin, type Placement, type PresentationFieldProps, PresentationProvider, PreventBrowserScroll, type Properties, type RadioFieldOption, RadioGroupField, type RadioGroupFieldProps, type RenderAs, type RenderCellFn, ResponsiveGrid, ResponsiveGridItem, type ResponsiveGridItemProps, type ResponsiveGridProps, RichTextField, RichTextFieldImpl, type RichTextFieldProps, RightPaneContext, RightPaneLayout, type RightPaneLayoutContextProps, RightPaneProvider, RightSidebar, type RightSidebarProps, type RouteTab, type RouteTabWithContent, Row, type RowStyle, type RowStyles, ScrollShadows, ScrollableContent, ScrollableParent, SelectField, type SelectFieldProps, SelectToggle, type SelectedState, type SidebarContentProps, type SimpleHeaderAndData, SortHeader, type SortOn, type SortState, StaticField, type Step, Stepper, type StepperProps, SubmitButton, type SubmitButtonProps, SuperDrawerContent, SuperDrawerHeader, SuperDrawerWidth, Switch, type SwitchProps, TOTALS, type Tab, TabContent, type TabWithContent, TableState, TableStateContext, Tabs, TabsWithContent, Tag, type TagType, type TestIds, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldApi, type TextFieldInternalProps, type TextFieldProps, type TextFieldXss, Toast, ToggleButton, type ToggleButtonProps, ToggleChip, ToggleChipGroup, type ToggleChipGroupProps, type ToggleChipProps, ToggleChips, type ToggleChipsProps, Tooltip, TreeSelectField, type TreeSelectFieldProps, type TriggerNoticeProps, type Typography, type UseModalHook, type UseQueryState, type UseRightPaneHook, type UseSnackbarHook, type UseSuperDrawerHook, type UseToastProps, type Value, type Xss, actionColumn, applyRowFn, assignDefaultColumnIds, booleanFilter, boundCheckboxField, boundCheckboxGroupField, boundDateField, boundDateRangeField, boundIconCardField, boundIconCardGroupField, boundMultiSelectField, boundMultilineSelectField, boundNumberField, boundRadioGroupField, boundRichTextField, boundSelectField, boundSwitchField, boundTextAreaField, boundTextField, boundToggleChipGroupField, boundTreeSelectField, calcColumnSizes, cardStyle, checkboxFilter, collapseColumn, column, condensedStyle, createRowLookup, dateColumn, dateFilter, dateFormats, dateRangeFilter, defaultPage, defaultRenderFn, defaultStyle, defaultTestId, dragHandleColumn, emptyCell, ensureClientSideSortValueIsSortable, filterTestIdPrefix, formatDate, formatDateRange, formatValue, generateColumnId, getAlignment, getDateFormat, getFirstOrLastCellCss, getJustification, getTableRefWidthStyles, getTableStyles, headerRenderFn, hoverStyles, iconButtonCircleStylesHover, iconButtonContrastStylesHover, iconButtonStylesHover, iconCardStylesHover, increment, insertAtIndex, isCursorBelowMidpoint, isGridCellContent, isJSX, isListBoxSection, isPersistentItem, isPersistentKey, isValidDate, loadArrayOrUndefined, matchesFilter, maybeApplyFunction, maybeInc, maybeTooltip, multiFilter, navLink, newMethodMissingProxy, nonKindGridColumnKeys, numberRangeFilter, numericColumn, parseDate, parseDateRange, persistentItemPrefix, pressedStyles, px, recursivelyGetContainingRow, reservedRowKinds, resolveTooltip, rowClickRenderFn, rowLinkRenderFn, scrollContainerBottomPadding, selectColumn, selectedStyles, setDefaultStyle, setGridTableDefaults, setRunningInJest, shouldSkipScrollTo, simpleDataRows, simpleHeader, singleFilter, sortFn, sortRows, switchFocusStyles, switchHoverStyles, switchSelectedHoverStyles, toContent, toLimitAndOffset, toPageNumberSize, toggleFilter, toggleFocusStyles, toggleHoverStyles, togglePressStyles, treeFilter, updateFilter, useAutoSaveStatus, useBreakpoint, useComputed, useDnDGridItem, type useDnDGridItemProps, useFilter, useGridTableApi, useGroupBy, useHover, useModal, usePersistedFilter, useQueryState, useResponsiveGrid, useResponsiveGridItem, type useResponsiveGridProps, useRightPane, useRightPaneContext, useScrollableParent, useSessionStorage, useSetupColumnSizes, useSnackbar, useSuperDrawer, useTestIds, useToast, useTreeSelectFieldProvider, visit, zIndices };
|
|
8183
|
+
export { ASC, Accordion, AccordionList, type AccordionProps, type AccordionSize, AutoSaveIndicator, AutoSaveStatus, AutoSaveStatusContext, AutoSaveStatusProvider, Autocomplete, type AutocompleteProps, Avatar, AvatarButton, type AvatarButtonProps, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Banner, type BannerProps, type BannerTypes, BaseFilter, type BeamButtonProps, type BeamFocusableProps, BeamProvider, type BeamTextFieldProps, BoundCheckboxField, type BoundCheckboxFieldProps, BoundCheckboxGroupField, type BoundCheckboxGroupFieldProps, BoundChipSelectField, BoundDateField, type BoundDateFieldProps, BoundDateRangeField, type BoundDateRangeFieldProps, BoundForm, type BoundFormInputConfig, type BoundFormProps, type BoundFormRowInputs, BoundIconCardField, type BoundIconCardFieldProps, BoundIconCardGroupField, type BoundIconCardGroupFieldProps, BoundMultiLineSelectField, type BoundMultiLineSelectFieldProps, BoundMultiSelectField, type BoundMultiSelectFieldProps, BoundNumberField, type BoundNumberFieldProps, BoundRadioGroupField, type BoundRadioGroupFieldProps, BoundRichTextField, type BoundRichTextFieldProps, BoundSelectAndTextField, BoundSelectField, type BoundSelectFieldProps, BoundSwitchField, type BoundSwitchFieldProps, BoundTextAreaField, type BoundTextAreaFieldProps, BoundTextField, type BoundTextFieldProps, BoundToggleChipGroupField, type BoundToggleChipGroupFieldProps, BoundTreeSelectField, type BoundTreeSelectFieldProps, type Breakpoint, Breakpoints, Button, ButtonDatePicker, ButtonGroup, type ButtonGroupButton, type ButtonGroupProps, ButtonMenu, ButtonModal, type ButtonModalProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CheckFn, Checkbox, CheckboxGroup, type CheckboxGroupItemOption, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, ChipSelectField, type ChipSelectFieldProps, type ChipType, ChipTypes, type ChipValue, Chips, type ChipsProps, CollapseToggle, CollapsedContext, ConfirmCloseModal, Container, type ContentStack, Copy, Css, CssReset, DESC, DateField, type DateFieldMode, type DateFieldModeTuple, type DateFieldProps, type DateFilterValue, DateRangeField, type DateRangeFieldProps, type DateRangeFilterValue, type Direction, type DiscriminateUnion, type DividerMenuItemType, DnDGrid, DnDGridItemHandle, type DnDGridItemHandleProps, type DnDGridItemProps, type DnDGridProps, type DragData, EXPANDABLE_HEADER, EditColumnsButton, ErrorMessage, FieldGroup, type Filter, type FilterDefs, type FilterImpls, FilterModal, _Filters as Filters, type Font, FormDivider, FormHeading, type FormHeadingProps, FormLines, type FormLinesProps, FormPageLayout, FormRow, type FormSectionConfig, type FormWidth, FullBleed, type GridCellAlignment, type GridCellContent, type GridColumn, type GridColumnWithId, type GridDataRow, type GridRowKind, type GridRowLookup, type GridSortConfig, type GridStyle, GridTable, type GridTableApi, type GridTableCollapseToggleProps, type GridTableDefaults, type GridTableProps, type GridTableScrollOptions, type GridTableXss, type GroupByHook, HB_QUIPS_FLAVOR, HB_QUIPS_MISSION, HEADER, type HasIdAndName, HbLoadingSpinner, HbSpinnerProvider, HelperText, Icon, IconButton, type IconButtonProps, IconCard, type IconCardProps, type IconKey, type IconMenuItemType, type IconProps, Icons, type IfAny, type ImageMenuItemType, type InfiniteScroll, type InputStylePalette, KEPT_GROUP, type Kinded, Loader, LoadingSkeleton, type LoadingSkeletonProps, type Margin, MaxLines, type MaxLinesProps, type MaybeFn, type MenuItem, type MenuSection, ModalBody, ModalFilterItem, ModalFooter, ModalHeader, type ModalProps, type ModalSize, MultiLineSelectField, type MultiLineSelectFieldProps, MultiSelectField, type MultiSelectFieldProps, NavLink, type NestedOption, type NestedOptionsOrLoad, NumberField, type NumberFieldProps, type NumberFieldType, type OffsetAndLimit, type OnRowDragEvent, type OnRowSelect, type Only, type OpenDetailOpts, type OpenInDrawerOpts, OpenModal, type OpenRightPaneOpts, type Optional, type Padding, type PageNumberAndSize, type PageSettings, Pagination, Palette, type Pin, type Placement, type PresentationFieldProps, PresentationProvider, PreventBrowserScroll, type Properties, type RadioFieldOption, RadioGroupField, type RadioGroupFieldProps, type RenderAs, type RenderCellFn, ResponsiveGrid, ResponsiveGridItem, type ResponsiveGridItemProps, type ResponsiveGridProps, RichTextField, RichTextFieldImpl, type RichTextFieldProps, RightPaneContext, RightPaneLayout, type RightPaneLayoutContextProps, RightPaneProvider, RightSidebar, type RightSidebarProps, type RouteTab, type RouteTabWithContent, Row, type RowStyle, type RowStyles, ScrollShadows, ScrollableContent, ScrollableParent, SelectField, type SelectFieldProps, SelectToggle, type SelectedState, type SidebarContentProps, type SimpleHeaderAndData, SortHeader, type SortOn, type SortState, StaticField, type Step, Stepper, type StepperProps, SubmitButton, type SubmitButtonProps, SuperDrawerContent, SuperDrawerHeader, SuperDrawerWidth, Switch, type SwitchProps, TOTALS, type Tab, TabContent, type TabWithContent, TableState, TableStateContext, Tabs, TabsWithContent, Tag, type TagType, type TestIds, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldApi, type TextFieldInternalProps, type TextFieldProps, type TextFieldXss, Toast, ToggleButton, type ToggleButtonProps, ToggleChip, ToggleChipGroup, type ToggleChipGroupProps, type ToggleChipProps, ToggleChips, type ToggleChipsProps, Tooltip, TreeSelectField, type TreeSelectFieldProps, type TriggerNoticeProps, type Typography, type UseModalHook, type UseQueryState, type UseRightPaneHook, type UseSnackbarHook, type UseSuperDrawerHook, type UseToastProps, type Value, type Xss, actionColumn, applyRowFn, assignDefaultColumnIds, booleanFilter, boundCheckboxField, boundCheckboxGroupField, boundDateField, boundDateRangeField, boundIconCardField, boundIconCardGroupField, boundMultiSelectField, boundMultilineSelectField, boundNumberField, boundRadioGroupField, boundRichTextField, boundSelectField, boundSwitchField, boundTextAreaField, boundTextField, boundToggleChipGroupField, boundTreeSelectField, calcColumnSizes, cardStyle, checkboxFilter, collapseColumn, column, condensedStyle, createRowLookup, dateColumn, dateFilter, dateFormats, dateRangeFilter, defaultPage, defaultRenderFn, defaultStyle, defaultTestId, dragHandleColumn, emptyCell, ensureClientSideSortValueIsSortable, filterTestIdPrefix, formatDate, formatDateRange, formatValue, generateColumnId, getAlignment, getDateFormat, getFirstOrLastCellCss, getJustification, getTableRefWidthStyles, getTableStyles, headerRenderFn, hoverStyles, iconButtonCircleStylesHover, iconButtonContrastStylesHover, iconButtonStylesHover, iconCardStylesHover, increment, insertAtIndex, isCursorBelowMidpoint, isGridCellContent, isJSX, isListBoxSection, isPersistentItem, isPersistentKey, isValidDate, listFieldPrefix, loadArrayOrUndefined, matchesFilter, maybeApplyFunction, maybeInc, maybeTooltip, multiFilter, navLink, newMethodMissingProxy, nonKindGridColumnKeys, numberRangeFilter, numericColumn, parseDate, parseDateRange, persistentItemPrefix, pressedStyles, px, recursivelyGetContainingRow, reservedRowKinds, resolveTooltip, rowClickRenderFn, rowLinkRenderFn, scrollContainerBottomPadding, selectColumn, selectedStyles, setDefaultStyle, setGridTableDefaults, setRunningInJest, shouldSkipScrollTo, simpleDataRows, simpleHeader, singleFilter, sortFn, sortRows, switchFocusStyles, switchHoverStyles, switchSelectedHoverStyles, toContent, toLimitAndOffset, toPageNumberSize, toggleFilter, toggleFocusStyles, toggleHoverStyles, togglePressStyles, treeFilter, updateFilter, useAutoSaveStatus, useBreakpoint, useComputed, useDnDGridItem, type useDnDGridItemProps, useFilter, useGridTableApi, useGroupBy, useHover, useModal, usePersistedFilter, useQueryState, useResponsiveGrid, useResponsiveGridItem, type useResponsiveGridProps, useRightPane, useRightPaneContext, useScrollableParent, useSessionStorage, useSetupColumnSizes, useSnackbar, useSuperDrawer, useTestIds, useToast, useTreeSelectFieldProvider, visit, zIndices };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { AriaButtonProps } from '@react-types/button';
|
|
|
9
9
|
import { Matcher, DateRange } from 'react-day-picker';
|
|
10
10
|
export { DateRange } from 'react-day-picker';
|
|
11
11
|
import { MenuTriggerState } from 'react-stately';
|
|
12
|
-
import { FieldState, ObjectState } from '@homebound/form-state';
|
|
12
|
+
import { FieldState, ListFieldState, ObjectState } from '@homebound/form-state';
|
|
13
13
|
import { NumberFieldAria } from '@react-aria/numberfield';
|
|
14
14
|
|
|
15
15
|
/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */
|
|
@@ -7349,6 +7349,21 @@ type BoundIconCardGroupFieldProps<V extends Value> = Omit<IconCardGroupProps<V>,
|
|
|
7349
7349
|
/** Wraps `IconCardGroup` and binds it to a form field. */
|
|
7350
7350
|
declare function BoundIconCardGroupField<V extends Value>(props: BoundIconCardGroupFieldProps<V>): _emotion_react_jsx_runtime.JSX.Element;
|
|
7351
7351
|
|
|
7352
|
+
type ListFieldKey<F> = {
|
|
7353
|
+
[K in keyof F]: F[K] extends (infer T)[] | null | undefined ? (T extends object ? K : never) : never;
|
|
7354
|
+
}[keyof F];
|
|
7355
|
+
type ListSubFields<F, K extends keyof F> = F[K] extends (infer T)[] | null | undefined ? T : never;
|
|
7356
|
+
type ListFieldConfig<F, K extends keyof F> = {
|
|
7357
|
+
name: string;
|
|
7358
|
+
onNew: (objectState: ListFieldState<ListSubFields<F, K>>) => void;
|
|
7359
|
+
rows: BoundFormInputConfig<ListSubFields<F, K>>;
|
|
7360
|
+
/** `onDelete` combined with `filterDeleted` specifies how to handle the deletion of a listField row.
|
|
7361
|
+
* it is passed the both the top-level `listFieldState` as well as the individual row/record `objectState`.
|
|
7362
|
+
* If left blank, the delete action menu will not be shown. */
|
|
7363
|
+
onDelete?: (listFieldState: ObjectState<F>[K], rowObjectState: ObjectState<ListSubFields<F, K>>) => void;
|
|
7364
|
+
filterDeleted?: (rowObjectState: ObjectState<ListSubFields<F, K>>) => boolean;
|
|
7365
|
+
};
|
|
7366
|
+
|
|
7352
7367
|
type BoundMultiLineSelectFieldProps<O, V extends Value> = Omit<MultiLineSelectFieldProps<O, V>, "values" | "onSelect" | "label"> & {
|
|
7353
7368
|
onSelect?: (values: V[], opts: O[]) => void;
|
|
7354
7369
|
field: FieldState<V[] | null | undefined>;
|
|
@@ -7490,12 +7505,17 @@ type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer
|
|
|
7490
7505
|
declare const reactNodePrefix = "reactNode";
|
|
7491
7506
|
type TReactNodePrefix<S extends string> = `${typeof reactNodePrefix}${CapitalizeFirstLetter<S>}`;
|
|
7492
7507
|
type CustomReactNodeKey = `${typeof reactNodePrefix}${string}`;
|
|
7508
|
+
type ReactNodeOrFn<F> = ReactNode | ((formState: ObjectState<F>) => ReactNode);
|
|
7509
|
+
declare const listFieldPrefix = "listField";
|
|
7510
|
+
type TListFieldPrefix<S extends string> = `${typeof listFieldPrefix}${CapitalizeFirstLetter<S>}`;
|
|
7493
7511
|
type BoundFormRowInputs<F> = Partial<{
|
|
7494
7512
|
[K in keyof F]: BoundFieldInputFn<F>;
|
|
7495
7513
|
} & {
|
|
7496
|
-
[K in CustomReactNodeKey]:
|
|
7514
|
+
[K in CustomReactNodeKey]: ReactNodeOrFn<F>;
|
|
7497
7515
|
} & {
|
|
7498
|
-
[K in keyof F as TReactNodePrefix<K & string>]:
|
|
7516
|
+
[K in keyof F as TReactNodePrefix<K & string>]: ReactNodeOrFn<F>;
|
|
7517
|
+
} & {
|
|
7518
|
+
[K in ListFieldKey<F> as TListFieldPrefix<K & string>]: ListFieldConfig<F, K>;
|
|
7499
7519
|
}>;
|
|
7500
7520
|
type BoundFormInputConfig<F> = BoundFormRowInputs<F>[];
|
|
7501
7521
|
type BoundFormProps<F> = {
|
|
@@ -7519,6 +7539,10 @@ type BoundFormProps<F> = {
|
|
|
7519
7539
|
* ```
|
|
7520
7540
|
*/
|
|
7521
7541
|
declare function BoundForm<F>(props: BoundFormProps<F>): _emotion_react_jsx_runtime.JSX.Element;
|
|
7542
|
+
declare function FormRow<F>({ row, formState }: {
|
|
7543
|
+
row: BoundFormRowInputs<F>;
|
|
7544
|
+
formState: ObjectState<F>;
|
|
7545
|
+
}): _emotion_react_jsx_runtime.JSX.Element;
|
|
7522
7546
|
/**
|
|
7523
7547
|
* These field component functions are thin wrappers around the `BoundFoo` components which omit
|
|
7524
7548
|
* certain props that the caller doesn't need to pass or we specifically want to restrict to drive UX consistency.
|
|
@@ -8156,4 +8180,4 @@ declare function useSessionStorage<T>(key: string, defaultValue: T): UseSessionS
|
|
|
8156
8180
|
*/
|
|
8157
8181
|
declare function defaultTestId(label: string): string;
|
|
8158
8182
|
|
|
8159
|
-
export { ASC, Accordion, AccordionList, type AccordionProps, type AccordionSize, AutoSaveIndicator, AutoSaveStatus, AutoSaveStatusContext, AutoSaveStatusProvider, Autocomplete, type AutocompleteProps, Avatar, AvatarButton, type AvatarButtonProps, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Banner, type BannerProps, type BannerTypes, BaseFilter, type BeamButtonProps, type BeamFocusableProps, BeamProvider, type BeamTextFieldProps, BoundCheckboxField, type BoundCheckboxFieldProps, BoundCheckboxGroupField, type BoundCheckboxGroupFieldProps, BoundChipSelectField, BoundDateField, type BoundDateFieldProps, BoundDateRangeField, type BoundDateRangeFieldProps, BoundForm, type BoundFormInputConfig, type BoundFormProps, BoundIconCardField, type BoundIconCardFieldProps, BoundIconCardGroupField, type BoundIconCardGroupFieldProps, BoundMultiLineSelectField, type BoundMultiLineSelectFieldProps, BoundMultiSelectField, type BoundMultiSelectFieldProps, BoundNumberField, type BoundNumberFieldProps, BoundRadioGroupField, type BoundRadioGroupFieldProps, BoundRichTextField, type BoundRichTextFieldProps, BoundSelectAndTextField, BoundSelectField, type BoundSelectFieldProps, BoundSwitchField, type BoundSwitchFieldProps, BoundTextAreaField, type BoundTextAreaFieldProps, BoundTextField, type BoundTextFieldProps, BoundToggleChipGroupField, type BoundToggleChipGroupFieldProps, BoundTreeSelectField, type BoundTreeSelectFieldProps, type Breakpoint, Breakpoints, Button, ButtonDatePicker, ButtonGroup, type ButtonGroupButton, type ButtonGroupProps, ButtonMenu, ButtonModal, type ButtonModalProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CheckFn, Checkbox, CheckboxGroup, type CheckboxGroupItemOption, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, ChipSelectField, type ChipSelectFieldProps, type ChipType, ChipTypes, type ChipValue, Chips, type ChipsProps, CollapseToggle, CollapsedContext, ConfirmCloseModal, Container, type ContentStack, Copy, Css, CssReset, DESC, DateField, type DateFieldMode, type DateFieldModeTuple, type DateFieldProps, type DateFilterValue, DateRangeField, type DateRangeFieldProps, type DateRangeFilterValue, type Direction, type DiscriminateUnion, type DividerMenuItemType, DnDGrid, DnDGridItemHandle, type DnDGridItemHandleProps, type DnDGridItemProps, type DnDGridProps, type DragData, EXPANDABLE_HEADER, EditColumnsButton, ErrorMessage, FieldGroup, type Filter, type FilterDefs, type FilterImpls, FilterModal, _Filters as Filters, type Font, FormDivider, FormHeading, type FormHeadingProps, FormLines, type FormLinesProps, FormPageLayout, type FormSectionConfig, type FormWidth, FullBleed, type GridCellAlignment, type GridCellContent, type GridColumn, type GridColumnWithId, type GridDataRow, type GridRowKind, type GridRowLookup, type GridSortConfig, type GridStyle, GridTable, type GridTableApi, type GridTableCollapseToggleProps, type GridTableDefaults, type GridTableProps, type GridTableScrollOptions, type GridTableXss, type GroupByHook, HB_QUIPS_FLAVOR, HB_QUIPS_MISSION, HEADER, type HasIdAndName, HbLoadingSpinner, HbSpinnerProvider, HelperText, Icon, IconButton, type IconButtonProps, IconCard, type IconCardProps, type IconKey, type IconMenuItemType, type IconProps, Icons, type IfAny, type ImageMenuItemType, type InfiniteScroll, type InputStylePalette, KEPT_GROUP, type Kinded, Loader, LoadingSkeleton, type LoadingSkeletonProps, type Margin, MaxLines, type MaxLinesProps, type MaybeFn, type MenuItem, type MenuSection, ModalBody, ModalFilterItem, ModalFooter, ModalHeader, type ModalProps, type ModalSize, MultiLineSelectField, type MultiLineSelectFieldProps, MultiSelectField, type MultiSelectFieldProps, NavLink, type NestedOption, type NestedOptionsOrLoad, NumberField, type NumberFieldProps, type NumberFieldType, type OffsetAndLimit, type OnRowDragEvent, type OnRowSelect, type Only, type OpenDetailOpts, type OpenInDrawerOpts, OpenModal, type OpenRightPaneOpts, type Optional, type Padding, type PageNumberAndSize, type PageSettings, Pagination, Palette, type Pin, type Placement, type PresentationFieldProps, PresentationProvider, PreventBrowserScroll, type Properties, type RadioFieldOption, RadioGroupField, type RadioGroupFieldProps, type RenderAs, type RenderCellFn, ResponsiveGrid, ResponsiveGridItem, type ResponsiveGridItemProps, type ResponsiveGridProps, RichTextField, RichTextFieldImpl, type RichTextFieldProps, RightPaneContext, RightPaneLayout, type RightPaneLayoutContextProps, RightPaneProvider, RightSidebar, type RightSidebarProps, type RouteTab, type RouteTabWithContent, Row, type RowStyle, type RowStyles, ScrollShadows, ScrollableContent, ScrollableParent, SelectField, type SelectFieldProps, SelectToggle, type SelectedState, type SidebarContentProps, type SimpleHeaderAndData, SortHeader, type SortOn, type SortState, StaticField, type Step, Stepper, type StepperProps, SubmitButton, type SubmitButtonProps, SuperDrawerContent, SuperDrawerHeader, SuperDrawerWidth, Switch, type SwitchProps, TOTALS, type Tab, TabContent, type TabWithContent, TableState, TableStateContext, Tabs, TabsWithContent, Tag, type TagType, type TestIds, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldApi, type TextFieldInternalProps, type TextFieldProps, type TextFieldXss, Toast, ToggleButton, type ToggleButtonProps, ToggleChip, ToggleChipGroup, type ToggleChipGroupProps, type ToggleChipProps, ToggleChips, type ToggleChipsProps, Tooltip, TreeSelectField, type TreeSelectFieldProps, type TriggerNoticeProps, type Typography, type UseModalHook, type UseQueryState, type UseRightPaneHook, type UseSnackbarHook, type UseSuperDrawerHook, type UseToastProps, type Value, type Xss, actionColumn, applyRowFn, assignDefaultColumnIds, booleanFilter, boundCheckboxField, boundCheckboxGroupField, boundDateField, boundDateRangeField, boundIconCardField, boundIconCardGroupField, boundMultiSelectField, boundMultilineSelectField, boundNumberField, boundRadioGroupField, boundRichTextField, boundSelectField, boundSwitchField, boundTextAreaField, boundTextField, boundToggleChipGroupField, boundTreeSelectField, calcColumnSizes, cardStyle, checkboxFilter, collapseColumn, column, condensedStyle, createRowLookup, dateColumn, dateFilter, dateFormats, dateRangeFilter, defaultPage, defaultRenderFn, defaultStyle, defaultTestId, dragHandleColumn, emptyCell, ensureClientSideSortValueIsSortable, filterTestIdPrefix, formatDate, formatDateRange, formatValue, generateColumnId, getAlignment, getDateFormat, getFirstOrLastCellCss, getJustification, getTableRefWidthStyles, getTableStyles, headerRenderFn, hoverStyles, iconButtonCircleStylesHover, iconButtonContrastStylesHover, iconButtonStylesHover, iconCardStylesHover, increment, insertAtIndex, isCursorBelowMidpoint, isGridCellContent, isJSX, isListBoxSection, isPersistentItem, isPersistentKey, isValidDate, loadArrayOrUndefined, matchesFilter, maybeApplyFunction, maybeInc, maybeTooltip, multiFilter, navLink, newMethodMissingProxy, nonKindGridColumnKeys, numberRangeFilter, numericColumn, parseDate, parseDateRange, persistentItemPrefix, pressedStyles, px, recursivelyGetContainingRow, reservedRowKinds, resolveTooltip, rowClickRenderFn, rowLinkRenderFn, scrollContainerBottomPadding, selectColumn, selectedStyles, setDefaultStyle, setGridTableDefaults, setRunningInJest, shouldSkipScrollTo, simpleDataRows, simpleHeader, singleFilter, sortFn, sortRows, switchFocusStyles, switchHoverStyles, switchSelectedHoverStyles, toContent, toLimitAndOffset, toPageNumberSize, toggleFilter, toggleFocusStyles, toggleHoverStyles, togglePressStyles, treeFilter, updateFilter, useAutoSaveStatus, useBreakpoint, useComputed, useDnDGridItem, type useDnDGridItemProps, useFilter, useGridTableApi, useGroupBy, useHover, useModal, usePersistedFilter, useQueryState, useResponsiveGrid, useResponsiveGridItem, type useResponsiveGridProps, useRightPane, useRightPaneContext, useScrollableParent, useSessionStorage, useSetupColumnSizes, useSnackbar, useSuperDrawer, useTestIds, useToast, useTreeSelectFieldProvider, visit, zIndices };
|
|
8183
|
+
export { ASC, Accordion, AccordionList, type AccordionProps, type AccordionSize, AutoSaveIndicator, AutoSaveStatus, AutoSaveStatusContext, AutoSaveStatusProvider, Autocomplete, type AutocompleteProps, Avatar, AvatarButton, type AvatarButtonProps, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Banner, type BannerProps, type BannerTypes, BaseFilter, type BeamButtonProps, type BeamFocusableProps, BeamProvider, type BeamTextFieldProps, BoundCheckboxField, type BoundCheckboxFieldProps, BoundCheckboxGroupField, type BoundCheckboxGroupFieldProps, BoundChipSelectField, BoundDateField, type BoundDateFieldProps, BoundDateRangeField, type BoundDateRangeFieldProps, BoundForm, type BoundFormInputConfig, type BoundFormProps, type BoundFormRowInputs, BoundIconCardField, type BoundIconCardFieldProps, BoundIconCardGroupField, type BoundIconCardGroupFieldProps, BoundMultiLineSelectField, type BoundMultiLineSelectFieldProps, BoundMultiSelectField, type BoundMultiSelectFieldProps, BoundNumberField, type BoundNumberFieldProps, BoundRadioGroupField, type BoundRadioGroupFieldProps, BoundRichTextField, type BoundRichTextFieldProps, BoundSelectAndTextField, BoundSelectField, type BoundSelectFieldProps, BoundSwitchField, type BoundSwitchFieldProps, BoundTextAreaField, type BoundTextAreaFieldProps, BoundTextField, type BoundTextFieldProps, BoundToggleChipGroupField, type BoundToggleChipGroupFieldProps, BoundTreeSelectField, type BoundTreeSelectFieldProps, type Breakpoint, Breakpoints, Button, ButtonDatePicker, ButtonGroup, type ButtonGroupButton, type ButtonGroupProps, ButtonMenu, ButtonModal, type ButtonModalProps, type ButtonProps, type ButtonSize, type ButtonVariant, type CheckFn, Checkbox, CheckboxGroup, type CheckboxGroupItemOption, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, ChipSelectField, type ChipSelectFieldProps, type ChipType, ChipTypes, type ChipValue, Chips, type ChipsProps, CollapseToggle, CollapsedContext, ConfirmCloseModal, Container, type ContentStack, Copy, Css, CssReset, DESC, DateField, type DateFieldMode, type DateFieldModeTuple, type DateFieldProps, type DateFilterValue, DateRangeField, type DateRangeFieldProps, type DateRangeFilterValue, type Direction, type DiscriminateUnion, type DividerMenuItemType, DnDGrid, DnDGridItemHandle, type DnDGridItemHandleProps, type DnDGridItemProps, type DnDGridProps, type DragData, EXPANDABLE_HEADER, EditColumnsButton, ErrorMessage, FieldGroup, type Filter, type FilterDefs, type FilterImpls, FilterModal, _Filters as Filters, type Font, FormDivider, FormHeading, type FormHeadingProps, FormLines, type FormLinesProps, FormPageLayout, FormRow, type FormSectionConfig, type FormWidth, FullBleed, type GridCellAlignment, type GridCellContent, type GridColumn, type GridColumnWithId, type GridDataRow, type GridRowKind, type GridRowLookup, type GridSortConfig, type GridStyle, GridTable, type GridTableApi, type GridTableCollapseToggleProps, type GridTableDefaults, type GridTableProps, type GridTableScrollOptions, type GridTableXss, type GroupByHook, HB_QUIPS_FLAVOR, HB_QUIPS_MISSION, HEADER, type HasIdAndName, HbLoadingSpinner, HbSpinnerProvider, HelperText, Icon, IconButton, type IconButtonProps, IconCard, type IconCardProps, type IconKey, type IconMenuItemType, type IconProps, Icons, type IfAny, type ImageMenuItemType, type InfiniteScroll, type InputStylePalette, KEPT_GROUP, type Kinded, Loader, LoadingSkeleton, type LoadingSkeletonProps, type Margin, MaxLines, type MaxLinesProps, type MaybeFn, type MenuItem, type MenuSection, ModalBody, ModalFilterItem, ModalFooter, ModalHeader, type ModalProps, type ModalSize, MultiLineSelectField, type MultiLineSelectFieldProps, MultiSelectField, type MultiSelectFieldProps, NavLink, type NestedOption, type NestedOptionsOrLoad, NumberField, type NumberFieldProps, type NumberFieldType, type OffsetAndLimit, type OnRowDragEvent, type OnRowSelect, type Only, type OpenDetailOpts, type OpenInDrawerOpts, OpenModal, type OpenRightPaneOpts, type Optional, type Padding, type PageNumberAndSize, type PageSettings, Pagination, Palette, type Pin, type Placement, type PresentationFieldProps, PresentationProvider, PreventBrowserScroll, type Properties, type RadioFieldOption, RadioGroupField, type RadioGroupFieldProps, type RenderAs, type RenderCellFn, ResponsiveGrid, ResponsiveGridItem, type ResponsiveGridItemProps, type ResponsiveGridProps, RichTextField, RichTextFieldImpl, type RichTextFieldProps, RightPaneContext, RightPaneLayout, type RightPaneLayoutContextProps, RightPaneProvider, RightSidebar, type RightSidebarProps, type RouteTab, type RouteTabWithContent, Row, type RowStyle, type RowStyles, ScrollShadows, ScrollableContent, ScrollableParent, SelectField, type SelectFieldProps, SelectToggle, type SelectedState, type SidebarContentProps, type SimpleHeaderAndData, SortHeader, type SortOn, type SortState, StaticField, type Step, Stepper, type StepperProps, SubmitButton, type SubmitButtonProps, SuperDrawerContent, SuperDrawerHeader, SuperDrawerWidth, Switch, type SwitchProps, TOTALS, type Tab, TabContent, type TabWithContent, TableState, TableStateContext, Tabs, TabsWithContent, Tag, type TagType, type TestIds, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldApi, type TextFieldInternalProps, type TextFieldProps, type TextFieldXss, Toast, ToggleButton, type ToggleButtonProps, ToggleChip, ToggleChipGroup, type ToggleChipGroupProps, type ToggleChipProps, ToggleChips, type ToggleChipsProps, Tooltip, TreeSelectField, type TreeSelectFieldProps, type TriggerNoticeProps, type Typography, type UseModalHook, type UseQueryState, type UseRightPaneHook, type UseSnackbarHook, type UseSuperDrawerHook, type UseToastProps, type Value, type Xss, actionColumn, applyRowFn, assignDefaultColumnIds, booleanFilter, boundCheckboxField, boundCheckboxGroupField, boundDateField, boundDateRangeField, boundIconCardField, boundIconCardGroupField, boundMultiSelectField, boundMultilineSelectField, boundNumberField, boundRadioGroupField, boundRichTextField, boundSelectField, boundSwitchField, boundTextAreaField, boundTextField, boundToggleChipGroupField, boundTreeSelectField, calcColumnSizes, cardStyle, checkboxFilter, collapseColumn, column, condensedStyle, createRowLookup, dateColumn, dateFilter, dateFormats, dateRangeFilter, defaultPage, defaultRenderFn, defaultStyle, defaultTestId, dragHandleColumn, emptyCell, ensureClientSideSortValueIsSortable, filterTestIdPrefix, formatDate, formatDateRange, formatValue, generateColumnId, getAlignment, getDateFormat, getFirstOrLastCellCss, getJustification, getTableRefWidthStyles, getTableStyles, headerRenderFn, hoverStyles, iconButtonCircleStylesHover, iconButtonContrastStylesHover, iconButtonStylesHover, iconCardStylesHover, increment, insertAtIndex, isCursorBelowMidpoint, isGridCellContent, isJSX, isListBoxSection, isPersistentItem, isPersistentKey, isValidDate, listFieldPrefix, loadArrayOrUndefined, matchesFilter, maybeApplyFunction, maybeInc, maybeTooltip, multiFilter, navLink, newMethodMissingProxy, nonKindGridColumnKeys, numberRangeFilter, numericColumn, parseDate, parseDateRange, persistentItemPrefix, pressedStyles, px, recursivelyGetContainingRow, reservedRowKinds, resolveTooltip, rowClickRenderFn, rowLinkRenderFn, scrollContainerBottomPadding, selectColumn, selectedStyles, setDefaultStyle, setGridTableDefaults, setRunningInJest, shouldSkipScrollTo, simpleDataRows, simpleHeader, singleFilter, sortFn, sortRows, switchFocusStyles, switchHoverStyles, switchSelectedHoverStyles, toContent, toLimitAndOffset, toPageNumberSize, toggleFilter, toggleFocusStyles, toggleHoverStyles, togglePressStyles, treeFilter, updateFilter, useAutoSaveStatus, useBreakpoint, useComputed, useDnDGridItem, type useDnDGridItemProps, useFilter, useGridTableApi, useGroupBy, useHover, useModal, usePersistedFilter, useQueryState, useResponsiveGrid, useResponsiveGridItem, type useResponsiveGridProps, useRightPane, useRightPaneContext, useScrollableParent, useSessionStorage, useSetupColumnSizes, useSnackbar, useSuperDrawer, useTestIds, useToast, useTreeSelectFieldProvider, visit, zIndices };
|