@lumx/vue 4.27.0 → 4.27.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/components/combobox/context/useComboboxEvent.d.ts +4 -12
- package/components/combobox/index.d.ts +2 -2
- package/components/composite/CompositeContext.d.ts +33 -0
- package/components/composite/CompositeItemContext.d.ts +18 -0
- package/components/composite/CompositeStatus.d.ts +15 -0
- package/components/composite/useCompositeEvent.d.ts +9 -0
- package/components/listbox/context/useListboxHandle.d.ts +4 -0
- package/components/listbox/index.d.ts +1 -1
- package/index.js +3820 -3753
- package/index.js.map +1 -1
- package/package.json +9 -8
- package/components/listbox/ListboxState.d.ts +0 -14
- package/components/listbox/context/ListboxContext.d.ts +0 -25
- package/components/listbox/context/ListboxOptionContext.d.ts +0 -18
- package/components/listbox/context/useListboxEvent.d.ts +0 -13
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { CompositeEventMap } from '@lumx/core/js/components/Composite/types';
|
|
3
3
|
/**
|
|
4
4
|
* Composable to subscribe to a combobox event (`open`, `optionsChange`, `loadingChange`,
|
|
5
5
|
* `activeDescendantChange`, …). Must be used within a `Combobox.Provider`.
|
|
6
6
|
*
|
|
7
|
-
* The events are dispatched by the listbox handle of the combobox (see {@link
|
|
8
|
-
*
|
|
9
|
-
* `optionsChange` updates are coalesced into a microtask. Mounting a large option list fires one
|
|
10
|
-
* `optionsChange` per option registration; applying each synchronously makes a consumer that both
|
|
11
|
-
* reads the option count and (re)mounts options — e.g. `Combobox.Input` — mutate its own render
|
|
12
|
-
* dependency, tripping Vue's recursive-update guard. Coalescing applies only the final value, once
|
|
13
|
-
* per tick. Other events are applied synchronously.
|
|
14
|
-
*
|
|
15
|
-
* (React does not need this: it batches synchronous store updates itself, and coalescing there
|
|
16
|
-
* would defer the update into a microtask that fires outside `act` in consumers' unit tests.)
|
|
7
|
+
* The events are dispatched by the listbox handle of the combobox (see {@link useCompositeEvent}).
|
|
8
|
+
* `optionsChange` updates are coalesced (see `useCompositeEvent`).
|
|
17
9
|
*/
|
|
18
|
-
export declare function useComboboxEvent<K extends keyof
|
|
10
|
+
export declare function useComboboxEvent<K extends keyof CompositeEventMap>(event: K, initialValue: CompositeEventMap[K]): Ref<CompositeEventMap[K]>;
|
|
@@ -8,7 +8,7 @@ export type { ListboxOptionActionProps as ComboboxOptionActionProps } from '../l
|
|
|
8
8
|
export type { ListboxOptionMoreInfoProps as ComboboxOptionMoreInfoProps } from '../listbox/ListboxOptionMoreInfo';
|
|
9
9
|
export type { ListboxOptionSkeletonProps as ComboboxOptionSkeletonProps } from '../listbox/ListboxOptionSkeleton';
|
|
10
10
|
export type { ListboxSectionProps as ComboboxSectionProps } from '../listbox/ListboxSection';
|
|
11
|
-
export type {
|
|
11
|
+
export type { CompositeStatusProps as ComboboxStateProps } from '../composite/CompositeStatus';
|
|
12
12
|
export type { ComboboxButtonLabelDisplayMode } from '@lumx/core/js/components/Combobox/ComboboxButton';
|
|
13
13
|
export type { ListboxListType as ComboboxListType } from '@lumx/core/js/components/Listbox/ListboxList';
|
|
14
14
|
/**
|
|
@@ -101,7 +101,7 @@ export declare const Combobox: {
|
|
|
101
101
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
102
102
|
} & {}, import('vue').PublicProps>;
|
|
103
103
|
/** Displays empty, error, and loading state messages for the combobox list. */
|
|
104
|
-
State: import('vue').DefineSetupFnComponent<import('.').ComboboxStateProps, {}, {}, Omit<import('@lumx/core/js/components/
|
|
104
|
+
State: import('vue').DefineSetupFnComponent<import('.').ComboboxStateProps, {}, {}, Omit<import('@lumx/core/js/components/Composite/CompositeStatus').CompositeStatusProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
105
105
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
106
106
|
} & {}, import('vue').PublicProps>;
|
|
107
107
|
/** Visual separator between option groups (alias for ListDivider). Purely decorative — invisible to screen readers. */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { CompositeHandle, CompositeType } from '@lumx/core/js/components/Composite/types';
|
|
3
|
+
/**
|
|
4
|
+
* Context value shared by the sub-components of a composite widget (a list, a grid, …): the list,
|
|
5
|
+
* its items, sections, skeletons and state.
|
|
6
|
+
*
|
|
7
|
+
* Provided by `ListboxProvider` (standalone listbox) and by `Combobox.Provider` (listbox of a combobox),
|
|
8
|
+
* then re-provided by the list with its `type`.
|
|
9
|
+
*/
|
|
10
|
+
export interface CompositeContextValue {
|
|
11
|
+
/** The composite handle (null inside a combobox until the trigger creates it). */
|
|
12
|
+
handle: Readonly<Ref<CompositeHandle | null>>;
|
|
13
|
+
/** The ID of the composite element. */
|
|
14
|
+
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* The pattern of the list. "grid" enables 2D keyboard navigation and action buttons on options.
|
|
17
|
+
* Provided by the list element only: undefined above it (`ListboxProvider`, `Combobox.Provider`).
|
|
18
|
+
*/
|
|
19
|
+
type?: CompositeType;
|
|
20
|
+
/** The selection type of the list (from `aria-multiselectable`). Provided by the list. */
|
|
21
|
+
selectionType?: 'single' | 'multiple';
|
|
22
|
+
/** The nesting level of the items (0 or undefined: root items). A skeleton is nested when it is above 0. */
|
|
23
|
+
level?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Provide the composite context (see `ListboxProvider` and `Combobox.Provider`). */
|
|
26
|
+
export declare function provideCompositeContext(value: CompositeContextValue): void;
|
|
27
|
+
/** Access the composite context, or `undefined` outside of a composite widget (does not throw). */
|
|
28
|
+
export declare function useOptionalCompositeContext(): CompositeContextValue | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Access the composite context.
|
|
31
|
+
* @throws Error outside a `ListboxProvider` or a `Combobox.Provider`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useCompositeContext(): CompositeContextValue;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Context value provided by an item of a composite widget (a `Combobox.Option`) to its `after` slot children. */
|
|
2
|
+
export interface CompositeItemContextValue {
|
|
3
|
+
/** The ID of the item element (matches the aria-activedescendant value when highlighted). */
|
|
4
|
+
itemId: string;
|
|
5
|
+
/** Whether the item is selected. */
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provide the composite item context (see `Combobox.Option`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function provideCompositeItemContext(value: CompositeItemContextValue): void;
|
|
12
|
+
/**
|
|
13
|
+
* Access the composite item context.
|
|
14
|
+
* Must be used within a `Combobox.Option` `after` slot.
|
|
15
|
+
* @throws Error if used outside of a `Combobox.Option`.
|
|
16
|
+
* @returns The item context value.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useCompositeItemContext(): CompositeItemContextValue;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CompositeStatusProps as UIProps, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/Composite/CompositeStatus';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type CompositeStatusProps = VueToJSXProps<UIProps, 'state'>;
|
|
4
|
+
/**
|
|
5
|
+
* CompositeStatus: the live region of a composite (list, grid or tree), exposed as `Combobox.State` and
|
|
6
|
+
* `Listbox.State`. Displays the empty, loading, error and item count messages.
|
|
7
|
+
*
|
|
8
|
+
* @param props Component props.
|
|
9
|
+
* @return Vue element.
|
|
10
|
+
*/
|
|
11
|
+
declare const CompositeStatus: import('vue').DefineSetupFnComponent<CompositeStatusProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
12
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
13
|
+
} & {}, import('vue').PublicProps>;
|
|
14
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
15
|
+
export default CompositeStatus;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { CompositeEventMap, CompositeEventSource } from '@lumx/core/js/components/Composite/types';
|
|
3
|
+
/**
|
|
4
|
+
* Subscribe to an event of a handle (a composite handle). Re-subscribes when the handle changes, then starts from
|
|
5
|
+
* the new handle snapshot (or `initialValue` while there is no handle or until the event has fired at least once),
|
|
6
|
+
* so it never keeps the value of the previous handle. An `undefined` notification resets the value to
|
|
7
|
+
* `initialValue` the same way.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCompositeEvent<M extends CompositeEventMap, K extends keyof M>(handle: Readonly<Ref<CompositeEventSource<M> | null>>, event: K, initialValue: M[K]): Ref<M[K]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ListboxHandle } from '@lumx/core/js/components/Listbox/types';
|
|
3
|
+
/** The listbox handle of the composite context (null while there is none, or when it is not a listbox). */
|
|
4
|
+
export declare function useListboxHandle(): Readonly<Ref<ListboxHandle | null>>;
|
|
@@ -40,7 +40,7 @@ export declare const Listbox: {
|
|
|
40
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
41
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
42
42
|
} & {}, import('vue').PublicProps>;
|
|
43
|
-
State: import('vue').DefineSetupFnComponent<import('
|
|
43
|
+
State: import('vue').DefineSetupFnComponent<import('../combobox').ComboboxStateProps, {}, {}, Omit<import('@lumx/core/js/components/Composite/CompositeStatus').CompositeStatusProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "state"> & {
|
|
44
44
|
class?: import('../../utils/VueToJSX').ClassValue;
|
|
45
45
|
} & {}, import('vue').PublicProps>;
|
|
46
46
|
};
|