@openremote/or-tree-menu 1.3.4
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 +1 -0
- package/dist/umd/index.bundle.js +732 -0
- package/dist/umd/index.bundle.js.LICENSE.txt +136 -0
- package/dist/umd/index.js +732 -0
- package/dist/umd/index.js.LICENSE.txt +136 -0
- package/dist/umd/index.orbundle.js +790 -0
- package/dist/umd/index.orbundle.js.LICENSE.txt +166 -0
- package/lib/index.d.ts +215 -0
- package/lib/index.js +103 -0
- package/lib/index.js.map +1 -0
- package/lib/model.d.ts +58 -0
- package/lib/model.js +1 -0
- package/lib/model.js.map +1 -0
- package/lib/or-tree-group.d.ts +66 -0
- package/lib/or-tree-group.js +49 -0
- package/lib/or-tree-group.js.map +1 -0
- package/lib/or-tree-node.d.ts +27 -0
- package/lib/or-tree-node.js +43 -0
- package/lib/or-tree-node.js.map +1 -0
- package/lib/util.d.ts +10 -0
- package/lib/util.js +1 -0
- package/lib/util.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Platform.js v1.3.6
|
|
3
|
+
* Copyright 2014-2020 Benjamin Tan
|
|
4
|
+
* Copyright 2011-2013 John-David Dalton
|
|
5
|
+
* Available under MIT license
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*! *****************************************************************************
|
|
9
|
+
Copyright (c) Microsoft Corporation.
|
|
10
|
+
|
|
11
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12
|
+
purpose with or without fee is hereby granted.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
16
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
17
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
18
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
+
***************************************************************************** */
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2016 Google Inc.
|
|
26
|
+
*
|
|
27
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
* in the Software without restriction, including without limitation the rights
|
|
30
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
* furnished to do so, subject to the following conditions:
|
|
33
|
+
*
|
|
34
|
+
* The above copyright notice and this permission notice shall be included in
|
|
35
|
+
* all copies or substantial portions of the Software.
|
|
36
|
+
*
|
|
37
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
43
|
+
* THE SOFTWARE.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @license
|
|
48
|
+
* Copyright 2017 Google LLC
|
|
49
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2018 Google Inc.
|
|
55
|
+
*
|
|
56
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
57
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
58
|
+
* in the Software without restriction, including without limitation the rights
|
|
59
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
60
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
61
|
+
* furnished to do so, subject to the following conditions:
|
|
62
|
+
*
|
|
63
|
+
* The above copyright notice and this permission notice shall be included in
|
|
64
|
+
* all copies or substantial portions of the Software.
|
|
65
|
+
*
|
|
66
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
67
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
68
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
69
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
70
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
71
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
72
|
+
* THE SOFTWARE.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @license
|
|
77
|
+
* Copyright 2019 Google Inc.
|
|
78
|
+
*
|
|
79
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
80
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
81
|
+
* in the Software without restriction, including without limitation the rights
|
|
82
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
83
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
84
|
+
* furnished to do so, subject to the following conditions:
|
|
85
|
+
*
|
|
86
|
+
* The above copyright notice and this permission notice shall be included in
|
|
87
|
+
* all copies or substantial portions of the Software.
|
|
88
|
+
*
|
|
89
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
90
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
91
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
92
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
93
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
94
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
95
|
+
* THE SOFTWARE.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2019 Google LLC
|
|
101
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @license
|
|
106
|
+
* Copyright 2020 Google Inc.
|
|
107
|
+
*
|
|
108
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
109
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
110
|
+
* in the Software without restriction, including without limitation the rights
|
|
111
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
112
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
113
|
+
* furnished to do so, subject to the following conditions:
|
|
114
|
+
*
|
|
115
|
+
* The above copyright notice and this permission notice shall be included in
|
|
116
|
+
* all copies or substantial portions of the Software.
|
|
117
|
+
*
|
|
118
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
119
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
120
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
121
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
122
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
123
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
124
|
+
* THE SOFTWARE.
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @license
|
|
129
|
+
* Copyright 2020 Google LLC
|
|
130
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @license
|
|
135
|
+
* Copyright 2021 Google LLC
|
|
136
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @license
|
|
141
|
+
* Lodash <https://lodash.com/>
|
|
142
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
143
|
+
* Released under MIT license <https://lodash.com/license>
|
|
144
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
145
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
150
|
+
*
|
|
151
|
+
* @version 0.11.0
|
|
152
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
153
|
+
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
154
|
+
* @license MIT
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/**!
|
|
158
|
+
* url-search-params-polyfill
|
|
159
|
+
*
|
|
160
|
+
* @author Jerry Bendy (https://github.com/jerrybendy)
|
|
161
|
+
* @licence MIT
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
//! moment.js
|
|
165
|
+
|
|
166
|
+
//! moment.js locale configuration
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
|
+
import { OrTreeNode } from "./or-tree-node";
|
|
3
|
+
import { OrTreeGroup } from "./or-tree-group";
|
|
4
|
+
import { TreeMenuSelection, TreeMenuSorting, TreeNode } from "./model";
|
|
5
|
+
import "./or-tree-group";
|
|
6
|
+
import "./or-tree-node";
|
|
7
|
+
export * from "./or-tree-group";
|
|
8
|
+
export * from "./or-tree-node";
|
|
9
|
+
export * from "./model";
|
|
10
|
+
/**
|
|
11
|
+
* @event {OrTreeSelectEvent} or-tree-select - Triggers upon selecting a node, and dispatches a list of the nodes selected.
|
|
12
|
+
* @event {OrTreeDragEvent} or-tree-drag - Triggers upon dragging a node to a new group, and dispatches a list of dragged nodes, the group node, and the updated list of all nodes.
|
|
13
|
+
*/
|
|
14
|
+
export declare class OrTreeMenu extends LitElement {
|
|
15
|
+
/**
|
|
16
|
+
* List of node items in the menu.
|
|
17
|
+
* Uses the TreeNode format for rendering the OrTreeNode elements.
|
|
18
|
+
*/
|
|
19
|
+
nodes: TreeNode[];
|
|
20
|
+
/**
|
|
21
|
+
* Changes the allowed selection method within the tree.
|
|
22
|
+
* Common options are `LEAF`, `SINGLE` and `MULTI`.
|
|
23
|
+
*/
|
|
24
|
+
selection: TreeMenuSelection;
|
|
25
|
+
/**
|
|
26
|
+
* Disables and enables dragging of nodes into groups.
|
|
27
|
+
*/
|
|
28
|
+
draggable: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Removes the header from the tree menu.
|
|
31
|
+
*/
|
|
32
|
+
noHeader: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Adjusts the title in the menu header.
|
|
35
|
+
*/
|
|
36
|
+
menuTitle: string;
|
|
37
|
+
/**
|
|
38
|
+
* List of options available to sort the object with
|
|
39
|
+
*/
|
|
40
|
+
sortOptions?: TreeMenuSorting[];
|
|
41
|
+
/**
|
|
42
|
+
* Represents the selected sorting option
|
|
43
|
+
*/
|
|
44
|
+
sortBy: TreeMenuSorting;
|
|
45
|
+
/**
|
|
46
|
+
* Automatically prioritizes the groups, and positions these on top.
|
|
47
|
+
*/
|
|
48
|
+
groupFirst: boolean;
|
|
49
|
+
protected _uiNodes?: NodeListOf<OrTreeNode>;
|
|
50
|
+
protected _uiGroups?: NodeListOf<OrTreeGroup>;
|
|
51
|
+
protected _treeNodeCache: Map<TreeNode, string>;
|
|
52
|
+
protected _lastSelectedNode?: OrTreeNode;
|
|
53
|
+
static get styles(): import("lit").CSSResult[];
|
|
54
|
+
protected willUpdate(changedProps: PropertyValues): void;
|
|
55
|
+
render(): TemplateResult;
|
|
56
|
+
/**
|
|
57
|
+
* Function that moves an array of {@link TreeNode} into another {@link TreeNode}, by adding them to their children.
|
|
58
|
+
* The function takes care of removing the nodes from the former group, and makes sure no duplicates end up in the list.
|
|
59
|
+
*
|
|
60
|
+
* @param nodesToMove - The array of nodes that are moved into a group.
|
|
61
|
+
* @param groupNode - The group node to insert nodesToMove in.
|
|
62
|
+
*/
|
|
63
|
+
moveNodesToGroup(nodesToMove: TreeNode[], groupNode?: TreeNode): void;
|
|
64
|
+
/**
|
|
65
|
+
* Returns a HTML template that displays the tree menu.
|
|
66
|
+
* @param nodes - List of nodes to be rendered
|
|
67
|
+
*/
|
|
68
|
+
protected _getTreeTemplate(nodes: TreeNode[]): TemplateResult;
|
|
69
|
+
/**
|
|
70
|
+
* Returns an HTML template for displaying a single node within a tree menu. This can both be a group or a solo node.
|
|
71
|
+
* @param node - Node to be rendered
|
|
72
|
+
* @param parent - Optional parent (group node) if the node is placed inside a group
|
|
73
|
+
*/
|
|
74
|
+
protected _getNodeTemplate(node: TreeNode, parent?: TreeNode): TemplateResult;
|
|
75
|
+
/**
|
|
76
|
+
* Returns an HTML template for displaying a single node
|
|
77
|
+
* @param node - Node to be rendered
|
|
78
|
+
* @param parent - Optional parent (group node) if the node is placed inside a group
|
|
79
|
+
*/
|
|
80
|
+
protected _getSingleNodeTemplate(node: TreeNode, parent?: TreeNode): TemplateResult;
|
|
81
|
+
/**
|
|
82
|
+
* Returns an HTML template for the slot element inside <or-tree-node>.
|
|
83
|
+
* It allows customization such as a prefix icon, adjusting the label, etc.
|
|
84
|
+
* @param node - Node to be rendered
|
|
85
|
+
*/
|
|
86
|
+
protected _getSingleNodeSlotTemplate(node: TreeNode): TemplateResult;
|
|
87
|
+
/**
|
|
88
|
+
* Returns a HTML template for rendering a group node (aka a node with children)
|
|
89
|
+
* @param node - Node to be rendered
|
|
90
|
+
* @param _parent - Optional parent (group node) if the node is placed inside a group
|
|
91
|
+
*/
|
|
92
|
+
protected _getGroupNodeTemplate(node: TreeNode, _parent?: TreeNode): TemplateResult;
|
|
93
|
+
/**
|
|
94
|
+
* Returns an HTML template for the parent slot element inside <or-tree-group>.
|
|
95
|
+
* It allows customization such as a prefix icon, adjusting the label, etc.
|
|
96
|
+
* @param node - Node to be rendered
|
|
97
|
+
*/
|
|
98
|
+
protected _getGroupNodeSlotTemplate(node: TreeNode): TemplateResult;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a HTML template for the header
|
|
101
|
+
*/
|
|
102
|
+
protected _getHeaderTemplate(): TemplateResult;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a HTML template for the sorting options menu.
|
|
105
|
+
* @param value - The selected sorting option
|
|
106
|
+
* @param options - The available sorting options
|
|
107
|
+
*/
|
|
108
|
+
protected _getSortActionTemplate(value?: string, options?: TreeMenuSorting[]): TemplateResult;
|
|
109
|
+
/**
|
|
110
|
+
* Returns a HTML template for displaying errors
|
|
111
|
+
*/
|
|
112
|
+
protected _getErrorTemplate(): TemplateResult;
|
|
113
|
+
/**
|
|
114
|
+
* HTML callback event for selecting a sort option in the dropdown menu,.
|
|
115
|
+
* @param value - The new selected sort option
|
|
116
|
+
*/
|
|
117
|
+
protected _onSortClick(value: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* HTML callback event for clicking on a group node. (aka a node with children)
|
|
120
|
+
* Based on the configured TreeMenuSelection, it single- or multi selects the nodes.
|
|
121
|
+
*/
|
|
122
|
+
protected _onTreeGroupClick(ev: PointerEvent): void;
|
|
123
|
+
/** HTML callback event for when a child node of the tree gets clicked on. */
|
|
124
|
+
protected _onTreeNodeClick(ev: PointerEvent): void;
|
|
125
|
+
/** HTML callback event for 'dragstart' (the moment when a drag gesture is started) */
|
|
126
|
+
protected _onDragStart(ev: DragEvent, node: TreeNode): void;
|
|
127
|
+
/** HTML callback event for 'dragover' on the list element */
|
|
128
|
+
protected _onDragOverList(ev: DragEvent): void;
|
|
129
|
+
/** HTML callback event for 'dragover', so while a node is dragged over a single node */
|
|
130
|
+
protected _onDragOverSingleNode(ev: DragEvent, node: TreeNode, parent?: TreeNode): void;
|
|
131
|
+
/** HTML callback event for 'dragover', so while a node is dragged over a group node */
|
|
132
|
+
protected _onDragOverGroup(ev: DragEvent, groupNode: TreeNode): void;
|
|
133
|
+
/** HTML callback event for 'dragover', so while a node is dragged over a single node */
|
|
134
|
+
protected _onDragLeaveSingleNode(ev: DragEvent, node: TreeNode, parent?: TreeNode): void;
|
|
135
|
+
/** HTML callback event for 'dragleave', so after a node has been dragged over a group node */
|
|
136
|
+
protected _onDragLeaveGroup(ev: DragEvent, groupNode: TreeNode): void;
|
|
137
|
+
/** HTML callback event for when a node is dropped on the list level. */
|
|
138
|
+
protected _onDragDropList(ev: DragEvent): void;
|
|
139
|
+
/** HTML callback event for when a node is dropped onto a single node, after dragging it over. */
|
|
140
|
+
protected _onDragDropSingleNode(ev: DragEvent, groupNode?: TreeNode, parent?: TreeNode): void;
|
|
141
|
+
/** HTML callback event for when a node is dropped onto a group node, after dragging it over. */
|
|
142
|
+
protected _onDragDropGroup(ev: DragEvent, groupNode?: TreeNode): void;
|
|
143
|
+
/**
|
|
144
|
+
* Dispatches a cancellable tree drag event.
|
|
145
|
+
*/
|
|
146
|
+
protected _dispatchCancellableDragEvent(nodes: TreeNode[], groupNode?: TreeNode, allNodes?: TreeNode[]): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Selects the node using the HTML attribute 'selected' of OrTreeNode
|
|
149
|
+
* @param node - Node to be selected
|
|
150
|
+
* @param notify - Boolean whether to notify the HTML parents of an or-tree-select.
|
|
151
|
+
*/
|
|
152
|
+
protected _selectNode(node?: OrTreeNode, notify?: boolean): void;
|
|
153
|
+
/**
|
|
154
|
+
* Multi-selects the nodes between two indexes in a list of OrTreeNode.
|
|
155
|
+
* @param nodes - List of nodes in the tree menu
|
|
156
|
+
* @param index1 - Start index of the nodes to select
|
|
157
|
+
* @param index2 - End index of the nodes to select
|
|
158
|
+
* @param notify - Boolean whether to notify the HTML parents of an or-tree-select.
|
|
159
|
+
*/
|
|
160
|
+
protected _selectNodesBetween(nodes: OrTreeNode[], index1: number, index2: number, notify?: boolean): void;
|
|
161
|
+
/**
|
|
162
|
+
* Function that notifies parent HTMLElements that a tree node got selected.
|
|
163
|
+
* It dispatches the OrTreeSelectEvent, which includes a list of the selected nodes.
|
|
164
|
+
* @returns a 'success' boolean whether the event was cancelled or not
|
|
165
|
+
*/
|
|
166
|
+
protected _notifyNodesSelect(selectedNodes?: TreeNode[]): Promise<boolean>;
|
|
167
|
+
/**
|
|
168
|
+
* Utility function to detect the selected tree nodes.
|
|
169
|
+
* @param uiNodes - List of <or-tree-node> UI elements
|
|
170
|
+
* @param cache - Optionally, supply the cache for retrieving a {@link TreeNode} object from a <or-tree-node> element.
|
|
171
|
+
*/
|
|
172
|
+
protected _findSelectedTreeNodes(uiNodes?: OrTreeNode[], cache?: Map<TreeNode, string>): TreeNode[];
|
|
173
|
+
/**
|
|
174
|
+
* Utility function that gets a {@link TreeNode} based on an {@link OrTreeNode} HTML element in the menu.
|
|
175
|
+
* @param uiNode - The tree node HTML element
|
|
176
|
+
* @param cache - Optional cache to get the TreeNode from
|
|
177
|
+
*/
|
|
178
|
+
protected _getTreeNodeFromTree(uiNode: OrTreeNode, cache?: Map<TreeNode, string>): TreeNode | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Utility function that gets an {@link OrTreeNode} HTML element based on the {@link TreeNode} input object.
|
|
181
|
+
* @param treeNode - The tree node object
|
|
182
|
+
* @param cache - Optional cache to get the HTML element from
|
|
183
|
+
*/
|
|
184
|
+
protected _getUiNodeFromTree(treeNode: TreeNode, cache?: Map<TreeNode, string>): OrTreeNode | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* Utility function for sending a "select" event, so consumers of this component are aware a new node has been selected.
|
|
187
|
+
* @param selectedNodes - List of selected nodes to include in the event payload.
|
|
188
|
+
* @returns a 'success' boolean whether the event was cancelled or not.
|
|
189
|
+
*/
|
|
190
|
+
protected _dispatchSelectEvent(selectedNodes?: TreeNode[]): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Public function that deselects all tree nodes.
|
|
193
|
+
*/
|
|
194
|
+
deselectAllNodes(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Utility function that sorts the list of {@link nodes} based on the given {@link sortBy} method.
|
|
197
|
+
* @param nodes - List of nodes to be sorted
|
|
198
|
+
* @param sortBy - Sorting option
|
|
199
|
+
* @param groupFirst - Whether to prioritize group nodes, and place them on the top of the list.
|
|
200
|
+
*/
|
|
201
|
+
protected _sortNodes(nodes: TreeNode[], sortBy?: TreeMenuSorting, groupFirst?: boolean): TreeNode[];
|
|
202
|
+
/**
|
|
203
|
+
* Function that caches a random ID into a key-value storage, linking the TreeNode with a generated ID.
|
|
204
|
+
* This generated ID can be used somewhere else, for example in an HTMLElement ID as a unique identifier.
|
|
205
|
+
* @param node - The TreeNode object to cache
|
|
206
|
+
* @param randomId - Optionally you can supply an ID to use for caching
|
|
207
|
+
*/
|
|
208
|
+
protected _setTreeNodeId(node: TreeNode, randomId?: string): string;
|
|
209
|
+
/**
|
|
210
|
+
* Function for retrieving the sorting for TreeNodes based on a sortBy parameter.
|
|
211
|
+
* The sortBy parameter represents a key in the TreeNode object like 'label'.
|
|
212
|
+
* @param sortBy - Sorting option to use, such as "a_to_z"
|
|
213
|
+
*/
|
|
214
|
+
protected _getSortFunction(sortBy?: TreeMenuSorting): (a: TreeNode, b: TreeNode) => number;
|
|
215
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,r,o){var i,n=arguments.length,s=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(n<3?i(s):n>3?i(t,r,s):i(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},__awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{d(o.next(e))}catch(e){n(e)}}function l(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,l)}d((o=o.apply(e,t||[])).next())}))};import{css,html,LitElement}from"lit";import{customElement,property,queryAll}from"lit/decorators.js";import{map}from"lit/directives/map.js";import{when}from"lit/directives/when.js";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{getContentWithMenuTemplate}from"@openremote/or-mwc-components/or-mwc-menu";import{Util}from"@openremote/core";import{moveNodesToGroupNode}from"./util";import{OrTreeDragEvent,OrTreeSelectEvent,TreeMenuSelection,TreeMenuSorting}from"./model";import"./or-tree-group";import"./or-tree-node";export*from"./or-tree-group";export*from"./or-tree-node";export*from"./model";const styles=css`
|
|
2
|
+
* {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
#tree-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
#tree-list {
|
|
13
|
+
flex: 1;
|
|
14
|
+
overflow: hidden auto;
|
|
15
|
+
list-style: none;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
or-tree-node > or-tree-node > * {
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
or-tree-node {
|
|
25
|
+
transition: background-color 80ms;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
or-tree-node[drophover] {
|
|
29
|
+
background: #e9ecef;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#tree-header {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding: 0 15px;
|
|
37
|
+
min-height: 48px;
|
|
38
|
+
background: var(--or-app-color4, #4d9d2a);
|
|
39
|
+
color: var(--or-app-color7, white);
|
|
40
|
+
--or-icon-fill: var(--or-app-color7, white);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#tree-header-title {
|
|
44
|
+
margin: 0;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#tree-header-actions {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
`;let OrTreeMenu=class extends LitElement{constructor(){super(...arguments),this.nodes=[],this.selection=TreeMenuSelection.LEAF,this.draggable=!1,this.noHeader=!1,this.menuTitle="Tree Menu",this.sortBy=TreeMenuSorting.A_TO_Z,this.groupFirst=!1,this._treeNodeCache=new Map}static get styles(){return[styles]}willUpdate(e){return(e.has("nodes")||e.has("sortBy")||e.has("groupFirst"))&&this.nodes&&(this.nodes=this._sortNodes(this.nodes,this.sortBy,this.groupFirst)),e.has("selection")&&e.get("selection")&&this.selection&&this.deselectAllNodes(),super.willUpdate(e)}render(){return html`
|
|
54
|
+
<div id="tree-container">
|
|
55
|
+
${when(!this.noHeader,(()=>this._getHeaderTemplate()))}
|
|
56
|
+
${this._getTreeTemplate(this.nodes)}
|
|
57
|
+
${this._getErrorTemplate()}
|
|
58
|
+
</div>
|
|
59
|
+
`}moveNodesToGroup(e,t){this.nodes=moveNodesToGroupNode(e,t,this.nodes)}_getTreeTemplate(e){return this._treeNodeCache=new Map,html`
|
|
60
|
+
<ol id="tree-list" @dragover=${this._onDragOverList} @drop=${this._onDragDropList}>
|
|
61
|
+
${map(e,(e=>this._getNodeTemplate(e)))}
|
|
62
|
+
</ol>
|
|
63
|
+
`}_getNodeTemplate(e,t){return e.children?this._getGroupNodeTemplate(e,t):this._getSingleNodeTemplate(e,t)}_getSingleNodeTemplate(e,t){const r=this._setTreeNodeId(e);return html`
|
|
64
|
+
<li draggable=${this.draggable}
|
|
65
|
+
@dragstart=${t=>this._onDragStart(t,e)}
|
|
66
|
+
@dragover=${r=>this._onDragOverSingleNode(r,e,t)}
|
|
67
|
+
@dragleave=${r=>this._onDragLeaveSingleNode(r,e,t)}
|
|
68
|
+
@drop=${r=>this._onDragDropSingleNode(r,e,t)}>
|
|
69
|
+
<or-tree-node id=${r} ?selected=${e.selected} ?readonly=${e.readonly} @click="${this._onTreeNodeClick}">
|
|
70
|
+
${this._getSingleNodeSlotTemplate(e)}
|
|
71
|
+
</or-tree-node>
|
|
72
|
+
</li>
|
|
73
|
+
`}_getSingleNodeSlotTemplate(e){return html`
|
|
74
|
+
<or-icon slot="prefix" icon="flag"></or-icon>
|
|
75
|
+
<span>${e.label}</span>
|
|
76
|
+
<span slot="suffix"></span>
|
|
77
|
+
`}_getGroupNodeTemplate(e,t){const r=this.selection===TreeMenuSelection.LEAF,o=this._setTreeNodeId(e);return html`
|
|
78
|
+
<li>
|
|
79
|
+
<or-tree-group ?leaf=${r} ?expanded=${e.expanded}>
|
|
80
|
+
<or-tree-node slot="parent" id=${o} ?readonly=${r}
|
|
81
|
+
@click=${this._onTreeGroupClick}
|
|
82
|
+
@dragover=${t=>this._onDragOverGroup(t,e)}
|
|
83
|
+
@dragleave=${t=>this._onDragLeaveGroup(t,e)}
|
|
84
|
+
@drop=${t=>this._onDragDropGroup(t,e)}>
|
|
85
|
+
${this._getGroupNodeSlotTemplate(e)}
|
|
86
|
+
</or-tree-node>
|
|
87
|
+
${map(e.children,(t=>this._getNodeTemplate(t,e)))}
|
|
88
|
+
</or-tree-group>
|
|
89
|
+
</li>
|
|
90
|
+
`}_getGroupNodeSlotTemplate(e){return html`
|
|
91
|
+
<or-icon slot="prefix" icon="folder"></or-icon>
|
|
92
|
+
<span>${e.label}</span>
|
|
93
|
+
<span slot="suffix"></span>
|
|
94
|
+
`}_getHeaderTemplate(){return html`
|
|
95
|
+
<div id="tree-header">
|
|
96
|
+
<h3 id="tree-header-title">
|
|
97
|
+
<or-translate value=${this.menuTitle}></or-translate>
|
|
98
|
+
</h3>
|
|
99
|
+
<div id="tree-header-actions">
|
|
100
|
+
${this._getSortActionTemplate(this.sortBy,this.sortOptions)}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
`}_getSortActionTemplate(e,t){return getContentWithMenuTemplate(html`<or-mwc-input type=${InputType.BUTTON} icon="sort-variant"></or-mwc-input>`,(t||[]).map((e=>({value:e,text:e}))),e,(e=>this._onSortClick(String(e))))}_getErrorTemplate(){return html``}_onSortClick(e){this.sortBy=e}_onTreeGroupClick(e){const t=e.currentTarget,r=t.parentElement,o=(e,t)=>{e.select(),this._lastSelectedNode=t,this._notifyNodesSelect()};switch(this.selection){case TreeMenuSelection.LEAF:return;case TreeMenuSelection.MULTI:if(e.shiftKey&&this._lastSelectedNode){const e=Array.from(this._uiNodes||[]),t=r.getGroupNode();if(t){const r=e.indexOf(t),o=e.indexOf(this._lastSelectedNode);return void this._selectNodesBetween(e,r,o)}}else if(e.ctrlKey)return void o(r,t);return this.deselectAllNodes(),void o(r,t);case TreeMenuSelection.SINGLE:return this.deselectAllNodes(),void o(r,t)}}_onTreeNodeClick(e){const t=e.currentTarget;if(t){if(this.selection===TreeMenuSelection.MULTI){if(e.shiftKey&&this._lastSelectedNode){const e=Array.from(this._uiNodes||[]),r=e.indexOf(this._lastSelectedNode),o=e.indexOf(t);if(r>-1&&o>-1)return void this._selectNodesBetween(e,r,o)}else if(e.ctrlKey)return void this._selectNode(t);return this.deselectAllNodes(),void this._selectNode(t)}return this.deselectAllNodes(),void this._selectNode(t)}}_onDragStart(e,t){var r;e.target?null===(r=e.dataTransfer)||void 0===r||r.setData("treeNode",JSON.stringify(t)):e.preventDefault()}_onDragOverList(e){this.draggable&&e.preventDefault()}_onDragOverSingleNode(e,t,r){if(this.draggable&&(e.preventDefault(),r)){const e=this._getUiNodeFromTree(r);null==e||e.setAttribute("drophover","true")}}_onDragOverGroup(e,t){this.draggable&&(e.preventDefault(),e.currentTarget.setAttribute("drophover","true"))}_onDragLeaveSingleNode(e,t,r){if(r&&this.draggable){e.preventDefault();const t=this._getUiNodeFromTree(r);null==t||t.removeAttribute("drophover")}}_onDragLeaveGroup(e,t){this.draggable&&e.currentTarget.removeAttribute("drophover")}_onDragDropList(e){this._onDragDropGroup(e)}_onDragDropSingleNode(e,t,r){this._onDragDropGroup(e,r)}_onDragDropGroup(e,t){var r,o;if(this.draggable){e.preventDefault(),e.stopPropagation(),t&&(null===(r=this._getUiNodeFromTree(t))||void 0===r||r.removeAttribute("drophover"));let i=[];const n=null===(o=e.dataTransfer)||void 0===o?void 0:o.getData("treeNode");if(n){const e=JSON.parse(n);e&&i.push(e)}if(this.selection===TreeMenuSelection.MULTI){let e=this._findSelectedTreeNodes();e=e.filter((e=>!e.children)),e.length>0&&(this.deselectAllNodes(),i.push(...e.filter((e=>!i.find((t=>JSON.stringify(t)===JSON.stringify(e)))))))}(null==t?void 0:t.children)&&(i=i.filter((e=>{var r;return!(null===(r=t.children)||void 0===r?void 0:r.find((t=>t.id===e.id)))}))),i.length>0&&this._dispatchCancellableDragEvent(i,t,this.nodes).then((()=>{this.nodes=moveNodesToGroupNode(i,t,this.nodes)})).catch((e=>{}))}}_dispatchCancellableDragEvent(e,t,r=[]){return new Promise(((o,i)=>{this.dispatchEvent(new OrTreeDragEvent(e,t,r))?o():i()}))}_selectNode(e,t=!0){if(e){if(t){const t=[...this._findSelectedTreeNodes()],r=this._getTreeNodeFromTree(e);if(r&&t.push(r),!this._dispatchSelectEvent(t))return}e.selected=!0,this._lastSelectedNode=e}}_selectNodesBetween(e,t,r,o=!0){const i=[];if(t<r)for(let o=t;o<=r;o++)i.push(e[o]);else if(t>r)for(let o=r;o<=t;o++)i.push(e[o]);if(o){const e=i.map((e=>this._getTreeNodeFromTree(e))).filter((e=>e));if(!this._notifyNodesSelect(e))return}i.forEach((e=>this._selectNode(e)))}_notifyNodesSelect(e){return __awaiter(this,void 0,void 0,(function*(){return yield this.getUpdateComplete(),e||(e=this._findSelectedTreeNodes()),this._dispatchSelectEvent(e)}))}_findSelectedTreeNodes(e=Array.from(this._uiNodes||[]),t=this._treeNodeCache){const r=e.filter((e=>e.selected)),o=Array.from(t.entries());return r.map((e=>o.find((t=>t[1]===e.id)))).map((e=>null==e?void 0:e[0])).filter((e=>void 0!==e))}_getTreeNodeFromTree(e,t=this._treeNodeCache){var r;return null===(r=Array.from(t.entries()).find((t=>t[1]===e.id)))||void 0===r?void 0:r[0]}_getUiNodeFromTree(e,t=this._treeNodeCache){var r;const o=Array.from(t.entries()),i=JSON.stringify(e),n=null===(r=o.find((e=>JSON.stringify(e[0])===i)))||void 0===r?void 0:r[1];return n?this.shadowRoot.getElementById(n):void 0}_dispatchSelectEvent(e){return this.dispatchEvent(new OrTreeSelectEvent(e||[]))}deselectAllNodes(){(this._uiGroups||[]).forEach((e=>e.deselect())),(this._uiNodes||[]).forEach((e=>e.selected=!1))}_sortNodes(e,t,r=!1){console.debug(`Sorting nodes in the tree menu using '${t}'`);const o=e.filter((e=>void 0!==e.children));if(o.forEach((e=>{var r;return null===(r=e.children)||void 0===r?void 0:r.sort(this._getSortFunction(t))})),r){const r=e.filter((e=>void 0===e.children));return o.sort(this._getSortFunction(t)),r.sort(this._getSortFunction(t)),[...o,...r]}return e.sort(this._getSortFunction(t))}_setTreeNodeId(e,t=Math.random().toString(36).substring(2,11)){return this._treeNodeCache.get(e)?this._treeNodeCache.get(e):(this._treeNodeCache.set(e,t),t)}_getSortFunction(e){return e===TreeMenuSorting.Z_TO_A?(e,t)=>t.label.localeCompare(e.label):Util.sortByString((e=>e.label))}};__decorate([property({type:Array})],OrTreeMenu.prototype,"nodes",void 0),__decorate([property({type:String})],OrTreeMenu.prototype,"selection",void 0),__decorate([property({type:Boolean})],OrTreeMenu.prototype,"draggable",void 0),__decorate([property({type:Boolean,attribute:"no-header"})],OrTreeMenu.prototype,"noHeader",void 0),__decorate([property({type:String,attribute:"menu-title"})],OrTreeMenu.prototype,"menuTitle",void 0),__decorate([property({type:Array,attribute:"sort-options"})],OrTreeMenu.prototype,"sortOptions",void 0),__decorate([property({type:String,attribute:"sort-by",reflect:!0})],OrTreeMenu.prototype,"sortBy",void 0),__decorate([property({type:Boolean,attribute:"group-first"})],OrTreeMenu.prototype,"groupFirst",void 0),__decorate([queryAll("or-tree-node")],OrTreeMenu.prototype,"_uiNodes",void 0),__decorate([queryAll("or-tree-group")],OrTreeMenu.prototype,"_uiGroups",void 0),OrTreeMenu=__decorate([customElement("or-tree-menu")],OrTreeMenu);export{OrTreeMenu};
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,E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OAAO,EAAE,SAAS,EAAE,WAAW,EAAC,CAAC;4CAC1B;AAMjB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;6CACnB;AAMxB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAC,CAAC;+CACZ;AAMhC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CACN;AAMjD;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAC,CAAC;8CAC1B;AAGhB;IADT,QAAQ,CAAC,cAAc,CAAC;4CACmB;AAGlC;IADT,QAAQ,CAAC,eAAe,CAAC;6CACoB;AAxDrC,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CA+nBtB"}
|
package/lib/model.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TreeNode model for constructing a node within the tree.
|
|
3
|
+
*/
|
|
4
|
+
export interface TreeNode {
|
|
5
|
+
id: string;
|
|
6
|
+
children?: TreeNode[];
|
|
7
|
+
label: string;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
expandable?: boolean;
|
|
12
|
+
expanded?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List of possible options for tree menu selection.
|
|
16
|
+
* The order within the enum is based on restrictiveness.
|
|
17
|
+
*
|
|
18
|
+
* - **LEAF** - only allows a single node to be selected, and forbids the selection of any parent node.
|
|
19
|
+
* - **SINGLE** - only allows a single node to be selected, but does allow the selection of the parent node.
|
|
20
|
+
* - **MULTI** - allows selecting multiple nodes using keyboard controls. (control and shift)
|
|
21
|
+
*/
|
|
22
|
+
export declare enum TreeMenuSelection {
|
|
23
|
+
LEAF = "leaf",
|
|
24
|
+
SINGLE = "single",
|
|
25
|
+
MULTI = "multi"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* List of sorting options in the header of the tree menu.
|
|
29
|
+
* By default, we include alphabetically sorting, but can be expanded by class inheritors.
|
|
30
|
+
*/
|
|
31
|
+
export declare enum TreeMenuSorting {
|
|
32
|
+
A_TO_Z = "a_to_z",
|
|
33
|
+
Z_TO_A = "z_to_a"
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Model for the SELECT event that {@link OrTreeMenu} can dispatch.
|
|
37
|
+
* Once a node is selected, a list of all the selected nodes will be shared with the consumer elements.
|
|
38
|
+
*/
|
|
39
|
+
export declare class OrTreeSelectEvent extends CustomEvent<TreeNode[]> {
|
|
40
|
+
static readonly NAME = "or-tree-select";
|
|
41
|
+
constructor(nodes: TreeNode[]);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Payload object of the {@link OrTreeDragEvent}.
|
|
45
|
+
*/
|
|
46
|
+
export interface OrTreeGroupEventDetail {
|
|
47
|
+
nodes: TreeNode[];
|
|
48
|
+
groupNode?: TreeNode;
|
|
49
|
+
newNodes: TreeNode[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Model for the DRAG event that {@link OrTreeMenu} can dispatch.
|
|
53
|
+
* Once a node is dragged into (or outside) a group, we send details to consumer elements.
|
|
54
|
+
*/
|
|
55
|
+
export declare class OrTreeDragEvent extends CustomEvent<OrTreeGroupEventDetail> {
|
|
56
|
+
static readonly NAME = "or-tree-drag";
|
|
57
|
+
constructor(nodes: TreeNode[], groupNode?: TreeNode, newNodes?: TreeNode[]);
|
|
58
|
+
}
|
package/lib/model.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var TreeMenuSelection;!function(e){e.LEAF="leaf",e.SINGLE="single",e.MULTI="multi"}(TreeMenuSelection||(TreeMenuSelection={}));export var TreeMenuSorting;!function(e){e.A_TO_Z="a_to_z",e.Z_TO_A="z_to_a"}(TreeMenuSorting||(TreeMenuSorting={}));export class OrTreeSelectEvent extends CustomEvent{constructor(e){super(OrTreeSelectEvent.NAME,{bubbles:!0,composed:!0,detail:e})}}OrTreeSelectEvent.NAME="or-tree-select";export class OrTreeDragEvent extends CustomEvent{constructor(e,r,t=[]){super(OrTreeDragEvent.NAME,{bubbles:!0,composed:!0,cancelable:!0,detail:{nodes:e,groupNode:r,newNodes:t}})}}OrTreeDragEvent.NAME="or-tree-drag";
|
package/lib/model.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAgBH;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IACzB,kCAAa,CAAA;IAAE,sCAAiB,CAAA;IAAE,oCAAe,CAAA;AACrD,CAAC,EAFW,iBAAiB,KAAjB,iBAAiB,QAE5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAEX;AAFD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IAAE,oCAAiB,CAAA;AACxC,CAAC,EAFW,eAAe,KAAf,eAAe,QAE1B;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAuB;IAI1D,YAAY,KAAiB;QACzB,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE;YAC1B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;IACP,CAAC;;AARsB,sBAAI,GAAG,gBAAgB,CAAC;AAoBnD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAmC;IAIpE,YAAY,KAAiB,EAAE,SAAoB,EAAE,WAAuB,EAAE;QAC1E,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE;YACxB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE;gBACJ,KAAK,EAAE,KAAK;gBACZ,SAAS,EAAE,SAAS;gBACpB,QAAQ,EAAE,QAAQ;aACK;SAC9B,CAAC,CAAC;IACP,CAAC;;AAbsB,oBAAI,GAAG,cAAc,CAAC"}
|