@haiyue/ui 0.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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/checkbox.d.ts +30 -0
- package/dist/checkbox.js +204 -0
- package/dist/context-menu.d.ts +41 -0
- package/dist/context-menu.js +225 -0
- package/dist/dialog.d.ts +30 -0
- package/dist/dialog.js +183 -0
- package/dist/dropdown.d.ts +45 -0
- package/dist/dropdown.js +228 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +110 -0
- package/dist/input.d.ts +30 -0
- package/dist/input.js +131 -0
- package/dist/menu-shared.d.ts +14 -0
- package/dist/menu-shared.js +54 -0
- package/dist/radio.d.ts +30 -0
- package/dist/radio.js +205 -0
- package/dist/select.d.ts +40 -0
- package/dist/select.js +253 -0
- package/dist/split.d.ts +46 -0
- package/dist/split.js +277 -0
- package/dist/tabs.d.ts +28 -0
- package/dist/tabs.js +161 -0
- package/dist/tooltip.d.ts +37 -0
- package/dist/tooltip.js +286 -0
- package/dist/tree-model.d.ts +35 -0
- package/dist/tree-model.js +281 -0
- package/dist/tree-node.d.ts +11 -0
- package/dist/tree-node.js +63 -0
- package/dist/tree-types.d.ts +41 -0
- package/dist/tree-types.js +2 -0
- package/dist/tree.d.ts +102 -0
- package/dist/tree.js +942 -0
- package/package.json +46 -0
- package/src/checkbox.ts +215 -0
- package/src/context-menu.ts +248 -0
- package/src/dialog.ts +195 -0
- package/src/dropdown.ts +249 -0
- package/src/index.ts +192 -0
- package/src/input.ts +150 -0
- package/src/menu-shared.ts +65 -0
- package/src/radio.ts +216 -0
- package/src/select.ts +271 -0
- package/src/split.ts +306 -0
- package/src/tabs.ts +182 -0
- package/src/tooltip.ts +321 -0
- package/src/tree-model.ts +305 -0
- package/src/tree-node.ts +67 -0
- package/src/tree-types.ts +47 -0
- package/src/tree.ts +1002 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/** Mutable hierarchy model owned by ge-tree. It has no DOM dependency and is safe to unit test. */
|
|
2
|
+
export class GETreeModel {
|
|
3
|
+
_data = [];
|
|
4
|
+
_expandedIds;
|
|
5
|
+
_nodeIndex = new Map();
|
|
6
|
+
_visibleNodes = [];
|
|
7
|
+
_visibleIds = [];
|
|
8
|
+
_visibleIndex = new Map();
|
|
9
|
+
_indexDirty = true;
|
|
10
|
+
_visibleDirty = true;
|
|
11
|
+
constructor(expandedIds) {
|
|
12
|
+
this._expandedIds = expandedIds;
|
|
13
|
+
}
|
|
14
|
+
get index() {
|
|
15
|
+
this._ensureIndex();
|
|
16
|
+
return this._nodeIndex;
|
|
17
|
+
}
|
|
18
|
+
get visibleIndex() {
|
|
19
|
+
this.getVisibleNodes();
|
|
20
|
+
return this._visibleIndex;
|
|
21
|
+
}
|
|
22
|
+
get isVisibilityDirty() {
|
|
23
|
+
return this._visibleDirty;
|
|
24
|
+
}
|
|
25
|
+
setData(data) {
|
|
26
|
+
this._data = data;
|
|
27
|
+
this._indexDirty = true;
|
|
28
|
+
this._visibleDirty = true;
|
|
29
|
+
}
|
|
30
|
+
invalidateVisibility() {
|
|
31
|
+
this._visibleDirty = true;
|
|
32
|
+
}
|
|
33
|
+
getVisibleNodes() {
|
|
34
|
+
if (!this._visibleDirty)
|
|
35
|
+
return this._visibleNodes;
|
|
36
|
+
this._ensureIndex();
|
|
37
|
+
this._visibleNodes.length = 0;
|
|
38
|
+
this._visibleIds.length = 0;
|
|
39
|
+
this._visibleIndex.clear();
|
|
40
|
+
const visit = (nodes, parent, depth) => {
|
|
41
|
+
for (const node of nodes) {
|
|
42
|
+
this._visibleIndex.set(node.id, this._visibleIds.length);
|
|
43
|
+
this._visibleNodes.push(this._nodeIndex.get(node.id) ?? { node, parent, depth });
|
|
44
|
+
this._visibleIds.push(node.id);
|
|
45
|
+
if (node.children?.length && this._expandedIds.has(node.id)) {
|
|
46
|
+
visit(node.children, node, depth + 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
visit(this._data, null, 0);
|
|
51
|
+
this._visibleDirty = false;
|
|
52
|
+
return this._visibleNodes;
|
|
53
|
+
}
|
|
54
|
+
getVisibleIds() {
|
|
55
|
+
this.getVisibleNodes();
|
|
56
|
+
return this._visibleIds;
|
|
57
|
+
}
|
|
58
|
+
getIndexedNode(id) {
|
|
59
|
+
this._ensureIndex();
|
|
60
|
+
return this._nodeIndex.get(id) ?? null;
|
|
61
|
+
}
|
|
62
|
+
findNode(id) {
|
|
63
|
+
const found = this.getIndexedNode(id);
|
|
64
|
+
return found ? { node: found.node, parent: found.parent } : null;
|
|
65
|
+
}
|
|
66
|
+
topLevelSelection(ids) {
|
|
67
|
+
this._ensureIndex();
|
|
68
|
+
const existing = [...new Set(ids)].filter(id => this._nodeIndex.has(id));
|
|
69
|
+
const selected = new Set(existing);
|
|
70
|
+
return existing.filter(id => {
|
|
71
|
+
const indexed = this._nodeIndex.get(id);
|
|
72
|
+
return indexed !== undefined && !indexed.ancestorIds.some(ancestorId => selected.has(ancestorId));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
removeNode(id) {
|
|
76
|
+
const found = this.findNode(id);
|
|
77
|
+
if (!found)
|
|
78
|
+
return false;
|
|
79
|
+
const list = found.parent?.children ?? this._data;
|
|
80
|
+
const index = this._nodeIndex.get(id)?.index ?? -1;
|
|
81
|
+
if (index < 0)
|
|
82
|
+
return false;
|
|
83
|
+
list.splice(index, 1);
|
|
84
|
+
this.setData(this._data);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
moveNode(sourceId, targetId, position) {
|
|
88
|
+
this._ensureIndex();
|
|
89
|
+
this.getVisibleNodes();
|
|
90
|
+
const source = this._nodeIndex.get(sourceId);
|
|
91
|
+
const target = this._nodeIndex.get(targetId);
|
|
92
|
+
if (!source || !target || sourceId === targetId)
|
|
93
|
+
return false;
|
|
94
|
+
if (target.ancestorIds.includes(sourceId))
|
|
95
|
+
return false;
|
|
96
|
+
const sourceList = source.parent?.children ?? this._data;
|
|
97
|
+
const sourceIndex = source.index;
|
|
98
|
+
if (sourceIndex < 0)
|
|
99
|
+
return false;
|
|
100
|
+
const previousDepth = source.depth;
|
|
101
|
+
const visibleStart = this._visibleIndex.get(sourceId) ?? -1;
|
|
102
|
+
let visibleCount = 0;
|
|
103
|
+
if (visibleStart >= 0) {
|
|
104
|
+
visibleCount = 1;
|
|
105
|
+
while (visibleStart + visibleCount < this._visibleNodes.length
|
|
106
|
+
&& (this._visibleNodes[visibleStart + visibleCount]?.depth ?? -1) > previousDepth) {
|
|
107
|
+
visibleCount++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
sourceList.splice(sourceIndex, 1);
|
|
111
|
+
let nextParent;
|
|
112
|
+
let targetList;
|
|
113
|
+
let insertIndex;
|
|
114
|
+
let expandedNextParent = false;
|
|
115
|
+
if (position === 'inside') {
|
|
116
|
+
target.node.children ??= [];
|
|
117
|
+
nextParent = target.node;
|
|
118
|
+
targetList = target.node.children;
|
|
119
|
+
insertIndex = targetList.length;
|
|
120
|
+
expandedNextParent = !this._expandedIds.has(target.node.id);
|
|
121
|
+
this._expandedIds.add(target.node.id);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
nextParent = target.parent;
|
|
125
|
+
targetList = target.parent?.children ?? this._data;
|
|
126
|
+
let targetIndex = target.index;
|
|
127
|
+
if (sourceList === targetList && sourceIndex < targetIndex)
|
|
128
|
+
targetIndex--;
|
|
129
|
+
if (targetIndex < 0)
|
|
130
|
+
return false;
|
|
131
|
+
insertIndex = position === 'before' ? targetIndex : targetIndex + 1;
|
|
132
|
+
}
|
|
133
|
+
targetList.splice(insertIndex, 0, source.node);
|
|
134
|
+
this._refreshSiblingIndexes(sourceList);
|
|
135
|
+
if (targetList !== sourceList)
|
|
136
|
+
this._refreshSiblingIndexes(targetList);
|
|
137
|
+
const parentIndex = nextParent ? this._nodeIndex.get(nextParent.id) : null;
|
|
138
|
+
const ancestorIds = parentIndex ? [...parentIndex.ancestorIds, nextParent.id] : [];
|
|
139
|
+
this._refreshSubtreeIndex(source.node, nextParent, parentIndex ? parentIndex.depth + 1 : 0, ancestorIds);
|
|
140
|
+
this._moveVisibleSubtree(source.node, visibleStart, visibleCount, nextParent, expandedNextParent);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
_refreshSiblingIndexes(nodes) {
|
|
144
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
145
|
+
const item = nodes[index];
|
|
146
|
+
const indexed = item ? this._nodeIndex.get(item.id) : null;
|
|
147
|
+
if (indexed)
|
|
148
|
+
indexed.index = index;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_refreshSubtreeIndex(node, parent, depth, ancestorIds) {
|
|
152
|
+
const indexed = this._nodeIndex.get(node.id);
|
|
153
|
+
if (!indexed)
|
|
154
|
+
return;
|
|
155
|
+
indexed.parent = parent;
|
|
156
|
+
indexed.depth = depth;
|
|
157
|
+
indexed.ancestorIds = ancestorIds;
|
|
158
|
+
const childAncestors = [...ancestorIds, node.id];
|
|
159
|
+
for (let index = 0; index < (node.children?.length ?? 0); index++) {
|
|
160
|
+
const child = node.children?.[index];
|
|
161
|
+
if (!child)
|
|
162
|
+
continue;
|
|
163
|
+
const childIndex = this._nodeIndex.get(child.id);
|
|
164
|
+
if (childIndex)
|
|
165
|
+
childIndex.index = index;
|
|
166
|
+
this._refreshSubtreeIndex(child, node, depth + 1, childAncestors);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_moveVisibleSubtree(source, previousStart, previousCount, nextParent, expandedNextParent) {
|
|
170
|
+
if (previousStart >= 0 && previousCount > 0) {
|
|
171
|
+
this._visibleNodes.splice(previousStart, previousCount);
|
|
172
|
+
this._visibleIds.splice(previousStart, previousCount);
|
|
173
|
+
this._refreshVisibleIndexes(previousStart);
|
|
174
|
+
}
|
|
175
|
+
if (expandedNextParent && nextParent) {
|
|
176
|
+
const parentVisible = this._visibleIndex.get(nextParent.id);
|
|
177
|
+
if (parentVisible === undefined)
|
|
178
|
+
return;
|
|
179
|
+
const expandedChildren = [];
|
|
180
|
+
for (const child of nextParent.children ?? []) {
|
|
181
|
+
this._collectVisibleSubtree(child, expandedChildren);
|
|
182
|
+
}
|
|
183
|
+
if (expandedChildren.length === 0)
|
|
184
|
+
return;
|
|
185
|
+
const insertAt = parentVisible + 1;
|
|
186
|
+
this._visibleNodes.splice(insertAt, 0, ...expandedChildren);
|
|
187
|
+
this._visibleIds.splice(insertAt, 0, ...expandedChildren.map(item => item.node.id));
|
|
188
|
+
this._refreshVisibleIndexes(insertAt);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
let insertAt = -1;
|
|
192
|
+
const sourceIndex = this._nodeIndex.get(source.id)?.index ?? -1;
|
|
193
|
+
const siblings = nextParent?.children ?? this._data;
|
|
194
|
+
if (sourceIndex >= 0) {
|
|
195
|
+
if (nextParent) {
|
|
196
|
+
const parentVisible = this._visibleIndex.get(nextParent.id);
|
|
197
|
+
if (parentVisible !== undefined && this._expandedIds.has(nextParent.id)) {
|
|
198
|
+
insertAt = sourceIndex === 0
|
|
199
|
+
? parentVisible + 1
|
|
200
|
+
: this._visibleSubtreeEnd(siblings[sourceIndex - 1]?.id);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
insertAt = sourceIndex === 0
|
|
205
|
+
? 0
|
|
206
|
+
: this._visibleSubtreeEnd(siblings[sourceIndex - 1]?.id);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (insertAt < 0)
|
|
210
|
+
return;
|
|
211
|
+
const moved = [];
|
|
212
|
+
this._collectVisibleSubtree(source, moved);
|
|
213
|
+
if (moved.length === 0)
|
|
214
|
+
return;
|
|
215
|
+
this._visibleNodes.splice(insertAt, 0, ...moved);
|
|
216
|
+
this._visibleIds.splice(insertAt, 0, ...moved.map(item => item.node.id));
|
|
217
|
+
this._refreshVisibleIndexes(insertAt);
|
|
218
|
+
}
|
|
219
|
+
_collectVisibleSubtree(node, result) {
|
|
220
|
+
const indexed = this._nodeIndex.get(node.id);
|
|
221
|
+
if (!indexed)
|
|
222
|
+
return;
|
|
223
|
+
result.push(indexed);
|
|
224
|
+
if (!this._expandedIds.has(node.id))
|
|
225
|
+
return;
|
|
226
|
+
for (const child of node.children ?? [])
|
|
227
|
+
this._collectVisibleSubtree(child, result);
|
|
228
|
+
}
|
|
229
|
+
_visibleSubtreeEnd(id) {
|
|
230
|
+
if (!id)
|
|
231
|
+
return -1;
|
|
232
|
+
const start = this._visibleIndex.get(id);
|
|
233
|
+
const depth = this._nodeIndex.get(id)?.depth;
|
|
234
|
+
if (start === undefined || depth === undefined)
|
|
235
|
+
return -1;
|
|
236
|
+
let end = start + 1;
|
|
237
|
+
while (end < this._visibleNodes.length
|
|
238
|
+
&& (this._visibleNodes[end]?.depth ?? -1) > depth) {
|
|
239
|
+
end++;
|
|
240
|
+
}
|
|
241
|
+
return end;
|
|
242
|
+
}
|
|
243
|
+
_refreshVisibleIndexes(start) {
|
|
244
|
+
for (let index = Math.max(0, start); index < this._visibleIds.length; index++) {
|
|
245
|
+
const id = this._visibleIds[index];
|
|
246
|
+
if (id !== undefined)
|
|
247
|
+
this._visibleIndex.set(id, index);
|
|
248
|
+
}
|
|
249
|
+
for (const [id, index] of this._visibleIndex) {
|
|
250
|
+
if (index < this._visibleIds.length && this._visibleIds[index] === id)
|
|
251
|
+
continue;
|
|
252
|
+
this._visibleIndex.delete(id);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
_ensureIndex() {
|
|
256
|
+
if (!this._indexDirty)
|
|
257
|
+
return;
|
|
258
|
+
this._nodeIndex.clear();
|
|
259
|
+
const ancestorIds = [];
|
|
260
|
+
const visit = (nodes, parent, depth) => {
|
|
261
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
262
|
+
const node = nodes[index];
|
|
263
|
+
if (!node)
|
|
264
|
+
continue;
|
|
265
|
+
this._nodeIndex.set(node.id, { node, parent, depth, ancestorIds: ancestorIds.slice(), index });
|
|
266
|
+
if (node.children?.length) {
|
|
267
|
+
ancestorIds.push(node.id);
|
|
268
|
+
visit(node.children, node, depth + 1);
|
|
269
|
+
ancestorIds.pop();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
visit(this._data, null, 0);
|
|
274
|
+
for (const id of this._expandedIds) {
|
|
275
|
+
if (!this._nodeIndex.has(id))
|
|
276
|
+
this._expandedIds.delete(id);
|
|
277
|
+
}
|
|
278
|
+
this._indexDirty = false;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=tree-model.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GETreeNodeData } from './tree-types.js';
|
|
2
|
+
export declare class GETreeNode extends HTMLElement {
|
|
3
|
+
private readonly _icon;
|
|
4
|
+
private readonly _label;
|
|
5
|
+
static get observedAttributes(): string[];
|
|
6
|
+
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
attributeChangedCallback(): void;
|
|
9
|
+
set node(value: GETreeNodeData);
|
|
10
|
+
private _sync;
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export class GETreeNode extends HTMLElement {
|
|
2
|
+
_icon = document.createElement('span');
|
|
3
|
+
_label = document.createElement('span');
|
|
4
|
+
static get observedAttributes() {
|
|
5
|
+
return ['label', 'icon', 'selected'];
|
|
6
|
+
}
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
10
|
+
const style = document.createElement('style');
|
|
11
|
+
style.textContent = `
|
|
12
|
+
:host {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
gap: 6px;
|
|
17
|
+
color: inherit;
|
|
18
|
+
font: inherit;
|
|
19
|
+
}
|
|
20
|
+
.icon {
|
|
21
|
+
width: 16px;
|
|
22
|
+
flex: 0 0 16px;
|
|
23
|
+
display: inline-grid;
|
|
24
|
+
place-items: center;
|
|
25
|
+
color: var(--ge-tree-icon-color, var(--ge-secondary-text-color, #8fa7c8));
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
}
|
|
28
|
+
.label {
|
|
29
|
+
min-width: 0;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
34
|
+
:host([selected]) .label {
|
|
35
|
+
color: var(--ge-selected-text-color, #ffffff);
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
this._icon.className = 'icon';
|
|
39
|
+
this._label.className = 'label';
|
|
40
|
+
root.append(style, this._icon, this._label);
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
if (!this.hasAttribute('role'))
|
|
44
|
+
this.setAttribute('role', 'treeitem');
|
|
45
|
+
this._sync();
|
|
46
|
+
}
|
|
47
|
+
attributeChangedCallback() {
|
|
48
|
+
this._sync();
|
|
49
|
+
}
|
|
50
|
+
set node(value) {
|
|
51
|
+
this.setAttribute('label', String(value.label ?? value.id));
|
|
52
|
+
if (value.icon)
|
|
53
|
+
this.setAttribute('icon', String(value.icon));
|
|
54
|
+
else
|
|
55
|
+
this.removeAttribute('icon');
|
|
56
|
+
}
|
|
57
|
+
_sync() {
|
|
58
|
+
this._icon.textContent = this.getAttribute('icon') ?? '';
|
|
59
|
+
this._label.textContent = this.getAttribute('label') ?? '';
|
|
60
|
+
this.setAttribute('aria-selected', this.hasAttribute('selected') ? 'true' : 'false');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=tree-node.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface GETreeNodeData {
|
|
2
|
+
id: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
renderer?: string;
|
|
7
|
+
children?: GETreeNodeData[];
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export type GETreeDropPosition = 'before' | 'after' | 'inside';
|
|
11
|
+
export interface GETreeSelectionChangeDetail {
|
|
12
|
+
selectedId: string | null;
|
|
13
|
+
node: GETreeNodeData | null;
|
|
14
|
+
selectedIds: string[];
|
|
15
|
+
nodes: GETreeNodeData[];
|
|
16
|
+
}
|
|
17
|
+
export interface GETreeDataChangeDetail {
|
|
18
|
+
data: GETreeNodeData[];
|
|
19
|
+
action?: 'copy' | 'paste' | 'delete' | 'drop';
|
|
20
|
+
sourceId?: string;
|
|
21
|
+
targetId?: string | null;
|
|
22
|
+
dropPosition?: GETreeDropPosition;
|
|
23
|
+
pastedNodes?: GETreeNodeData[];
|
|
24
|
+
deletedIds?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface GETreeNodeContextMenuDetail {
|
|
27
|
+
id: string;
|
|
28
|
+
node: GETreeNodeData;
|
|
29
|
+
selectedIds: string[];
|
|
30
|
+
clientX: number;
|
|
31
|
+
clientY: number;
|
|
32
|
+
}
|
|
33
|
+
export interface FlatTreeNode {
|
|
34
|
+
node: GETreeNodeData;
|
|
35
|
+
parent: GETreeNodeData | null;
|
|
36
|
+
depth: number;
|
|
37
|
+
}
|
|
38
|
+
export interface IndexedTreeNode extends FlatTreeNode {
|
|
39
|
+
ancestorIds: readonly string[];
|
|
40
|
+
index: number;
|
|
41
|
+
}
|
package/dist/tree.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { GETreeNodeData } from './tree-types.js';
|
|
2
|
+
export { GETreeNode } from './tree-node.js';
|
|
3
|
+
export type { GETreeDataChangeDetail, GETreeDropPosition, GETreeNodeContextMenuDetail, GETreeNodeData, GETreeSelectionChangeDetail, } from './tree-types.js';
|
|
4
|
+
export declare class GETree extends HTMLElement {
|
|
5
|
+
private static readonly VIRTUALIZATION_THRESHOLD;
|
|
6
|
+
private static readonly ROW_HEIGHT;
|
|
7
|
+
private static readonly OVERSCAN_ROWS;
|
|
8
|
+
private readonly _root;
|
|
9
|
+
private readonly _style;
|
|
10
|
+
private readonly _list;
|
|
11
|
+
private readonly _rowCache;
|
|
12
|
+
private _clipboard;
|
|
13
|
+
private _data;
|
|
14
|
+
private _selectedId;
|
|
15
|
+
private _selectedIds;
|
|
16
|
+
private _selectionAnchorId;
|
|
17
|
+
private _activeId;
|
|
18
|
+
private _expandedIds;
|
|
19
|
+
private readonly _model;
|
|
20
|
+
private _dragNodeId;
|
|
21
|
+
private _syncingSelectionAttributes;
|
|
22
|
+
private _resizeObserver;
|
|
23
|
+
static get observedAttributes(): string[];
|
|
24
|
+
constructor();
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
disconnectedCallback(): void;
|
|
27
|
+
attributeChangedCallback(name: string): void;
|
|
28
|
+
get data(): GETreeNodeData[];
|
|
29
|
+
set data(value: GETreeNodeData[]);
|
|
30
|
+
get selectedId(): string | null;
|
|
31
|
+
set selectedId(value: string | null);
|
|
32
|
+
get selectedIds(): string[];
|
|
33
|
+
set selectedIds(value: string[]);
|
|
34
|
+
get allowDrag(): boolean;
|
|
35
|
+
set allowDrag(value: boolean);
|
|
36
|
+
updateData(value: GETreeNodeData[]): void;
|
|
37
|
+
expand(id: string): void;
|
|
38
|
+
collapse(id: string): void;
|
|
39
|
+
toggle(id: string): void;
|
|
40
|
+
reveal(id: string): boolean;
|
|
41
|
+
copySelection(): boolean;
|
|
42
|
+
pasteClipboard(): boolean;
|
|
43
|
+
deleteSelection(): boolean;
|
|
44
|
+
cutSelection(): boolean;
|
|
45
|
+
private _syncFromAttributes;
|
|
46
|
+
private _readDataAttribute;
|
|
47
|
+
private _seedExpanded;
|
|
48
|
+
private _render;
|
|
49
|
+
private _getRenderWindow;
|
|
50
|
+
private _createVirtualSpacer;
|
|
51
|
+
private _getVisibleFlatNodes;
|
|
52
|
+
private _getVisibleIds;
|
|
53
|
+
private _getOrCreateRow;
|
|
54
|
+
private _syncRow;
|
|
55
|
+
private _getRendererTag;
|
|
56
|
+
private _syncRenderer;
|
|
57
|
+
private _syncRenderedSelection;
|
|
58
|
+
private _syncRenderedActive;
|
|
59
|
+
private _select;
|
|
60
|
+
private _setSelection;
|
|
61
|
+
private _syncSelectionAttributes;
|
|
62
|
+
private _setSelectionFromSelectedIdAttribute;
|
|
63
|
+
private _setSelectionFromSelectedIdsAttribute;
|
|
64
|
+
private _getRangeSelection;
|
|
65
|
+
private _getEventRow;
|
|
66
|
+
private _getRowNode;
|
|
67
|
+
private _onListClick;
|
|
68
|
+
private _onListContextMenu;
|
|
69
|
+
private _onListDragStart;
|
|
70
|
+
private _onListDragOver;
|
|
71
|
+
private _onListDragLeave;
|
|
72
|
+
private _onListDrop;
|
|
73
|
+
private _onListDragEnd;
|
|
74
|
+
private _onDragStart;
|
|
75
|
+
private _onDragOver;
|
|
76
|
+
private _onDrop;
|
|
77
|
+
private _onKeyDown;
|
|
78
|
+
private _handleNavigationKey;
|
|
79
|
+
private _moveActiveRight;
|
|
80
|
+
private _moveActiveLeft;
|
|
81
|
+
private _getActiveVisibleId;
|
|
82
|
+
private _ensureActiveVisible;
|
|
83
|
+
private _setActiveId;
|
|
84
|
+
private _syncActiveDescendant;
|
|
85
|
+
private _getTreeItemElementId;
|
|
86
|
+
private _scrollActiveIntoView;
|
|
87
|
+
private _onScroll;
|
|
88
|
+
private _isEditableTarget;
|
|
89
|
+
private _copySelection;
|
|
90
|
+
private _pasteClipboard;
|
|
91
|
+
private _deleteSelection;
|
|
92
|
+
private _cloneNode;
|
|
93
|
+
private _cloneNodeWithUniqueIds;
|
|
94
|
+
private _makeUniqueId;
|
|
95
|
+
private _getSelectedTopLevelNodes;
|
|
96
|
+
private _getTopLevelSelectedIds;
|
|
97
|
+
private _getDropPosition;
|
|
98
|
+
private _getDropClass;
|
|
99
|
+
private _clearDropClass;
|
|
100
|
+
private _clearAllDropClasses;
|
|
101
|
+
}
|
|
102
|
+
export declare function defineTreeComponents(): void;
|