@lumx/vue 4.26.0-next.1 → 4.26.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/components/combobox/context/useComboboxEvent.d.ts +6 -5
- package/components/combobox/index.d.ts +18 -21
- package/components/combobox/useWrappedRenderOptionSlot.d.ts +1 -1
- package/components/listbox/ListboxList.d.ts +25 -0
- package/components/{combobox/ComboboxOption.d.ts → listbox/ListboxOption.d.ts} +5 -5
- package/components/listbox/ListboxOptionAction.d.ts +23 -0
- package/components/{combobox/ComboboxOptionMoreInfo.d.ts → listbox/ListboxOptionMoreInfo.d.ts} +9 -10
- package/components/{combobox/ComboboxSelectionIcon.d.ts → listbox/ListboxOptionSelectionIcon.d.ts} +3 -3
- package/components/listbox/ListboxOptionSkeleton.d.ts +14 -0
- package/components/listbox/ListboxProvider.d.ts +16 -0
- package/components/listbox/ListboxSection.d.ts +14 -0
- package/components/listbox/ListboxState.d.ts +14 -0
- package/components/listbox/context/ListboxContext.d.ts +25 -0
- package/components/{combobox/context/ComboboxOptionContext.d.ts → listbox/context/ListboxOptionContext.d.ts} +3 -3
- package/components/listbox/context/useListboxEvent.d.ts +13 -0
- package/components/listbox/index.d.ts +46 -0
- package/components/select-button/index.d.ts +1 -1
- package/components/select-text-field/SelectTextField.test.stories.d.ts +1 -1
- package/components/select-text-field/index.d.ts +4 -6
- package/index.js +6843 -6688
- package/index.js.map +1 -1
- package/package.json +4 -5
- package/components/combobox/ComboboxList.d.ts +0 -15
- package/components/combobox/ComboboxOptionAction.d.ts +0 -20
- package/components/combobox/ComboboxOptionSkeleton.d.ts +0 -14
- package/components/combobox/ComboboxSection.d.ts +0 -14
- package/components/combobox/ComboboxState.d.ts +0 -14
- package/components/combobox/context/ComboboxListContext.d.ts +0 -16
- /package/components/{combobox/ComboboxOption.test.d.ts → listbox/ListboxOption.test.d.ts} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { ListboxEventMap } from '@lumx/core/js/components/Listbox/types';
|
|
3
3
|
/**
|
|
4
|
-
* Composable to subscribe to a combobox event
|
|
4
|
+
* Composable to subscribe to a combobox event (`open`, `optionsChange`, `loadingChange`,
|
|
5
|
+
* `activeDescendantChange`, …). Must be used within a `Combobox.Provider`.
|
|
6
|
+
*
|
|
7
|
+
* The events are dispatched by the listbox handle of the combobox (see {@link useListboxEvent}).
|
|
5
8
|
*
|
|
6
9
|
* `optionsChange` updates are coalesced into a microtask. Mounting a large option list fires one
|
|
7
10
|
* `optionsChange` per option registration; applying each synchronously makes a consumer that both
|
|
@@ -11,7 +14,5 @@ import { ComboboxEventMap } from '@lumx/core/js/components/Combobox/types';
|
|
|
11
14
|
*
|
|
12
15
|
* (React does not need this: it batches synchronous store updates itself, and coalescing there
|
|
13
16
|
* would defer the update into a microtask that fires outside `act` in consumers' unit tests.)
|
|
14
|
-
*
|
|
15
|
-
* Re-subscribes when the handle changes (e.g. trigger mount/unmount).
|
|
16
17
|
*/
|
|
17
|
-
export declare function useComboboxEvent<K extends keyof
|
|
18
|
+
export declare function useComboboxEvent<K extends keyof ListboxEventMap>(event: K, initialValue: ListboxEventMap[K]): Ref<ListboxEventMap[K]>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
export type { ComboboxProviderProps } from './ComboboxProvider';
|
|
2
|
-
export type { ComboboxListProps } from './ComboboxList';
|
|
3
2
|
export type { ComboboxPopoverProps } from './ComboboxPopover';
|
|
4
3
|
export type { ComboboxButtonProps } from './ComboboxButton';
|
|
5
4
|
export type { ComboboxInputProps } from './ComboboxInput';
|
|
6
|
-
export type {
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
9
|
-
export type {
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
5
|
+
export type { ListboxListProps as ComboboxListProps } from '../listbox/ListboxList';
|
|
6
|
+
export type { ListboxOptionProps as ComboboxOptionProps } from '../listbox/ListboxOption';
|
|
7
|
+
export type { ListboxOptionActionProps as ComboboxOptionActionProps } from '../listbox/ListboxOptionAction';
|
|
8
|
+
export type { ListboxOptionMoreInfoProps as ComboboxOptionMoreInfoProps } from '../listbox/ListboxOptionMoreInfo';
|
|
9
|
+
export type { ListboxOptionSkeletonProps as ComboboxOptionSkeletonProps } from '../listbox/ListboxOptionSkeleton';
|
|
10
|
+
export type { ListboxSectionProps as ComboboxSectionProps } from '../listbox/ListboxSection';
|
|
11
|
+
export type { ListboxStateProps as ComboboxStateProps } from '../listbox/ListboxState';
|
|
12
12
|
export type { ComboboxButtonLabelDisplayMode } from '@lumx/core/js/components/Combobox/ComboboxButton';
|
|
13
|
-
export type { ComboboxListType } from '@lumx/core/js/components/
|
|
14
|
-
export type { ComboboxHandle, ComboboxCallbacks } from '@lumx/core/js/components/Combobox/types';
|
|
13
|
+
export type { ListboxListType as ComboboxListType } from '@lumx/core/js/components/Listbox/ListboxList';
|
|
15
14
|
/**
|
|
16
15
|
* Combobox compound component namespace.
|
|
17
16
|
*/
|
|
@@ -60,14 +59,14 @@ export declare const Combobox: {
|
|
|
60
59
|
onFocus?: ((_event?: FocusEvent | undefined) => any) | undefined;
|
|
61
60
|
onClear?: ((_event?: MouseEvent | undefined) => any) | undefined;
|
|
62
61
|
}, import('vue').PublicProps>;
|
|
63
|
-
/** Listbox container
|
|
64
|
-
List: import('vue').DefineSetupFnComponent<import('
|
|
62
|
+
/** Listbox container linked to the combobox trigger (must be rendered inside `Combobox.Provider`). */
|
|
63
|
+
List: import('vue').DefineSetupFnComponent<import('.').ComboboxListProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxList').ListboxListProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label" | "id" | "aria-busy" | "aria-multiselectable"> & {
|
|
65
64
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
66
65
|
} & {}, import('vue').PublicProps>;
|
|
67
66
|
/** Selectable option item with filtering and keyboard navigation support. */
|
|
68
|
-
Option: import('vue').DefineSetupFnComponent<import('
|
|
67
|
+
Option: import('vue').DefineSetupFnComponent<import('.').ComboboxOptionProps, {
|
|
69
68
|
click: () => boolean;
|
|
70
|
-
}, {}, Omit<import('@lumx/core/js/components/
|
|
69
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionPropsToOverride> & {
|
|
71
70
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
72
71
|
} & {
|
|
73
72
|
tooltipProps?: Partial<import('../tooltip').TooltipProps>;
|
|
@@ -76,21 +75,19 @@ export declare const Combobox: {
|
|
|
76
75
|
onClick?: (() => any) | undefined;
|
|
77
76
|
}, import('vue').PublicProps>;
|
|
78
77
|
/** Secondary action button within a grid-mode option row, rendered as an independent gridcell. */
|
|
79
|
-
OptionAction: import('vue').DefineSetupFnComponent<import('
|
|
78
|
+
OptionAction: import('vue').DefineSetupFnComponent<import('.').ComboboxOptionActionProps, {}, {}, Pick<import('../../utils/VueToJSX').VueToJSXProps<import('@lumx/core/js/components/Listbox/ListboxOptionAction').ListboxOptionActionProps>, "class" | "isDisabled"> & {
|
|
80
79
|
onClick?: (evt: MouseEvent) => void;
|
|
81
80
|
} & {}, import('vue').PublicProps>;
|
|
82
81
|
/** Info button on an option that shows a popover on hover or keyboard highlight. */
|
|
83
|
-
OptionMoreInfo: import('vue').DefineSetupFnComponent<import('
|
|
82
|
+
OptionMoreInfo: import('vue').DefineSetupFnComponent<import('.').ComboboxOptionMoreInfoProps, {
|
|
84
83
|
toggle: (isOpen: boolean) => boolean;
|
|
85
|
-
}, {}, Omit<import('@lumx/core/js/components/
|
|
84
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoProps, "className" | import('@lumx/core/js/types').PropsToOverride | "onMouseEnter" | "onMouseLeave" | "buttonProps" | import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoPropsToOverride> & {
|
|
86
85
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
87
|
-
} & {
|
|
88
|
-
onToggle?: (isOpen: boolean) => void;
|
|
89
86
|
} & {
|
|
90
87
|
onToggle?: ((isOpen: boolean) => any) | undefined;
|
|
91
88
|
}, import('vue').PublicProps>;
|
|
92
89
|
/** Loading placeholder skeleton(s) that auto-register loading state with the combobox handle. */
|
|
93
|
-
OptionSkeleton: import('vue').DefineSetupFnComponent<import('
|
|
90
|
+
OptionSkeleton: import('vue').DefineSetupFnComponent<import('.').ComboboxOptionSkeletonProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonProps, "className" | import('@lumx/core/js/types').PropsToOverride | import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonPropsToOverride> & {
|
|
94
91
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
95
92
|
} & {}, import('vue').PublicProps>;
|
|
96
93
|
/** Selection state icon (check circle / radio, or checkbox in multiple lists) for the `after` slot of an option. Reads the option `isSelected` and the list `aria-multiselectable`. */
|
|
@@ -100,11 +97,11 @@ export declare const Combobox: {
|
|
|
100
97
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
101
98
|
} & Partial<Omit<import('../popover').PopoverProps, "isOpen" | "class" | "onClose" | "anchorRef">> & {}, import('vue').PublicProps>;
|
|
102
99
|
/** Labelled group of options that auto-hides when all its child options are filtered out. */
|
|
103
|
-
Section: import('vue').DefineSetupFnComponent<import('
|
|
100
|
+
Section: import('vue').DefineSetupFnComponent<import('.').ComboboxSectionProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxSection').ListboxSectionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-hidden" | "hidden"> & {
|
|
104
101
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
105
102
|
} & {}, import('vue').PublicProps>;
|
|
106
103
|
/** Displays empty, error, and loading state messages for the combobox list. */
|
|
107
|
-
State: import('vue').DefineSetupFnComponent<import('
|
|
104
|
+
State: import('vue').DefineSetupFnComponent<import('.').ComboboxStateProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxState').ListboxStateProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
108
105
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
109
106
|
} & {}, import('vue').PublicProps>;
|
|
110
107
|
/** Visual separator between option groups (alias for ListDivider). Purely decorative — invisible to screen readers. */
|
|
@@ -4,7 +4,7 @@ import { RenderOptionContext } from '@lumx/core/js/utils/select/types';
|
|
|
4
4
|
/** Render function passed as `renderOption` to a core Select* template. */
|
|
5
5
|
type WrappedRenderOption = (option: unknown, context: RenderOptionContext) => JSXElement;
|
|
6
6
|
/**
|
|
7
|
-
* Adapts a Vue scoped slot returning a `<
|
|
7
|
+
* Adapts a Vue scoped slot returning a `<ListboxOption>` into the `renderOption`
|
|
8
8
|
* callback shape expected by the core Select* templates.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useWrappedRenderOptionSlot(slot: Slot | undefined): ComputedRef<WrappedRenderOption | undefined>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ListboxListProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxList';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ListboxListProps = VueToJSXProps<UIProps, 'aria-label' | 'aria-busy' | 'aria-multiselectable' | 'id'>;
|
|
4
|
+
/**
|
|
5
|
+
* List component (`Combobox.List` and `Listbox.List`): the WAI-ARIA listbox pattern by default (`role="listbox"` with
|
|
6
|
+
* `role="option"` items), or the grid pattern with `type="grid"` (`role="grid"` with one
|
|
7
|
+
* `role="row"` per option, made of the option `role="gridcell"` and its action cells).
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
10
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/grid/
|
|
11
|
+
*
|
|
12
|
+
* Mounts the listbox handle of the enclosing provider on its element:
|
|
13
|
+
* - Inside a combobox (`Combobox.Provider`): renders its options only while the combobox is open.
|
|
14
|
+
* The trigger owns focus.
|
|
15
|
+
* - Inside a `ListboxProvider`: a standalone list that owns focus (`tabindex="0"` +
|
|
16
|
+
* `aria-activedescendant`) and handles its own keyboard navigation.
|
|
17
|
+
*
|
|
18
|
+
* @param props Component props.
|
|
19
|
+
* @return Vue element.
|
|
20
|
+
*/
|
|
21
|
+
declare const ListboxList: import('vue').DefineSetupFnComponent<ListboxListProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label" | "id" | "aria-busy" | "aria-multiselectable"> & {
|
|
22
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
23
|
+
} & {}, import('vue').PublicProps>;
|
|
24
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
25
|
+
export default ListboxList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListboxOptionProps as UIProps, ListboxOptionPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxOption';
|
|
2
2
|
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
3
|
import { TooltipProps } from '../tooltip/Tooltip';
|
|
4
|
-
export type
|
|
4
|
+
export type ListboxOptionProps = VueToJSXProps<UIProps, ListboxOptionPropsToOverride | 'descriptionId' | 'hidden' | 'isGrid' | 'id'> & {
|
|
5
5
|
/** Props forwarded to a Tooltip wrapping the option trigger element. */
|
|
6
6
|
tooltipProps?: Partial<TooltipProps>;
|
|
7
7
|
/** Props forwarded to the inner action element (e.g. `{ as: 'a', href: '/foo' }`). */
|
|
@@ -16,9 +16,9 @@ export declare const emitSchema: {
|
|
|
16
16
|
* @param props Component props.
|
|
17
17
|
* @return Vue element.
|
|
18
18
|
*/
|
|
19
|
-
declare const
|
|
19
|
+
declare const ListboxOption: import('vue').DefineSetupFnComponent<ListboxOptionProps, {
|
|
20
20
|
click: () => boolean;
|
|
21
|
-
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" |
|
|
21
|
+
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | ListboxOptionPropsToOverride> & {
|
|
22
22
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
23
23
|
} & {
|
|
24
24
|
/** Props forwarded to a Tooltip wrapping the option trigger element. */
|
|
@@ -29,4 +29,4 @@ declare const ComboboxOption: import('vue').DefineSetupFnComponent<ComboboxOptio
|
|
|
29
29
|
onClick?: (() => any) | undefined;
|
|
30
30
|
}, import('vue').PublicProps>;
|
|
31
31
|
export { COMPONENT_NAME, CLASSNAME };
|
|
32
|
-
export default
|
|
32
|
+
export default ListboxOption;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ListboxOptionActionProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxOptionAction';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ListboxOptionActionProps = Pick<VueToJSXProps<UIProps>, 'isDisabled' | 'class'> & {
|
|
4
|
+
/** On click callback. */
|
|
5
|
+
onClick?: (evt: MouseEvent) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Combobox.OptionAction sub-component.
|
|
9
|
+
*
|
|
10
|
+
* Renders a secondary action button within a combobox option row (grid mode).
|
|
11
|
+
*
|
|
12
|
+
* Renders nothing outside grid mode (`type="grid"` on the parent list): without the grid
|
|
13
|
+
* navigation, an action would not be reachable by keyboard and would break the listbox pattern.
|
|
14
|
+
*
|
|
15
|
+
* @param props Component props.
|
|
16
|
+
* @return Vue element.
|
|
17
|
+
*/
|
|
18
|
+
declare const ListboxOptionAction: import('vue').DefineSetupFnComponent<ListboxOptionActionProps, {}, {}, Pick<VueToJSXProps<UIProps>, "class" | "isDisabled"> & {
|
|
19
|
+
/** On click callback. */
|
|
20
|
+
onClick?: (evt: MouseEvent) => void;
|
|
21
|
+
} & {}, import('vue').PublicProps>;
|
|
22
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
23
|
+
export default ListboxOptionAction;
|
package/components/{combobox/ComboboxOptionMoreInfo.d.ts → listbox/ListboxOptionMoreInfo.d.ts}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListboxOptionMoreInfoProps as UIProps, ListboxOptionMoreInfoPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxOptionMoreInfo';
|
|
2
2
|
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export type ListboxOptionMoreInfoProps = VueToJSXProps<UIProps, ListboxOptionMoreInfoPropsToOverride | 'onMouseEnter' | 'onMouseLeave' | 'buttonProps'>;
|
|
4
|
+
export declare const emitSchema: {
|
|
5
|
+
/** Fired when the popover opens or closes. */
|
|
6
|
+
toggle: (isOpen: boolean) => boolean;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* Combobox.OptionMoreInfo component.
|
|
@@ -15,15 +16,13 @@ export type ComboboxOptionMoreInfoProps = VueToJSXProps<UIProps, ComboboxOptionM
|
|
|
15
16
|
* @param props Component props.
|
|
16
17
|
* @return Vue element.
|
|
17
18
|
*/
|
|
18
|
-
declare const
|
|
19
|
+
declare const ListboxOptionMoreInfo: import('vue').DefineSetupFnComponent<ListboxOptionMoreInfoProps, {
|
|
20
|
+
/** Fired when the popover opens or closes. */
|
|
19
21
|
toggle: (isOpen: boolean) => boolean;
|
|
20
|
-
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "onMouseEnter" | "onMouseLeave" | "buttonProps" |
|
|
22
|
+
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "onMouseEnter" | "onMouseLeave" | "buttonProps" | ListboxOptionMoreInfoPropsToOverride> & {
|
|
21
23
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
22
|
-
} & {
|
|
23
|
-
/** Callback when the popover opens or closes. */
|
|
24
|
-
onToggle?: (isOpen: boolean) => void;
|
|
25
24
|
} & {
|
|
26
25
|
onToggle?: ((isOpen: boolean) => any) | undefined;
|
|
27
26
|
}, import('vue').PublicProps>;
|
|
28
27
|
export { COMPONENT_NAME, CLASSNAME };
|
|
29
|
-
export default
|
|
28
|
+
export default ListboxOptionMoreInfo;
|
package/components/{combobox/ComboboxSelectionIcon.d.ts → listbox/ListboxOptionSelectionIcon.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Combobox.SelectionIcon component.
|
|
2
|
+
* Combobox.SelectionIcon component (`Listbox.SelectionIcon`, re-exported by the combobox).
|
|
3
3
|
*
|
|
4
4
|
* Displays the selection state icon of an option (the same icon as in `SelectTextField` and `SelectButton`):
|
|
5
5
|
* - `single` list: a check circle icon when selected, a blank radio icon otherwise.
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @return Vue element.
|
|
12
12
|
*/
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
13
|
+
declare const ListboxOptionSelectionIcon: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
14
|
+
export default ListboxOptionSelectionIcon;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ListboxOptionSkeletonProps as UIProps, ListboxOptionSkeletonPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxOptionSkeleton';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ListboxOptionSkeletonProps = VueToJSXProps<UIProps, ListboxOptionSkeletonPropsToOverride>;
|
|
4
|
+
/**
|
|
5
|
+
* Combobox.OptionSkeleton component — renders skeleton placeholder(s) inside a combobox list.
|
|
6
|
+
*
|
|
7
|
+
* @param props Component props.
|
|
8
|
+
* @return Vue element.
|
|
9
|
+
*/
|
|
10
|
+
declare const ListboxOptionSkeleton: import('vue').DefineSetupFnComponent<ListboxOptionSkeletonProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | ListboxOptionSkeletonPropsToOverride> & {
|
|
11
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
12
|
+
} & {}, import('vue').PublicProps>;
|
|
13
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
14
|
+
export default ListboxOptionSkeleton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal standalone listbox provider.
|
|
3
|
+
*
|
|
4
|
+
* Creates the standalone listbox handle (the list owns focus) and shares it with the list,
|
|
5
|
+
* the options and the list state rendered inside.
|
|
6
|
+
*/
|
|
7
|
+
declare const ListboxProvider: import('vue').DefineSetupFnComponent<object, {
|
|
8
|
+
select: (option: {
|
|
9
|
+
value: string;
|
|
10
|
+
}) => true;
|
|
11
|
+
}, {}, object & {
|
|
12
|
+
onSelect?: ((option: {
|
|
13
|
+
value: string;
|
|
14
|
+
}) => any) | undefined;
|
|
15
|
+
}, import('vue').PublicProps>;
|
|
16
|
+
export default ListboxProvider;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ListboxSectionProps as UIProps, ListboxSectionPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxSection';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ListboxSectionProps = VueToJSXProps<UIProps, ListboxSectionPropsToOverride | 'hidden' | 'aria-hidden'>;
|
|
4
|
+
/**
|
|
5
|
+
* Combobox.Section component - groups Combobox.Option items under a labelled section.
|
|
6
|
+
*
|
|
7
|
+
* @param props Component props.
|
|
8
|
+
* @return Vue element.
|
|
9
|
+
*/
|
|
10
|
+
declare const ListboxSection: import('vue').DefineSetupFnComponent<ListboxSectionProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-hidden" | "hidden"> & {
|
|
11
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
12
|
+
} & {}, import('vue').PublicProps>;
|
|
13
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
14
|
+
export default ListboxSection;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ListboxStateProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Listbox/ListboxState';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ListboxStateProps = VueToJSXProps<UIProps, 'state'>;
|
|
4
|
+
/**
|
|
5
|
+
* Combobox.State component - displays empty and error states for the combobox list.
|
|
6
|
+
*
|
|
7
|
+
* @param props Component props.
|
|
8
|
+
* @return Vue element.
|
|
9
|
+
*/
|
|
10
|
+
declare const ListboxState: import('vue').DefineSetupFnComponent<ListboxStateProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
11
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
12
|
+
} & {}, import('vue').PublicProps>;
|
|
13
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
14
|
+
export default ListboxState;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ListboxHandle } from '@lumx/core/js/components/Listbox/types';
|
|
3
|
+
/**
|
|
4
|
+
* Context value shared by the listbox sub-components (list, options, sections, skeletons, state).
|
|
5
|
+
*
|
|
6
|
+
* Provided by `ListboxProvider` (standalone listbox) and by `Combobox.Provider` (listbox of a combobox),
|
|
7
|
+
* then re-provided by the list with its `type`.
|
|
8
|
+
*/
|
|
9
|
+
export interface ListboxContextValue {
|
|
10
|
+
/** The listbox handle (null inside a combobox until the trigger creates it). */
|
|
11
|
+
list: Readonly<Ref<ListboxHandle | null>>;
|
|
12
|
+
/** The ID of the listbox element. */
|
|
13
|
+
listboxId: string;
|
|
14
|
+
/** The pattern of the list. "grid" enables 2D keyboard navigation and action buttons on options. */
|
|
15
|
+
type: 'listbox' | 'grid';
|
|
16
|
+
/** The selection type of the list (from `aria-multiselectable`). Provided by the list. */
|
|
17
|
+
selectionType?: 'single' | 'multiple';
|
|
18
|
+
}
|
|
19
|
+
/** Provide the listbox context (see `ListboxProvider` and `Combobox.Provider`). */
|
|
20
|
+
export declare function provideListboxContext(value: ListboxContextValue): void;
|
|
21
|
+
/**
|
|
22
|
+
* Access the listbox context.
|
|
23
|
+
* @throws Error outside a `ListboxProvider` or a `Combobox.Provider`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useListboxContext(): ListboxContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Context value provided by Combobox.Option to its `after` slot children. */
|
|
2
|
-
export interface
|
|
2
|
+
export interface ListboxOptionContextValue {
|
|
3
3
|
/** The ID of the parent option element (matches the aria-activedescendant value when highlighted). */
|
|
4
4
|
optionId: string;
|
|
5
5
|
/** Whether the parent option is selected. */
|
|
@@ -8,11 +8,11 @@ export interface ComboboxOptionContextValue {
|
|
|
8
8
|
/**
|
|
9
9
|
* Provides the combobox option context.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function provideListboxOptionContext(value: ListboxOptionContextValue): void;
|
|
12
12
|
/**
|
|
13
13
|
* Hook to access the Combobox.Option context.
|
|
14
14
|
* Must be used within a Combobox.Option's `after` slot.
|
|
15
15
|
* @throws Error if used outside of a Combobox.Option.
|
|
16
16
|
* @returns The option context value.
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function useListboxOptionContext(): ListboxOptionContextValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ListboxEventMap, ListboxHandle } from '@lumx/core/js/components/Listbox/types';
|
|
3
|
+
/** Minimal event source shape of the listbox handle. */
|
|
4
|
+
export interface EventSource {
|
|
5
|
+
subscribe(event: string, callback: (value: unknown) => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Subscribe to an event of a listbox handle. Re-subscribes when the handle changes.
|
|
9
|
+
* `optionsChange` bursts are coalesced into a single deferred update.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useHandleEvent<V>(handle: Readonly<Ref<EventSource | null>>, event: string, initialValue: V): Ref<V>;
|
|
12
|
+
/** Subscribe to a listbox handle event. */
|
|
13
|
+
export declare function useListboxEvent<K extends keyof ListboxEventMap>(handle: Readonly<Ref<ListboxHandle | null>>, event: K, initialValue: ListboxEventMap[K]): Ref<ListboxEventMap[K]>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const Listbox: {
|
|
2
|
+
/** Standalone listbox provider (creates the listbox handle). */
|
|
3
|
+
Provider: import('vue').DefineSetupFnComponent<object, {
|
|
4
|
+
select: (option: {
|
|
5
|
+
value: string;
|
|
6
|
+
}) => true;
|
|
7
|
+
}, {}, object & {
|
|
8
|
+
onSelect?: ((option: {
|
|
9
|
+
value: string;
|
|
10
|
+
}) => any) | undefined;
|
|
11
|
+
}, import('vue').PublicProps>;
|
|
12
|
+
/** List (listbox pattern by default, grid pattern with `type="grid"` for options with actions). */
|
|
13
|
+
List: import('vue').DefineSetupFnComponent<import('./ListboxList').ListboxListProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxList').ListboxListProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label" | "id" | "aria-busy" | "aria-multiselectable"> & {
|
|
14
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
15
|
+
} & {}, import('vue').PublicProps>;
|
|
16
|
+
Option: import('vue').DefineSetupFnComponent<import('./ListboxOption').ListboxOptionProps, {
|
|
17
|
+
click: () => boolean;
|
|
18
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionPropsToOverride> & {
|
|
19
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
20
|
+
} & {
|
|
21
|
+
tooltipProps?: Partial<import('../tooltip').TooltipProps>;
|
|
22
|
+
actionProps?: Record<string, any>;
|
|
23
|
+
} & {
|
|
24
|
+
onClick?: (() => any) | undefined;
|
|
25
|
+
}, import('vue').PublicProps>;
|
|
26
|
+
OptionAction: import('vue').DefineSetupFnComponent<import('./ListboxOptionAction').ListboxOptionActionProps, {}, {}, Pick<import('../../utils/VueToJSX').VueToJSXProps<import('@lumx/core/js/components/Listbox/ListboxOptionAction').ListboxOptionActionProps>, "class" | "isDisabled"> & {
|
|
27
|
+
onClick?: (evt: MouseEvent) => void;
|
|
28
|
+
} & {}, import('vue').PublicProps>;
|
|
29
|
+
OptionMoreInfo: import('vue').DefineSetupFnComponent<import('./ListboxOptionMoreInfo').ListboxOptionMoreInfoProps, {
|
|
30
|
+
toggle: (isOpen: boolean) => boolean;
|
|
31
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoProps, "className" | import('@lumx/core/js/types').PropsToOverride | "onMouseEnter" | "onMouseLeave" | "buttonProps" | import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoPropsToOverride> & {
|
|
32
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
33
|
+
} & {
|
|
34
|
+
onToggle?: ((isOpen: boolean) => any) | undefined;
|
|
35
|
+
}, import('vue').PublicProps>;
|
|
36
|
+
OptionSkeleton: import('vue').DefineSetupFnComponent<import('./ListboxOptionSkeleton').ListboxOptionSkeletonProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonProps, "className" | import('@lumx/core/js/types').PropsToOverride | import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonPropsToOverride> & {
|
|
37
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
38
|
+
} & {}, import('vue').PublicProps>;
|
|
39
|
+
SelectionIcon: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
40
|
+
Section: import('vue').DefineSetupFnComponent<import('./ListboxSection').ListboxSectionProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxSection').ListboxSectionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-hidden" | "hidden"> & {
|
|
41
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
42
|
+
} & {}, import('vue').PublicProps>;
|
|
43
|
+
State: import('vue').DefineSetupFnComponent<import('./ListboxState').ListboxStateProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxState').ListboxStateProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
44
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
45
|
+
} & {}, import('vue').PublicProps>;
|
|
46
|
+
};
|
|
@@ -3,7 +3,7 @@ export type { SelectListStatus, SelectListStatus as SelectButtonStatus, SelectBu
|
|
|
3
3
|
/** Selectable option within the dropdown list. */
|
|
4
4
|
export declare const SelectButtonOption: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxOptionProps, {
|
|
5
5
|
click: () => boolean;
|
|
6
|
-
}, {}, Omit<import('@lumx/core/js/components/
|
|
6
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionPropsToOverride> & {
|
|
7
7
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
8
8
|
} & {
|
|
9
9
|
tooltipProps?: Partial<import('../tooltip').TooltipProps>;
|
|
@@ -25,7 +25,7 @@ export declare const MultiBlurResetsSearch: {
|
|
|
25
25
|
render: (args: any) => import("vue/jsx-runtime").JSX.Element;
|
|
26
26
|
play({ canvas }: any): Promise<void>;
|
|
27
27
|
};
|
|
28
|
-
/** Test infinite scroll loads more options when scrolling to the bottom */
|
|
28
|
+
/** Test infinite scroll loads more options (grouped in sections) when scrolling to the bottom */
|
|
29
29
|
export declare const WithInfiniteScroll: {
|
|
30
30
|
render: () => {
|
|
31
31
|
components: {
|
|
@@ -4,7 +4,7 @@ export type { SelectTextFieldTranslations } from '@lumx/core/js/utils/select/typ
|
|
|
4
4
|
/** Selectable option within the dropdown list. */
|
|
5
5
|
export declare const SelectTextFieldOption: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxOptionProps, {
|
|
6
6
|
click: () => boolean;
|
|
7
|
-
}, {}, Omit<import('@lumx/core/js/components/
|
|
7
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "id" | "hidden" | "descriptionId" | "isGrid" | import('@lumx/core/js/components/Listbox/ListboxOption').ListboxOptionPropsToOverride> & {
|
|
8
8
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
9
9
|
} & {
|
|
10
10
|
tooltipProps?: Partial<import('../tooltip').TooltipProps>;
|
|
@@ -13,21 +13,19 @@ export declare const SelectTextFieldOption: import('vue').DefineSetupFnComponent
|
|
|
13
13
|
onClick?: (() => any) | undefined;
|
|
14
14
|
}, import('vue').PublicProps>;
|
|
15
15
|
/** Labelled group of options. */
|
|
16
|
-
export declare const SelectTextFieldSection: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxSectionProps, {}, {}, Omit<import('@lumx/core/js/components/
|
|
16
|
+
export declare const SelectTextFieldSection: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxSectionProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxSection').ListboxSectionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-hidden" | "hidden"> & {
|
|
17
17
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
18
18
|
} & {}, import('vue').PublicProps>;
|
|
19
19
|
/** Info icon on an option that reveals a popover with additional details. */
|
|
20
20
|
export declare const SelectTextFieldOptionMoreInfo: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxOptionMoreInfoProps, {
|
|
21
21
|
toggle: (isOpen: boolean) => boolean;
|
|
22
|
-
}, {}, Omit<import('@lumx/core/js/components/
|
|
22
|
+
}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoProps, "className" | import('@lumx/core/js/types').PropsToOverride | "onMouseEnter" | "onMouseLeave" | "buttonProps" | import('@lumx/core/js/components/Listbox/ListboxOptionMoreInfo').ListboxOptionMoreInfoPropsToOverride> & {
|
|
23
23
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
24
|
-
} & {
|
|
25
|
-
onToggle?: (isOpen: boolean) => void;
|
|
26
24
|
} & {
|
|
27
25
|
onToggle?: ((isOpen: boolean) => any) | undefined;
|
|
28
26
|
}, import('vue').PublicProps>;
|
|
29
27
|
/** Skeleton loading placeholder for options being fetched. */
|
|
30
|
-
export declare const SelectTextFieldOptionSkeleton: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxOptionSkeletonProps, {}, {}, Omit<import('@lumx/core/js/components/
|
|
28
|
+
export declare const SelectTextFieldOptionSkeleton: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxOptionSkeletonProps, {}, {}, Omit<import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonProps, "className" | import('@lumx/core/js/types').PropsToOverride | import('@lumx/core/js/components/Listbox/ListboxOptionSkeleton').ListboxOptionSkeletonPropsToOverride> & {
|
|
31
29
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
32
30
|
} & {}, import('vue').PublicProps>;
|
|
33
31
|
/** Visual separator between option groups (alias for ListDivider). Purely decorative — invisible to screen readers. */
|