@fluid-topics/ftds-tree-list 2.1.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/README.md ADDED
@@ -0,0 +1,19 @@
1
+ The design system tree list component
2
+
3
+ ## Install
4
+
5
+ ```shell
6
+ npm install @fluid-topics/ftds-tree-list
7
+ yarn add @fluid-topics/ftds-tree-list
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```typescript
13
+ import { html } from "lit"
14
+ import "@fluid-topics/ftds-tree-list"
15
+
16
+ function render() {
17
+ return html` <ftds-tree-list foo="bar"></ftds-tree-list> `
18
+ }
19
+ ```
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { customElements } from "@fluid-topics/ft-wc-utils";
2
+ import definitions from "./definitions";
3
+ customElements(definitions);
@@ -0,0 +1,5 @@
1
+ import { FtdsTreeList } from "./ftds-tree-list";
2
+ declare const _default: {
3
+ "ftds-tree-list": typeof FtdsTreeList;
4
+ };
5
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { FtdsTreeList } from "./ftds-tree-list";
2
+ export default {
3
+ "ftds-tree-list": FtdsTreeList,
4
+ };
@@ -0,0 +1,73 @@
1
+ import { PropertyValues, TemplateResult } from "lit";
2
+ import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
+ import { EmptyStateConfiguration, FtdsTreeListProperties } from "./ftds-tree-list.properties";
4
+ import { FtdsTreeListData, FtTreeNode } from "./model/FtdsTreeListData";
5
+ export declare class NodeSelectedEvent extends CustomEvent<FtTreeNode> {
6
+ constructor(node: FtTreeNode);
7
+ }
8
+ export declare class FtdsTreeList extends FtLitElement implements FtdsTreeListProperties {
9
+ static elementDefinitions: ElementDefinitionsMap;
10
+ static styles: import("lit").CSSResult;
11
+ data?: FtdsTreeListData;
12
+ label: string;
13
+ pageSize: number;
14
+ selectedNode?: FtTreeNode;
15
+ expandLabel: string;
16
+ collapseLabel: string;
17
+ loadMoreLabel: string;
18
+ expandParametrizedLabel: string;
19
+ collapseParametrizedLabel: string;
20
+ expandAllLabel: string;
21
+ collapseAllLabel: string;
22
+ emptyState?: EmptyStateConfiguration;
23
+ loading: boolean;
24
+ nodeToFocus?: FtTreeNode;
25
+ isTreeSelectorCollapsed?: boolean;
26
+ childrenCounts: Map<string, number>;
27
+ userOpenedNodes: Set<string>;
28
+ userClosedNodes: Set<string>;
29
+ expandAll(): void;
30
+ collapseAll(): void;
31
+ getItemSelector(item: FtTreeNode): HTMLElement;
32
+ isNodeExpanded(node: FtTreeNode): boolean;
33
+ setFocusToTreeItem(item: FtTreeNode): void;
34
+ selectNodeByBreadcrumb(breadcrumb: string[]): Promise<void>;
35
+ protected render(): TemplateResult<1>;
36
+ protected renderBody(): TemplateResult;
37
+ protected renderLoadingState(): TemplateResult;
38
+ protected renderLeftHeader(): TemplateResult;
39
+ protected renderNode(node: FtTreeNode): unknown;
40
+ protected renderChildNodes(isNodeExpanded: boolean, visibleChildren: FtTreeNode[], node: FtTreeNode, childrenClasses: {
41
+ expanded: boolean;
42
+ collapsed: boolean;
43
+ "with-expandable": boolean;
44
+ "with-children": boolean;
45
+ }): TemplateResult<1>;
46
+ protected renderShowMore(node: FtTreeNode, childrenClasses: {
47
+ expanded: boolean;
48
+ collapsed: boolean;
49
+ "with-expandable": boolean;
50
+ "with-children": boolean;
51
+ }): TemplateResult<1>;
52
+ protected renderEmptyState(): TemplateResult<1>;
53
+ protected renderEmptyStateTitle(): TemplateResult | symbol;
54
+ protected renderEmptyStateDescription(): TemplateResult | symbol;
55
+ protected willUpdate(props: PropertyValues): void;
56
+ protected updated(props: PropertyValues): void;
57
+ protected onKeydown(event: KeyboardEvent, currentNode: FtTreeNode, isLoadMore: boolean, parentNode?: FtTreeNode): void;
58
+ protected setFocusToPreviousNode(visibleItems: FtTreeNode[], currentNodeIndex: number): void;
59
+ protected setFocusToNextNode(visibleItems: FtTreeNode[], currentNodeIndex: number): void;
60
+ protected getAdjacentVisibleTreeItems(tree: FtTreeNode[], currentNode: FtTreeNode): FtTreeNode[];
61
+ protected isVisible(treeitem: FtTreeNode): boolean;
62
+ protected expandNode(expanded: boolean, currentNodeValue: string): void;
63
+ protected toggleExpandAll(): void;
64
+ protected getAllClosedNodes(node: FtTreeNode): string[];
65
+ protected getChildrenCount(node: FtTreeNode): number;
66
+ protected getEntriesCount(): number;
67
+ protected hasExpandableChildren(node: FtTreeNode): boolean;
68
+ protected hasChildren(node: FtTreeNode): boolean;
69
+ protected loadMore(node: FtTreeNode): void;
70
+ protected displayChild(currentNode: FtTreeNode, childValue: string): FtTreeNode;
71
+ protected handleNodeSelectEvent(e: MouseEvent | KeyboardEvent, node: FtTreeNode): void;
72
+ protected selectNode(node: FtTreeNode): void;
73
+ }