@lumx/vue 4.27.1-alpha.1 → 4.27.1-alpha.2

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.
@@ -13,6 +13,8 @@ export interface ComboboxProviderProps {
13
13
  *
14
14
  * Provides shared context to sub-components. The vanilla JS combobox handle is
15
15
  * created by the trigger sub-component (Combobox.Input or Combobox.Button) on mount.
16
+ * The list handle is created by the list component, which registers it on the combobox handle:
17
+ * the provider shares the registered list with the sub-components (composite context).
16
18
  *
17
19
  * @param props Component props.
18
20
  * @return Vue element.
@@ -21,3 +21,5 @@ export declare function provideComboboxContext(value: ComboboxContextValue): voi
21
21
  * @returns The combobox context value.
22
22
  */
23
23
  export declare function useComboboxContext(): ComboboxContextValue;
24
+ /** Access the Combobox context, or `undefined` outside of a Combobox (does not throw). */
25
+ export declare function useOptionalComboboxContext(): ComboboxContextValue | undefined;
@@ -1,10 +1,11 @@
1
1
  import { Ref } from 'vue';
2
- import { CompositeEventMap } from '@lumx/core/js/components/Composite/types';
2
+ import { ComboboxEventMap } from '@lumx/core/js/components/Combobox/types';
3
3
  /**
4
- * Composable to subscribe to a combobox event (`open`, `optionsChange`, `loadingChange`,
4
+ * Composable to subscribe to a combobox event (`open`, `expanded`, `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 useCompositeEvent}).
8
- * `optionsChange` updates are coalesced (see `useCompositeEvent`).
7
+ * The combobox handle owns the `open` and `expanded` events (even before a list registers) and forwards the other events
8
+ * from the registered list: it re-subscribes when the registered list changes and dispatches the snapshot of
9
+ * the new list (see `ComboboxEventMap`). `optionsChange` updates are coalesced (see `useCompositeEvent`).
9
10
  */
10
- export declare function useComboboxEvent<K extends keyof CompositeEventMap>(event: K, initialValue: CompositeEventMap[K]): Ref<CompositeEventMap[K]>;
11
+ export declare function useComboboxEvent<K extends keyof ComboboxEventMap>(event: K, initialValue: ComboboxEventMap[K]): Ref<ComboboxEventMap[K]>;
@@ -4,11 +4,12 @@ import { CompositeHandle, CompositeType } from '@lumx/core/js/components/Composi
4
4
  * Context value shared by the sub-components of a composite widget (a list, a grid, …): the list,
5
5
  * its items, sections, skeletons and state.
6
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`.
7
+ * Provided by `ListboxProvider` (standalone listbox) and by `Combobox.Provider` (the list registered on
8
+ * the combobox, with `comboboxListId`), then re-provided by the list with its `type` (and by a tree item with
9
+ * the next `level`), without `comboboxListId`.
9
10
  */
10
11
  export interface CompositeContextValue {
11
- /** The composite handle (null inside a combobox until the trigger creates it). */
12
+ /** The composite handle (null inside a combobox until a list registers). */
12
13
  handle: Readonly<Ref<CompositeHandle | null>>;
13
14
  /** The ID of the composite element. */
14
15
  id: string;
@@ -21,6 +22,13 @@ export interface CompositeContextValue {
21
22
  selectionType?: 'single' | 'multiple';
22
23
  /** The nesting level of the items (0 or undefined: root items). A skeleton is nested when it is above 0. */
23
24
  level?: number;
25
+ /**
26
+ * The ID of the list of the combobox (the trigger `aria-controls` it). Set by `Combobox.Provider` only: a list
27
+ * is the combobox list when its nearest composite context carries it. The list, its items and a nested
28
+ * `ListboxProvider` provide their own context without it, so a list rendered inside them is standalone.
29
+ * (At that level, it is the same value as `id`.)
30
+ */
31
+ comboboxListId?: string;
24
32
  }
25
33
  /** Provide the composite context (see `ListboxProvider` and `Combobox.Provider`). */
26
34
  export declare function provideCompositeContext(value: CompositeContextValue): void;
@@ -1,9 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { CompositeEventMap, CompositeEventSource } from '@lumx/core/js/components/Composite/types';
3
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.
4
+ * Subscribe to an event of a handle (a composite handle, or the combobox handle, which has the composite events and
5
+ * its own). Re-subscribes when the handle changes, then starts from the new handle snapshot (or `initialValue` while
6
+ * there is no handle or until the event has fired at least once), so it never keeps the value of the previous
7
+ * handle. An `undefined` notification (e.g. the combobox list detached) resets the value to `initialValue` the same
8
+ * way.
8
9
  */
9
10
  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,40 @@
1
+ import { Ref } from 'vue';
2
+ import { CompositeHandle, CompositeOptions } from '@lumx/core/js/components/Composite/types';
3
+ /** Options of {@link useCompositeList}. */
4
+ export interface UseCompositeListOptions<H extends CompositeHandle> {
5
+ /** The list element, mounted on the handle. */
6
+ elementRef: Readonly<Ref<HTMLElement | null>>;
7
+ /** Create the list handle (e.g. `setupListbox`): with the combobox list options, or as a standalone list. */
8
+ createList(options: CompositeOptions): H;
9
+ /**
10
+ * Standalone list: the handle of the list provider above the list (e.g. `ListboxProvider`). When undefined,
11
+ * the composable creates the standalone handle with `createList` (and destroys it on unmount).
12
+ */
13
+ standaloneHandle?: Readonly<Ref<H | null>>;
14
+ /** Standalone list created by the composable: called on a selection. */
15
+ onSelect?(option: {
16
+ value: string;
17
+ }): void;
18
+ }
19
+ /** Result of {@link useCompositeList}. */
20
+ export interface UseCompositeListResult<H extends CompositeHandle> {
21
+ /** The list handle (null inside a combobox until the trigger mounts). */
22
+ handle: Readonly<Ref<H | null>>;
23
+ /** The combobox list ID when the list is the combobox list (the trigger `aria-controls` it), else undefined. */
24
+ comboboxListId?: string;
25
+ /** Whether the items are visible (standalone: always; combobox: while open). */
26
+ isOpen: Readonly<Ref<boolean>>;
27
+ /** Whether root skeletons are registered (`aria-busy` on the list). */
28
+ isLoading: Readonly<Ref<boolean>>;
29
+ }
30
+ /**
31
+ * Set up the handle of a list component (e.g. `Combobox.List`, `Listbox.List`):
32
+ * - The list is the combobox list when its nearest composite context is the one of `Combobox.Provider` (it
33
+ * carries `comboboxListId`). Set on setup.
34
+ * - Combobox list: attach the handle (linked to the trigger) when the combobox handle exists, then detach it on
35
+ * unmount or when the combobox handle changes.
36
+ * - Standalone list: the handle of the list provider, or a handle created on setup.
37
+ * - Mount the list element on the handle.
38
+ * - Replay the pending keyboard navigation after the items render on open.
39
+ */
40
+ export declare function useCompositeList<H extends CompositeHandle>(options: UseCompositeListOptions<H>): UseCompositeListResult<H>;
@@ -9,11 +9,12 @@ export type ListboxListProps = VueToJSXProps<UIProps, 'aria-label' | 'aria-busy'
9
9
  * @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
10
10
  * @see https://www.w3.org/WAI/ARIA/apg/patterns/grid/
11
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.
12
+ * Mounts a listbox handle on its element:
13
+ * - Inside a combobox (`Combobox.Provider`): creates the listbox handle with the combobox list options and
14
+ * registers it on the combobox. Renders its options only while the combobox is open. The trigger owns focus.
15
15
  * - Inside a `ListboxProvider`: a standalone list that owns focus (`tabindex="0"` +
16
- * `aria-activedescendant`) and handles its own keyboard navigation.
16
+ * `aria-activedescendant`) and handles its own keyboard navigation. A `ListboxProvider` nested
17
+ * in a combobox wins (the list stays standalone and does not register on the combobox).
17
18
  *
18
19
  * @param props Component props.
19
20
  * @return Vue element.
@@ -0,0 +1,98 @@
1
+ import { TreeListProps as UIProps, COMPONENT_NAME, CLASSNAME, DEFAULT_PROPS } from '@lumx/core/js/components/TreeList/TreeList';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ /**
4
+ * Props common to the single and multiple selection trees.
5
+ * The ARIA attributes (`aria-label`, `aria-labelledby`) are read from the attributes.
6
+ */
7
+ type BaseTreeListProps = VueToJSXProps<UIProps, 'aria-label' | 'aria-labelledby' | 'aria-busy' | 'selectionType' | 'tabIndex'>;
8
+ /** Single selection tree props (`selectionType` defaults to `'single'`). */
9
+ export interface SingleTreeListProps extends BaseTreeListProps {
10
+ /** Selection type. Optional: defaults to `'single'`. */
11
+ selectionType?: 'single';
12
+ /** The value of the selected tree item (or `undefined` when nothing is selected). */
13
+ value?: string;
14
+ }
15
+ /** Multiple selection tree props (`selectionType: 'multiple'` is required to opt in). */
16
+ export interface MultipleTreeListProps extends BaseTreeListProps {
17
+ /** Selection type. */
18
+ selectionType: 'multiple';
19
+ /** The values of the selected tree items. */
20
+ value?: string[];
21
+ }
22
+ /**
23
+ * Props of the TreeList component. Discriminated on `selectionType`: with `'multiple'`, `value` (and the
24
+ * `change` payload) take arrays.
25
+ */
26
+ export type TreeListProps = SingleTreeListProps | MultipleTreeListProps;
27
+ export declare const emitSchema: {
28
+ /**
29
+ * On a selection of a selectable tree item (Enter, Space or a click), in a standalone tree only.
30
+ * In a combobox, the trigger `select` event (`Combobox.Input` or `Combobox.Button`) handles the selection.
31
+ */
32
+ select: (option: {
33
+ value: string;
34
+ }) => boolean;
35
+ /**
36
+ * Selection change, on every selection (in a combobox too). Payload: the selected value, or the toggled
37
+ * values with `selectionType="multiple"`.
38
+ */
39
+ change: (newValue: string | string[]) => boolean;
40
+ };
41
+ /**
42
+ * TreeList component: a list in the WAI-ARIA tree pattern (`role="tree"`), with `TreeListItem` (`TreeList.Item`) items.
43
+ * Use `Combobox.OptionSkeleton` and `Combobox.State` inside, as in a list.
44
+ *
45
+ * Selection: `value` holds the selected tree item value (or values with `selectionType="multiple"`), and
46
+ * the tree items read their selected state from it. `change` is emitted with the new value on every
47
+ * selection (in a combobox too): the selected value, or the toggled values with `selectionType="multiple"`.
48
+ *
49
+ * Adapts to its parent:
50
+ * - Inside a combobox (`Combobox.Provider`): the tree is the combobox list. The trigger owns focus, the
51
+ * popup opens and closes, and the tree items render only while it is open. The `id` prop is ignored
52
+ * (the tree takes the combobox list ID, used by the trigger `aria-controls`).
53
+ * - Otherwise, a standalone tree: the tree is its own focus owner (a single tab stop, `aria-activedescendant`
54
+ * on the tree), handles its own keyboard, and is always open. It has no filter. `select` is emitted on
55
+ * a selection.
56
+ *
57
+ * The parent is the nearest one: a tree rendered inside a list, an option or a tree item of a combobox
58
+ * (e.g. in a `Combobox.OptionMoreInfo` popover) is standalone. A tree rendered directly under a
59
+ * `Combobox.Provider` is the combobox list, even through a teleport (e.g. in a dialog opened from the
60
+ * combobox): render a standalone tree outside of the `Combobox.Provider`. The mode is set on setup.
61
+ *
62
+ * Keyboard and filter:
63
+ * - Up/Down move over the visible tree items, Right/Left open and close the parent items (or move to
64
+ * the first sub-item and to the parent item). Enter (or a click) selects a selectable tree item.
65
+ * - With `filter="auto"` on `Combobox.Input`, a tree item matches on its own label and description. The
66
+ * matching items, their ancestors (opened) and the descendants of a matching parent item stay visible.
67
+ * - With `filter="manual"`, the consumer renders the result: while the input text is not empty, every
68
+ * parent item with rendered sub-items opens (a matching parent item with no matching sub-item opens
69
+ * too, unlike `"auto"`). For a tree with lazy parent items, prefer `"manual"` with a search on the server.
70
+ * - Option count (`Combobox.State`): the matching items during an auto filter, every rendered tree item
71
+ * during a manual filter, and no count without a filter.
72
+ *
73
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
74
+ *
75
+ * @param props Component props.
76
+ * @return Vue element.
77
+ */
78
+ declare const TreeList: import('vue').DefineSetupFnComponent<TreeListProps, {
79
+ /**
80
+ * On a selection of a selectable tree item (Enter, Space or a click), in a standalone tree only.
81
+ * In a combobox, the trigger `select` event (`Combobox.Input` or `Combobox.Button`) handles the selection.
82
+ */
83
+ select: (option: {
84
+ value: string;
85
+ }) => boolean;
86
+ /**
87
+ * Selection change, on every selection (in a combobox too). Payload: the selected value, or the toggled
88
+ * values with `selectionType="multiple"`.
89
+ */
90
+ change: (newValue: string | string[]) => boolean;
91
+ }, {}, TreeListProps & {
92
+ onSelect?: ((option: {
93
+ value: string;
94
+ }) => any) | undefined;
95
+ onChange?: ((newValue: string | string[]) => any) | undefined;
96
+ }, import('vue').PublicProps>;
97
+ export { COMPONENT_NAME, CLASSNAME, DEFAULT_PROPS };
98
+ export default TreeList;
@@ -0,0 +1,63 @@
1
+ declare const _default: {
2
+ component: any;
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Standalone: {
7
+ args: {
8
+ value: string;
9
+ };
10
+ decorators: ((story: any, context: any) => any)[];
11
+ render: ({ value, onChange }: any) => import("vue/jsx-runtime").JSX.Element;
12
+ };
13
+ export declare const StandaloneMultipleSelection: {
14
+ args: {
15
+ value: string[];
16
+ };
17
+ decorators: ((story: any, context: any) => any)[];
18
+ render: ({ value, onChange }: any) => import("vue/jsx-runtime").JSX.Element;
19
+ };
20
+ export declare const InComboboxInput: {
21
+ args: {
22
+ value: {
23
+ text: string;
24
+ selected: string;
25
+ };
26
+ };
27
+ decorators: ((story: any, context: any) => any)[];
28
+ render: ({ value, onUpdate }: any) => import("vue/jsx-runtime").JSX.Element;
29
+ };
30
+ export declare const InComboboxInline: {
31
+ args: {
32
+ value: {
33
+ text: string;
34
+ selected: string;
35
+ };
36
+ };
37
+ decorators: ((story: any, context: any) => any)[];
38
+ render: ({ value, onUpdate }: any) => import("vue/jsx-runtime").JSX.Element;
39
+ };
40
+ export declare const InComboboxButton: {
41
+ args: {
42
+ value: string;
43
+ };
44
+ decorators: ((story: any, context: any) => any)[];
45
+ render: ({ value, onChange }: any) => import("vue/jsx-runtime").JSX.Element;
46
+ };
47
+ export declare const InComboboxMultipleSelection: {
48
+ args: {
49
+ value: {
50
+ text: string;
51
+ selected: string[];
52
+ };
53
+ };
54
+ decorators: ((story: any, context: any) => any)[];
55
+ render: ({ value, onUpdate }: any) => import("vue/jsx-runtime").JSX.Element;
56
+ };
57
+ export declare const LazyParentItem: {
58
+ args: {
59
+ snacks: string;
60
+ };
61
+ decorators: ((story: any, context: any) => any)[];
62
+ render: ({ snacks, onSnacksChange }: any) => import("vue/jsx-runtime").JSX.Element;
63
+ };
@@ -0,0 +1,83 @@
1
+ declare const _default: {
2
+ component: any;
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const TreeItemRowLayout: {
7
+ render: ({ value, onUpdate, onSelect, treeOnSelect, filter, selectionType, onOpenChange, onClick, nbOptionMessage, withoutState, snacks, }: any) => import("vue/jsx-runtime").JSX.Element;
8
+ play(): Promise<void>;
9
+ args: {
10
+ value: {
11
+ text: string;
12
+ selected: string;
13
+ };
14
+ };
15
+ decorators: ((story: any, context: any) => any)[];
16
+ };
17
+ export declare const ClickNonSelectableParentItemRow: {
18
+ render: ({ value, onUpdate, onSelect, treeOnSelect, filter, selectionType, onOpenChange, onClick, nbOptionMessage, withoutState, snacks, }: any) => import("vue/jsx-runtime").JSX.Element;
19
+ play(): Promise<void>;
20
+ args: {
21
+ value: {
22
+ text: string;
23
+ selected: string;
24
+ };
25
+ };
26
+ decorators: ((story: any, context: any) => any)[];
27
+ };
28
+ export declare const FilterNoMatchHidesPopover: {
29
+ args: {
30
+ withoutState: boolean;
31
+ snacks: string;
32
+ value: {
33
+ text: string;
34
+ selected: string;
35
+ };
36
+ };
37
+ render: ({ value, onUpdate, onSelect, treeOnSelect, filter, selectionType, onOpenChange, onClick, nbOptionMessage, withoutState, snacks, }: any) => import("vue/jsx-runtime").JSX.Element;
38
+ play(): Promise<void>;
39
+ decorators: ((story: any, context: any) => any)[];
40
+ };
41
+ export declare const AccessibilityOpenTree: {
42
+ parameters: {
43
+ a11y: {
44
+ test: string;
45
+ };
46
+ };
47
+ render: ({ value, onUpdate, onSelect, treeOnSelect, filter, selectionType, onOpenChange, onClick, nbOptionMessage, withoutState, snacks, }: any) => import("vue/jsx-runtime").JSX.Element;
48
+ play(): Promise<void>;
49
+ args: {
50
+ value: {
51
+ text: string;
52
+ selected: string;
53
+ };
54
+ };
55
+ decorators: ((story: any, context: any) => any)[];
56
+ };
57
+ export declare const AccessibilityLoadingGroup: {
58
+ args: {
59
+ value: string;
60
+ load: Promise<unknown>;
61
+ };
62
+ decorators: ((story: any, context: any) => any)[];
63
+ parameters: {
64
+ a11y: {
65
+ test: string;
66
+ };
67
+ };
68
+ render: ({ value, onChange, onOpenChange, load }: any) => import("vue/jsx-runtime").JSX.Element;
69
+ play(): Promise<void>;
70
+ };
71
+ export declare const AccessibilityStandaloneTree: {
72
+ args: {
73
+ value: string;
74
+ };
75
+ decorators: ((story: any, context: any) => any)[];
76
+ parameters: {
77
+ a11y: {
78
+ test: string;
79
+ };
80
+ };
81
+ render: ({ value, onUpdate, onSelect, onOpenChange, onClick, selectionType }: any) => import("vue/jsx-runtime").JSX.Element;
82
+ play(): Promise<void>;
83
+ };
@@ -0,0 +1,9 @@
1
+ /** Context value provided by `TreeList` to its tree items: the selection. */
2
+ export interface TreeListContextValue {
3
+ /** Whether a tree item value is selected (in the tree `value`). */
4
+ isSelected(value: string): boolean;
5
+ }
6
+ /** Provide the tree list context (see `TreeList`). */
7
+ export declare function provideTreeListContext(value: TreeListContextValue): void;
8
+ /** Access the tree list context, or `undefined` outside of a `TreeList` (does not throw). */
9
+ export declare function useOptionalTreeListContext(): TreeListContextValue | undefined;
@@ -0,0 +1,73 @@
1
+ import { TreeListItemProps as UIProps, TreeListItemPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/TreeList/TreeListItem';
2
+ import { VueToJSXProps } from '../../utils/VueToJSX';
3
+ import { TooltipProps } from '../tooltip/Tooltip';
4
+ export type TreeListItemProps = VueToJSXProps<UIProps, TreeListItemPropsToOverride | 'id' | 'isParent' | 'isOpen' | 'isSelected' | 'hidden' | 'level' | 'handleClick' | 'handleToggleClick'> & {
5
+ /** Content of the row (the tree item label), when the `label` slot is not used. */
6
+ label?: string;
7
+ /**
8
+ * Make a lazy parent item: a parent item with no sub-items until the user opens it (load the
9
+ * sub-items on `openChange`). Not needed when sub-items are present.
10
+ * In a combobox, the open state resets on each popup open: cache the loaded sub-items.
11
+ */
12
+ hasSubItems?: boolean;
13
+ /** Props forwarded to a Tooltip wrapping the `role="treeitem"` element. */
14
+ tooltipProps?: Partial<TooltipProps>;
15
+ /** Props forwarded to the inner `role="treeitem"` element. */
16
+ actionProps?: Record<string, any>;
17
+ };
18
+ export declare const emitSchema: {
19
+ /**
20
+ * On every open and close by the user (expand toggle, Right, Left, Enter or a click on a
21
+ * non-selectable parent item). Not emitted for the initial state or for the filter.
22
+ */
23
+ openChange: (isOpen: boolean) => boolean;
24
+ /** On tree item clicked (or activated with Enter), selectable or not. */
25
+ click: () => boolean;
26
+ };
27
+ /**
28
+ * TreeListItem component: one tree item of a `TreeList`, with its sub-items (default slot: `TreeListItem`,
29
+ * `Combobox.OptionSkeleton` or `Combobox.State`). Label: the `label` slot, or the `label` prop.
30
+ * The `before` and `after` slots take e.g. an icon.
31
+ *
32
+ * - With a `value`, the tree item is selectable (Enter or a click selects it), and it is selected when the
33
+ * tree `value` holds it. Without, it is not selectable: Enter or a click on a non-selectable parent item
34
+ * opens or closes it, and on a non-selectable leaf item only emits `click` (e.g. an action such as
35
+ * "Create a new list…").
36
+ * - The open state is internal: a parent item starts open when a sub-item at any depth is selected.
37
+ * In a combobox, it resets on each popup open.
38
+ * - Touch screen readers: TalkBack (Chrome) can open and close the parent items. On iOS, a user can
39
+ * only reach the sub-items of a selectable parent item through the filter. To support it, use a
40
+ * non-selectable parent item with an "All <name>" leaf item that carries the parent value.
41
+ *
42
+ * @param props Component props.
43
+ * @return Vue element.
44
+ */
45
+ declare const TreeListItem: import('vue').DefineSetupFnComponent<TreeListItemProps, {
46
+ /**
47
+ * On every open and close by the user (expand toggle, Right, Left, Enter or a click on a
48
+ * non-selectable parent item). Not emitted for the initial state or for the filter.
49
+ */
50
+ openChange: (isOpen: boolean) => boolean;
51
+ /** On tree item clicked (or activated with Enter), selectable or not. */
52
+ click: () => boolean;
53
+ }, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "isOpen" | "level" | "id" | "isSelected" | "hidden" | "isParent" | "handleToggleClick" | TreeListItemPropsToOverride> & {
54
+ class?: import('../../utils/VueToJSX').ClassValue;
55
+ } & {
56
+ /** Content of the row (the tree item label), when the `label` slot is not used. */
57
+ label?: string;
58
+ /**
59
+ * Make a lazy parent item: a parent item with no sub-items until the user opens it (load the
60
+ * sub-items on `openChange`). Not needed when sub-items are present.
61
+ * In a combobox, the open state resets on each popup open: cache the loaded sub-items.
62
+ */
63
+ hasSubItems?: boolean;
64
+ /** Props forwarded to a Tooltip wrapping the `role="treeitem"` element. */
65
+ tooltipProps?: Partial<TooltipProps>;
66
+ /** Props forwarded to the inner `role="treeitem"` element. */
67
+ actionProps?: Record<string, any>;
68
+ } & {
69
+ onClick?: (() => any) | undefined;
70
+ onOpenChange?: ((isOpen: boolean) => any) | undefined;
71
+ }, import('vue').PublicProps>;
72
+ export { COMPONENT_NAME, CLASSNAME };
73
+ export default TreeListItem;
@@ -0,0 +1,34 @@
1
+ import { default as TreeListItem } from './TreeListItem';
2
+ export type { TreeListProps, SingleTreeListProps, MultipleTreeListProps } from './TreeList';
3
+ export type { TreeListItemProps } from './TreeListItem';
4
+ /**
5
+ * TreeList compound component: `TreeList.Item` is the tree item (also exported as `TreeListItem`).
6
+ */
7
+ export declare const TreeList: import('vue').DefineSetupFnComponent<import('./TreeList').TreeListProps, {
8
+ select: (option: {
9
+ value: string;
10
+ }) => boolean;
11
+ change: (newValue: string | string[]) => boolean;
12
+ }, {}, import('./TreeList').TreeListProps & {
13
+ onSelect?: ((option: {
14
+ value: string;
15
+ }) => any) | undefined;
16
+ onChange?: ((newValue: string | string[]) => any) | undefined;
17
+ }, import('vue').PublicProps> & {
18
+ /** One tree item of the tree, with its sub-items. */
19
+ Item: import('vue').DefineSetupFnComponent<import('./TreeListItem').TreeListItemProps, {
20
+ openChange: (isOpen: boolean) => boolean;
21
+ click: () => boolean;
22
+ }, {}, Omit<import('@lumx/core/js/components/TreeList/TreeListItem').TreeListItemProps, "className" | import('@lumx/core/js/types').PropsToOverride | "isOpen" | "level" | "id" | "isSelected" | "hidden" | "isParent" | "handleToggleClick" | import('@lumx/core/js/components/TreeList/TreeListItem').TreeListItemPropsToOverride> & {
23
+ class?: import('../../utils/VueToJSX').ClassValue;
24
+ } & {
25
+ label?: string;
26
+ hasSubItems?: boolean;
27
+ tooltipProps?: Partial<import('../tooltip').TooltipProps>;
28
+ actionProps?: Record<string, any>;
29
+ } & {
30
+ onClick?: (() => any) | undefined;
31
+ onOpenChange?: ((isOpen: boolean) => any) | undefined;
32
+ }, import('vue').PublicProps>;
33
+ };
34
+ export { TreeListItem };
package/index.d.ts CHANGED
@@ -44,6 +44,7 @@ export * from './components/text';
44
44
  export * from './components/thumbnail';
45
45
  export * from './components/toolbar';
46
46
  export * from './components/tooltip';
47
+ export * from './components/tree-list';
47
48
  export * from './components/user-block';
48
49
  export * from './components/select-button';
49
50
  export * from './components/select-text-field';