@lumx/vue 4.27.1-alpha.2 → 4.27.1-alpha.3
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/composite/CompositeContext.d.ts +3 -2
- package/components/composite/useCompositeList.d.ts +5 -3
- package/components/tree-list/TreeList.stories.d.ts +10 -0
- package/components/tree-list/TreeList.test.d.ts +1 -0
- package/components/tree-list/TreeListSection.d.ts +34 -0
- package/components/tree-list/hasContent.d.ts +2 -0
- package/components/tree-list/index.d.ts +11 -2
- package/index.js +4420 -4308
- package/index.js.map +1 -1
- package/package.json +4 -5
|
@@ -6,7 +6,8 @@ import { CompositeHandle, CompositeType } from '@lumx/core/js/components/Composi
|
|
|
6
6
|
*
|
|
7
7
|
* Provided by `ListboxProvider` (standalone listbox) and by `Combobox.Provider` (the list registered on
|
|
8
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
|
+
* the next `level`), without `comboboxListId`. A standalone `TreeList` has no provider above it: it provides the
|
|
10
|
+
* first context itself.
|
|
10
11
|
*/
|
|
11
12
|
export interface CompositeContextValue {
|
|
12
13
|
/** The composite handle (null inside a combobox until a list registers). */
|
|
@@ -36,6 +37,6 @@ export declare function provideCompositeContext(value: CompositeContextValue): v
|
|
|
36
37
|
export declare function useOptionalCompositeContext(): CompositeContextValue | undefined;
|
|
37
38
|
/**
|
|
38
39
|
* Access the composite context.
|
|
39
|
-
* @throws Error outside a `ListboxProvider` or a `
|
|
40
|
+
* @throws Error outside a `ListboxProvider`, a `Combobox.Provider` or a standalone `TreeList`.
|
|
40
41
|
*/
|
|
41
42
|
export declare function useCompositeContext(): CompositeContextValue;
|
|
@@ -6,11 +6,13 @@ export interface UseCompositeListOptions<H extends CompositeHandle> {
|
|
|
6
6
|
elementRef: Readonly<Ref<HTMLElement | null>>;
|
|
7
7
|
/** Create the list handle (e.g. `setupListbox`): with the combobox list options, or as a standalone list. */
|
|
8
8
|
createList(options: CompositeOptions): H;
|
|
9
|
+
/** Standalone list: the handle of the list provider above the list (e.g. `ListboxProvider`). */
|
|
10
|
+
standaloneHandle?: Readonly<Ref<H | null>>;
|
|
9
11
|
/**
|
|
10
|
-
* Standalone list
|
|
11
|
-
*
|
|
12
|
+
* Standalone list without a list provider (e.g. `TreeList`): the composable creates the handle with
|
|
13
|
+
* `createList` (and destroys it on unmount). `standaloneHandle` is then ignored.
|
|
12
14
|
*/
|
|
13
|
-
|
|
15
|
+
createStandalone?: boolean;
|
|
14
16
|
/** Standalone list created by the composable: called on a selection. */
|
|
15
17
|
onSelect?(option: {
|
|
16
18
|
value: string;
|
|
@@ -61,3 +61,13 @@ export declare const LazyParentItem: {
|
|
|
61
61
|
decorators: ((story: any, context: any) => any)[];
|
|
62
62
|
render: ({ snacks, onSnacksChange }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
63
63
|
};
|
|
64
|
+
export declare const WithSections: {
|
|
65
|
+
args: {
|
|
66
|
+
value: {
|
|
67
|
+
text: string;
|
|
68
|
+
selected: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
decorators: ((story: any, context: any) => any)[];
|
|
72
|
+
render: ({ value, onUpdate }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TreeListSectionProps as UIProps, TreeListSectionPropsToOverride, COMPONENT_NAME, CLASSNAME } from '@lumx/core/js/components/TreeList/TreeListSection';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type TreeListSectionProps = VueToJSXProps<UIProps, TreeListSectionPropsToOverride | 'hidden'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Section label, shown as the section title (visual only), when the `label` slot is not used. Without a
|
|
6
|
+
* label, the section is a plain group.
|
|
7
|
+
*/
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* TreeListSection component: a section of root tree items in a `TreeList`, with an optional label (`label`
|
|
12
|
+
* prop or slot). Default slot: the `TreeListItem` elements.
|
|
13
|
+
*
|
|
14
|
+
* - The sections get a divider between them (and between them and the standalone tree items). Use a section
|
|
15
|
+
* without a label as a separator.
|
|
16
|
+
* - Root level only: the tree items of a section are root tree items. Do not use it in a tree item.
|
|
17
|
+
* - With `filter="auto"`, the section is hidden when the filter hides all of its tree items.
|
|
18
|
+
* - The label is visual only: the section has no ARIA semantics (a group in a tree changes the tree item levels).
|
|
19
|
+
* - Renders nothing without children.
|
|
20
|
+
*
|
|
21
|
+
* @param props Component props.
|
|
22
|
+
* @return Vue element.
|
|
23
|
+
*/
|
|
24
|
+
declare const TreeListSection: import('vue').DefineSetupFnComponent<TreeListSectionProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "hidden" | TreeListSectionPropsToOverride> & {
|
|
25
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
26
|
+
} & {
|
|
27
|
+
/**
|
|
28
|
+
* Section label, shown as the section title (visual only), when the `label` slot is not used. Without a
|
|
29
|
+
* label, the section is a plain group.
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
} & {}, import('vue').PublicProps>;
|
|
33
|
+
export { COMPONENT_NAME, CLASSNAME };
|
|
34
|
+
export default TreeListSection;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { default as TreeListItem } from './TreeListItem';
|
|
2
|
+
import { default as TreeListSection } from './TreeListSection';
|
|
2
3
|
export type { TreeListProps, SingleTreeListProps, MultipleTreeListProps } from './TreeList';
|
|
3
4
|
export type { TreeListItemProps } from './TreeListItem';
|
|
5
|
+
export type { TreeListSectionProps } from './TreeListSection';
|
|
4
6
|
/**
|
|
5
|
-
* TreeList compound component: `TreeList.Item` is the tree item (also exported as `TreeListItem`)
|
|
7
|
+
* TreeList compound component: `TreeList.Item` is the tree item (also exported as `TreeListItem`), and
|
|
8
|
+
* `TreeList.Section` a section of root tree items (also exported as `TreeListSection`).
|
|
6
9
|
*/
|
|
7
10
|
export declare const TreeList: import('vue').DefineSetupFnComponent<import('./TreeList').TreeListProps, {
|
|
8
11
|
select: (option: {
|
|
@@ -30,5 +33,11 @@ export declare const TreeList: import('vue').DefineSetupFnComponent<import('./Tr
|
|
|
30
33
|
onClick?: (() => any) | undefined;
|
|
31
34
|
onOpenChange?: ((isOpen: boolean) => any) | undefined;
|
|
32
35
|
}, import('vue').PublicProps>;
|
|
36
|
+
/** A section of root tree items, with an optional label (a divider between the sections). */
|
|
37
|
+
Section: import('vue').DefineSetupFnComponent<import('./TreeListSection').TreeListSectionProps, {}, {}, Omit<import('@lumx/core/js/components/TreeList/TreeListSection').TreeListSectionProps, "className" | import('@lumx/core/js/types').PropsToOverride | "hidden" | import('@lumx/core/js/components/TreeList/TreeListSection').TreeListSectionPropsToOverride> & {
|
|
38
|
+
class?: import('../../utils/VueToJSX').ClassValue;
|
|
39
|
+
} & {
|
|
40
|
+
label?: string;
|
|
41
|
+
} & {}, import('vue').PublicProps>;
|
|
33
42
|
};
|
|
34
|
-
export { TreeListItem };
|
|
43
|
+
export { TreeListItem, TreeListSection };
|