@lumx/react 4.15.0 → 4.15.1-alpha.1
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/index.d.ts +12 -12
- package/index.js +32 -23
- package/index.js.map +1 -1
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -4009,14 +4009,14 @@ declare const SelectMultipleField: React.FC<SelectMultipleProps>;
|
|
|
4009
4009
|
declare const SelectMultiple: Comp<SelectMultipleProps, HTMLDivElement>;
|
|
4010
4010
|
|
|
4011
4011
|
/**
|
|
4012
|
-
* Status of the
|
|
4012
|
+
* Status of the select dropdown list.
|
|
4013
4013
|
*
|
|
4014
4014
|
* - `'idle'` — Default state, no loading indicators.
|
|
4015
4015
|
* - `'loading'` — Full loading: shows skeleton placeholders, hides real options.
|
|
4016
4016
|
* - `'loadingMore'` — Paginated loading: appends a skeleton after existing options.
|
|
4017
4017
|
* - `'error'` — Error state: shows an error message in the dropdown.
|
|
4018
4018
|
*/
|
|
4019
|
-
type
|
|
4019
|
+
type SelectListStatus = 'idle' | 'loading' | 'loadingMore' | 'error';
|
|
4020
4020
|
/**
|
|
4021
4021
|
* Context passed to the `renderOption` callback alongside the option object.
|
|
4022
4022
|
* Contains core-computed values that the consumer should forward to `<Combobox.Option>`.
|
|
@@ -4061,13 +4061,13 @@ interface BaseSelectProps<O> {
|
|
|
4061
4061
|
* section id are grouped together. The id is also used as the default displayed
|
|
4062
4062
|
* label unless `renderSectionTitle` is provided.
|
|
4063
4063
|
*/
|
|
4064
|
-
getSectionId?: Selector<O, string>;
|
|
4064
|
+
getSectionId?: Selector<O, string | undefined>;
|
|
4065
4065
|
/**
|
|
4066
4066
|
* Custom section title render function. Receives the section id and the options
|
|
4067
4067
|
* in that section. Returns custom JSX to display as the section header.
|
|
4068
4068
|
* When not provided, the section id is used as a plain text label.
|
|
4069
4069
|
*/
|
|
4070
|
-
renderSectionTitle?: (sectionId: string, options: O[]) => JSXElement;
|
|
4070
|
+
renderSectionTitle?: (sectionId: string | undefined, options: O[]) => JSXElement;
|
|
4071
4071
|
}
|
|
4072
4072
|
/**
|
|
4073
4073
|
* Shared translation labels for SelectTextField wrappers (React and Vue).
|
|
@@ -4138,7 +4138,7 @@ interface BaseSelectTextFieldWrapperProps<O> extends Pick<BaseSelectProps<O>, 'o
|
|
|
4138
4138
|
* Status of the dropdown list.
|
|
4139
4139
|
* @default 'idle'
|
|
4140
4140
|
*/
|
|
4141
|
-
listStatus?:
|
|
4141
|
+
listStatus?: SelectListStatus;
|
|
4142
4142
|
/**
|
|
4143
4143
|
* Controls how the combobox filters options as the user types.
|
|
4144
4144
|
*
|
|
@@ -4246,7 +4246,7 @@ interface SelectButtonProps$1<O> extends BaseSelectProps<O> {
|
|
|
4246
4246
|
* - `'error'` — Error state: shows an error message in the dropdown.
|
|
4247
4247
|
* @default 'idle'
|
|
4248
4248
|
*/
|
|
4249
|
-
listStatus?:
|
|
4249
|
+
listStatus?: SelectListStatus;
|
|
4250
4250
|
/** Optional translations for screen-reader announcements (loading/empty/error/option count). */
|
|
4251
4251
|
translations?: SelectButtonTranslations;
|
|
4252
4252
|
/** Callback fired when the dropdown open state changes. */
|
|
@@ -4299,7 +4299,7 @@ type CommonSelectButtonProps<O> = SelectButtonSelectProps<O> & GenericProps$1 &
|
|
|
4299
4299
|
* Status of the dropdown list (loading, error, etc.).
|
|
4300
4300
|
* @default 'idle'
|
|
4301
4301
|
*/
|
|
4302
|
-
listStatus?:
|
|
4302
|
+
listStatus?: SelectListStatus;
|
|
4303
4303
|
/** Screen-reader translations (loading/empty/error/option count). */
|
|
4304
4304
|
translations?: SelectButtonTranslations;
|
|
4305
4305
|
};
|
|
@@ -4313,8 +4313,8 @@ type CommonSelectButtonProps<O> = SelectButtonSelectProps<O> & GenericProps$1 &
|
|
|
4313
4313
|
* fully replaced and only props valid for that component apply.
|
|
4314
4314
|
*
|
|
4315
4315
|
* Discriminated on `selectionType`:
|
|
4316
|
-
* - default / `'single'` → `value?: O`, `onChange?: (newValue
|
|
4317
|
-
* - `'multiple'` → `value?: O[]`, `onChange?: (newValue
|
|
4316
|
+
* - default / `'single'` → `value?: O`, `onChange?: (newValue: O) => void`.
|
|
4317
|
+
* - `'multiple'` → `value?: O[]`, `onChange?: (newValue: O[]) => void`.
|
|
4318
4318
|
*
|
|
4319
4319
|
* `as` and `selectionType` are top-level on this type (rather than buried in
|
|
4320
4320
|
* an intersection or union member) so that TS can infer `E` from `as` and
|
|
@@ -4338,7 +4338,7 @@ type SelectButtonProps<O, E extends ElementType$1 = typeof DefaultButton, S exte
|
|
|
4338
4338
|
/** Selected option(s). Shape depends on `selectionType`. */
|
|
4339
4339
|
value?: S extends 'multiple' ? O[] : O;
|
|
4340
4340
|
/** Called when the selection changes. Shape depends on `selectionType`. */
|
|
4341
|
-
onChange?: S extends 'multiple' ? (newValue
|
|
4341
|
+
onChange?: S extends 'multiple' ? (newValue: O[]) => void : (newValue: O) => void;
|
|
4342
4342
|
};
|
|
4343
4343
|
/**
|
|
4344
4344
|
* Single-selection props (`selectionType` defaults to `'single'`).
|
|
@@ -4371,7 +4371,7 @@ interface BaseSelectTextFieldProps<O = any> extends BaseSelectTextFieldWrapperPr
|
|
|
4371
4371
|
* in that section. Returns custom JSX to display as the section header.
|
|
4372
4372
|
* When not provided, the section id is used as a plain text label.
|
|
4373
4373
|
*/
|
|
4374
|
-
renderSectionTitle?: (sectionId: string, options: O[]) => React__default.ReactNode;
|
|
4374
|
+
renderSectionTitle?: (sectionId: string | undefined, options: O[]) => React__default.ReactNode;
|
|
4375
4375
|
/**
|
|
4376
4376
|
* Callback fired when the search input text changes.
|
|
4377
4377
|
* Independent of `filter`: both can be used together (e.g. client-side
|
|
@@ -5607,4 +5607,4 @@ declare const ThemeProvider: React__default.FC<{
|
|
|
5607
5607
|
declare function useTheme(): ThemeContextValue;
|
|
5608
5608
|
|
|
5609
5609
|
export { AlertDialog, Autocomplete, AutocompleteMultiple, Avatar, Badge, BadgeWrapper, Button, ButtonEmphasis, ButtonGroup, CLASSNAME$1 as CLASSNAME, COMPONENT_NAME$1 as COMPONENT_NAME, Checkbox, Chip, ChipGroup, Combobox, CommentBlock, CommentBlockVariant, DEFAULT_PROPS, DatePicker, DatePickerControlled, DatePickerField, Dialog, Divider, DragHandle, Dropdown, ExpansionPanel, Flag, FlexBox, GenericBlock, GenericBlockGapSize, Grid, GridColumn, GridItem, Heading, HeadingLevelProvider, Icon, IconButton, ImageBlock, ImageBlockCaptionPosition, ImageLightbox, InlineList, InputHelper, InputLabel, Lightbox, Link, LinkPreview, List, ListDivider, ListItem, ListSection, ListSubheader, Message, Mosaic, Navigation, Notification, Placement, Popover, PopoverDialog, PostBlock, Progress, ProgressCircular, ProgressLinear, ProgressTracker, ProgressTrackerProvider, ProgressTrackerStep, ProgressTrackerStepPanel, ProgressVariant, RadioButton, RadioGroup, RawInputText, RawInputTextarea, Select, SelectButton, SelectMultiple, SelectMultipleField, SelectTextField, SelectVariant, SelectionChipGroup, SideNavigation, SideNavigationItem, SkeletonCircle, SkeletonRectangle, SkeletonRectangleVariant, SkeletonTypography, Slider, Slides, Slideshow, SlideshowControls, SlideshowItem, Switch, CLASSNAME as TIME_PICKER_FIELD_CLASSNAME, COMPONENT_NAME as TIME_PICKER_FIELD_COMPONENT_NAME, Tab, TabList, TabListLayout, TabPanel, TabProvider, Table, TableBody, TableCell, TableCellVariant, TableCellVariant as TableCellVariantType, TableHeader, TableRow, Text, TextField, ThOrder, ThOrder as ThOrderType, ThemeProvider, Thumbnail, ThumbnailAspectRatio, ThumbnailObjectFit, ThumbnailVariant, TimePickerField, Toolbar, Tooltip, Uploader, UploaderVariant, UserBlock, clamp, useFocusPointStyle, useHeadingLevel, useTheme };
|
|
5610
|
-
export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ComboboxListProps, ComboboxOptionActionProps, ComboboxOptionMoreInfoProps, ComboboxOptionProps, ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ComboboxSectionProps, ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverProps, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectButtonTranslations, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
|
|
5610
|
+
export type { AlertDialogProps, AutocompleteMultipleProps, AutocompleteProps, AvatarProps, AvatarSize, BadgeProps, BadgeWrapperProps, BaseButtonProps, ButtonGroupProps, ButtonProps, ButtonSize, CheckboxProps, ChipGroupProps, ChipProps, ComboboxButtonProps, ComboboxInputProps, ComboboxListProps, ComboboxOptionActionProps, ComboboxOptionMoreInfoProps, ComboboxOptionProps, ComboboxOptionSkeletonProps, ComboboxPopoverComponentProps, ComboboxPopoverProps, ComboboxProviderProps, ComboboxSectionProps, ComboboxStateProps, CommentBlockProps, DatePickerControlledProps, DatePickerFieldProps, DatePickerProps, DialogProps, DialogSizes, DividerProps, DragHandleProps, DropdownProps, Elevation, ExpansionPanelProps, FlagProps, FlexBoxProps, FlexHorizontalAlignment, FlexVerticalAlignment, FocusPoint, GapSize, GenericBlockProps, GenericBlockSectionProps, GridColumnGapSize, GridColumnProps, GridItemProps, GridProps, HeadingLevelProviderProps, HeadingProps, IconButtonProps, IconProps, IconSizes, ImageBlockProps, ImageBlockSize, ImageLightboxProps, InlineListProps, InputHelperProps, InputLabelProps, LightboxProps, LinkPreviewProps, LinkProps, ListDividerProps, ListItemProps, ListItemSize, ListProps, ListSectionProps, ListSubheaderProps, MarginAutoAlignment, MessageProps, MosaicProps, MultipleSelectButtonProps, MultipleSelectTextFieldProps, NavigationProps, NotificationProps, Offset, PopoverDialogProps, PopoverProps, PostBlockProps, ProgressCircularProps, ProgressCircularSize, ProgressLinearProps, ProgressProps, ProgressTrackerProps, ProgressTrackerProviderProps, ProgressTrackerStepPanelProps, ProgressTrackerStepProps, RadioButtonProps, RadioGroupProps, RawInputTextProps, RawInputTextareaProps, SelectButtonProps, SelectListStatus as SelectButtonStatus, SelectButtonTranslations, SelectListStatus, SelectMultipleProps, SelectProps, SelectTextFieldProps, SelectListStatus as SelectTextFieldStatus, SelectTextFieldTranslations, SelectionChipGroupProps, SideNavigationItemProps, SideNavigationProps, SingleSelectButtonProps, SingleSelectTextFieldProps, SkeletonCircleProps, SkeletonRectangleProps, SkeletonTypographyProps, SliderProps, SlidesProps, SlideshowControlsProps, SlideshowItemProps, SlideshowProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabProviderProps, TableBodyProps, TableCellProps, TableHeaderProps, TableProps, TableRowProps, TextFieldProps, TextProps, ThumbnailProps, ThumbnailSize, TimePickerFieldProps, ToolbarProps, TooltipPlacement, TooltipProps, UploaderProps, UploaderSize, UserBlockProps, UserBlockSize };
|
package/index.js
CHANGED
|
@@ -7111,6 +7111,12 @@ function setupComboboxButton(button, callbacks) {
|
|
|
7111
7111
|
return true;
|
|
7112
7112
|
}
|
|
7113
7113
|
return false;
|
|
7114
|
+
case 'Escape':
|
|
7115
|
+
// Close if open; never clear selection (button-mode has no text input).
|
|
7116
|
+
if (combobox.isOpen) {
|
|
7117
|
+
combobox.setIsOpen(false);
|
|
7118
|
+
}
|
|
7119
|
+
return true;
|
|
7114
7120
|
default:
|
|
7115
7121
|
// Printable characters → typeahead.
|
|
7116
7122
|
if (isPrintableKey(event)) {
|
|
@@ -9157,6 +9163,7 @@ const Popover$1 = (props, {
|
|
|
9157
9163
|
[`position-${position}`]: Boolean(position),
|
|
9158
9164
|
'is-hidden': Boolean(isHidden)
|
|
9159
9165
|
})),
|
|
9166
|
+
"aria-hidden": isHidden ? 'true' : undefined,
|
|
9160
9167
|
style: isHidden ? undefined : popoverStyle,
|
|
9161
9168
|
"data-popper-placement": position,
|
|
9162
9169
|
children: [unmountSentinel, /*#__PURE__*/jsxs(ClickAwayProvider, {
|
|
@@ -16820,6 +16827,24 @@ function toggleSelection(options, getOptionId, currentValue, selectedOptionId, i
|
|
|
16820
16827
|
return updated;
|
|
16821
16828
|
}
|
|
16822
16829
|
|
|
16830
|
+
/**
|
|
16831
|
+
* Get the display name for a single option value.
|
|
16832
|
+
*
|
|
16833
|
+
* Resolves the option's display name by trying `getOptionName` first,
|
|
16834
|
+
* then falling back to `getOptionId`, returning `''` for nullish values.
|
|
16835
|
+
*/
|
|
16836
|
+
function getOptionDisplayName(value, getOptionName, getOptionId) {
|
|
16837
|
+
if (value === undefined || value === null) return '';
|
|
16838
|
+
if (getOptionName) {
|
|
16839
|
+
const name = getWithSelector(getOptionName, value);
|
|
16840
|
+
if (name != null) return String(name);
|
|
16841
|
+
}
|
|
16842
|
+
if (getOptionId) {
|
|
16843
|
+
return String(getWithSelector(getOptionId, value));
|
|
16844
|
+
}
|
|
16845
|
+
return '';
|
|
16846
|
+
}
|
|
16847
|
+
|
|
16823
16848
|
/**
|
|
16824
16849
|
* Render options as ComboboxOption elements.
|
|
16825
16850
|
* Framework-specific components are passed as a second argument.
|
|
@@ -16944,7 +16969,7 @@ const SelectButton$2 = (props, {
|
|
|
16944
16969
|
* each option to its name and join with `, `. Falsy entries (undefined, empty names)
|
|
16945
16970
|
* are filtered out so partial state still renders cleanly.
|
|
16946
16971
|
*/
|
|
16947
|
-
const displayValue = value != null ? castArray(value).map(v => v
|
|
16972
|
+
const displayValue = value != null ? castArray(value).map(v => getOptionDisplayName(v, getOptionName, getOptionId)).filter(Boolean).join(', ') : '';
|
|
16948
16973
|
return /*#__PURE__*/jsxs(Combobox.Provider, {
|
|
16949
16974
|
onOpen: onOpen,
|
|
16950
16975
|
children: [/*#__PURE__*/jsx(Combobox.Button, {
|
|
@@ -17073,8 +17098,8 @@ const DefaultButton = forwardRef((props, ref) => /*#__PURE__*/jsx(Button, {
|
|
|
17073
17098
|
* fully replaced and only props valid for that component apply.
|
|
17074
17099
|
*
|
|
17075
17100
|
* Discriminated on `selectionType`:
|
|
17076
|
-
* - default / `'single'` → `value?: O`, `onChange?: (newValue
|
|
17077
|
-
* - `'multiple'` → `value?: O[]`, `onChange?: (newValue
|
|
17101
|
+
* - default / `'single'` → `value?: O`, `onChange?: (newValue: O) => void`.
|
|
17102
|
+
* - `'multiple'` → `value?: O[]`, `onChange?: (newValue: O[]) => void`.
|
|
17078
17103
|
*
|
|
17079
17104
|
* `as` and `selectionType` are top-level on this type (rather than buried in
|
|
17080
17105
|
* an intersection or union member) so that TS can infer `E` from `as` and
|
|
@@ -17134,6 +17159,9 @@ const SelectButton$1 = React__default.forwardRef((props, ref) => {
|
|
|
17134
17159
|
const next = toggleSelection(options, getOptionId, value, selectedOption?.value, isMultiple);
|
|
17135
17160
|
onChange?.(next);
|
|
17136
17161
|
}, [getOptionId, isMultiple, onChange, options, value]);
|
|
17162
|
+
|
|
17163
|
+
// If as is defined and not the Button, render as, else render DefaultButton (with mdiMenuDown right icon)
|
|
17164
|
+
const buttonAs = as && as !== Button ? as : DefaultButton;
|
|
17137
17165
|
return SelectButton$2({
|
|
17138
17166
|
options,
|
|
17139
17167
|
getOptionId,
|
|
@@ -17146,10 +17174,9 @@ const SelectButton$1 = React__default.forwardRef((props, ref) => {
|
|
|
17146
17174
|
isMultiselectable: isMultiple,
|
|
17147
17175
|
label,
|
|
17148
17176
|
labelDisplayMode,
|
|
17149
|
-
// With no `as`, the default trigger adds the chevron.
|
|
17150
17177
|
buttonProps: {
|
|
17151
17178
|
...buttonProps,
|
|
17152
|
-
as:
|
|
17179
|
+
as: buttonAs,
|
|
17153
17180
|
ref
|
|
17154
17181
|
},
|
|
17155
17182
|
popoverProps,
|
|
@@ -17180,24 +17207,6 @@ const SelectButton = Object.assign(SelectButton$1, {
|
|
|
17180
17207
|
Option: ComboboxOption
|
|
17181
17208
|
});
|
|
17182
17209
|
|
|
17183
|
-
/**
|
|
17184
|
-
* Get the display name for a single option value.
|
|
17185
|
-
*
|
|
17186
|
-
* Resolves the option's display name by trying `getOptionName` first,
|
|
17187
|
-
* then falling back to `getOptionId`, returning `''` for nullish values.
|
|
17188
|
-
*/
|
|
17189
|
-
function getOptionDisplayName(value, getOptionName, getOptionId) {
|
|
17190
|
-
if (value === undefined || value === null) return '';
|
|
17191
|
-
if (getOptionName) {
|
|
17192
|
-
const name = getWithSelector(getOptionName, value);
|
|
17193
|
-
if (name != null) return String(name);
|
|
17194
|
-
}
|
|
17195
|
-
if (getOptionId) {
|
|
17196
|
-
return String(getWithSelector(getOptionId, value));
|
|
17197
|
-
}
|
|
17198
|
-
return '';
|
|
17199
|
-
}
|
|
17200
|
-
|
|
17201
17210
|
/**
|
|
17202
17211
|
* Component display name.
|
|
17203
17212
|
*/
|