@vertexvis/viewer 0.18.2-testing.0 → 0.18.2-testing.1

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.
Files changed (228) hide show
  1. package/dist/cjs/index-b99cd335.js +126 -1
  2. package/dist/esm/index-fd7d7b68.js +126 -1
  3. package/package.json +7 -7
  4. package/dist/components/_commonjsHelpers.js +0 -41
  5. package/dist/components/_commonjsHelpers.js.map +0 -1
  6. package/dist/components/browser.esm.js +0 -3173
  7. package/dist/components/browser.esm.js.map +0 -1
  8. package/dist/components/bundle.esm.js +0 -2250
  9. package/dist/components/bundle.esm.js.map +0 -1
  10. package/dist/components/bundle.esm2.js +0 -39740
  11. package/dist/components/bundle.esm2.js.map +0 -1
  12. package/dist/components/config.js +0 -81
  13. package/dist/components/config.js.map +0 -1
  14. package/dist/components/controller.js +0 -7627
  15. package/dist/components/controller.js.map +0 -1
  16. package/dist/components/controller2.js +0 -124
  17. package/dist/components/controller2.js.map +0 -1
  18. package/dist/components/controller3.js +0 -111
  19. package/dist/components/controller3.js.map +0 -1
  20. package/dist/components/cursors.js +0 -110
  21. package/dist/components/cursors.js.map +0 -1
  22. package/dist/components/dom.js +0 -43
  23. package/dist/components/dom.js.map +0 -1
  24. package/dist/components/dom2.js +0 -10
  25. package/dist/components/dom2.js.map +0 -1
  26. package/dist/components/elementRectObserver.js +0 -25
  27. package/dist/components/elementRectObserver.js.map +0 -1
  28. package/dist/components/entities.js +0 -179
  29. package/dist/components/entities.js.map +0 -1
  30. package/dist/components/errors.js +0 -80
  31. package/dist/components/errors.js.map +0 -1
  32. package/dist/components/events.js +0 -11
  33. package/dist/components/events.js.map +0 -1
  34. package/dist/components/index.d.ts +0 -26
  35. package/dist/components/index.js +0 -365
  36. package/dist/components/index.js.map +0 -1
  37. package/dist/components/index2.js +0 -63
  38. package/dist/components/index2.js.map +0 -1
  39. package/dist/components/interactions.js +0 -236
  40. package/dist/components/interactions.js.map +0 -1
  41. package/dist/components/mapper.js +0 -9811
  42. package/dist/components/mapper.js.map +0 -1
  43. package/dist/components/markup.js +0 -33
  44. package/dist/components/markup.js.map +0 -1
  45. package/dist/components/model.js +0 -134
  46. package/dist/components/model.js.map +0 -1
  47. package/dist/components/model2.js +0 -157
  48. package/dist/components/model2.js.map +0 -1
  49. package/dist/components/overlays.js +0 -76
  50. package/dist/components/overlays.js.map +0 -1
  51. package/dist/components/png-decoder.js +0 -2405
  52. package/dist/components/png-decoder.js.map +0 -1
  53. package/dist/components/regl-component.js +0 -12582
  54. package/dist/components/regl-component.js.map +0 -1
  55. package/dist/components/results.js +0 -24
  56. package/dist/components/results.js.map +0 -1
  57. package/dist/components/row.js +0 -32
  58. package/dist/components/row.js.map +0 -1
  59. package/dist/components/scene-tree-search.js +0 -146
  60. package/dist/components/scene-tree-search.js.map +0 -1
  61. package/dist/components/scene-tree-table-layout.js +0 -928
  62. package/dist/components/scene-tree-table-layout.js.map +0 -1
  63. package/dist/components/scene-tree-toolbar.js +0 -35
  64. package/dist/components/scene-tree-toolbar.js.map +0 -1
  65. package/dist/components/scene.js +0 -1508
  66. package/dist/components/scene.js.map +0 -1
  67. package/dist/components/stencil.js +0 -25
  68. package/dist/components/stencil.js.map +0 -1
  69. package/dist/components/streamAttributes.js +0 -40833
  70. package/dist/components/streamAttributes.js.map +0 -1
  71. package/dist/components/templates.js +0 -36
  72. package/dist/components/templates.js.map +0 -1
  73. package/dist/components/tslib.es6.js +0 -125
  74. package/dist/components/tslib.es6.js.map +0 -1
  75. package/dist/components/vertex-scene-tree-search.d.ts +0 -11
  76. package/dist/components/vertex-scene-tree-search.js +0 -11
  77. package/dist/components/vertex-scene-tree-search.js.map +0 -1
  78. package/dist/components/vertex-scene-tree-table-cell.d.ts +0 -11
  79. package/dist/components/vertex-scene-tree-table-cell.js +0 -209
  80. package/dist/components/vertex-scene-tree-table-cell.js.map +0 -1
  81. package/dist/components/vertex-scene-tree-table-column.d.ts +0 -11
  82. package/dist/components/vertex-scene-tree-table-column.js +0 -42
  83. package/dist/components/vertex-scene-tree-table-column.js.map +0 -1
  84. package/dist/components/vertex-scene-tree-table-header.d.ts +0 -11
  85. package/dist/components/vertex-scene-tree-table-header.js +0 -38
  86. package/dist/components/vertex-scene-tree-table-header.js.map +0 -1
  87. package/dist/components/vertex-scene-tree-table-layout.d.ts +0 -11
  88. package/dist/components/vertex-scene-tree-table-layout.js +0 -11
  89. package/dist/components/vertex-scene-tree-table-layout.js.map +0 -1
  90. package/dist/components/vertex-scene-tree-table-resize-divider.d.ts +0 -11
  91. package/dist/components/vertex-scene-tree-table-resize-divider.js +0 -57
  92. package/dist/components/vertex-scene-tree-table-resize-divider.js.map +0 -1
  93. package/dist/components/vertex-scene-tree-toolbar-group.d.ts +0 -11
  94. package/dist/components/vertex-scene-tree-toolbar-group.js +0 -38
  95. package/dist/components/vertex-scene-tree-toolbar-group.js.map +0 -1
  96. package/dist/components/vertex-scene-tree-toolbar.d.ts +0 -11
  97. package/dist/components/vertex-scene-tree-toolbar.js +0 -11
  98. package/dist/components/vertex-scene-tree-toolbar.js.map +0 -1
  99. package/dist/components/vertex-scene-tree.d.ts +0 -11
  100. package/dist/components/vertex-scene-tree.js +0 -803
  101. package/dist/components/vertex-scene-tree.js.map +0 -1
  102. package/dist/components/vertex-viewer-box-query-tool.d.ts +0 -11
  103. package/dist/components/vertex-viewer-box-query-tool.js +0 -352
  104. package/dist/components/vertex-viewer-box-query-tool.js.map +0 -1
  105. package/dist/components/vertex-viewer-button.d.ts +0 -11
  106. package/dist/components/vertex-viewer-button.js +0 -11
  107. package/dist/components/vertex-viewer-button.js.map +0 -1
  108. package/dist/components/vertex-viewer-default-toolbar.d.ts +0 -11
  109. package/dist/components/vertex-viewer-default-toolbar.js +0 -99
  110. package/dist/components/vertex-viewer-default-toolbar.js.map +0 -1
  111. package/dist/components/vertex-viewer-dom-element.d.ts +0 -11
  112. package/dist/components/vertex-viewer-dom-element.js +0 -11
  113. package/dist/components/vertex-viewer-dom-element.js.map +0 -1
  114. package/dist/components/vertex-viewer-dom-group.d.ts +0 -11
  115. package/dist/components/vertex-viewer-dom-group.js +0 -11
  116. package/dist/components/vertex-viewer-dom-group.js.map +0 -1
  117. package/dist/components/vertex-viewer-dom-renderer.d.ts +0 -11
  118. package/dist/components/vertex-viewer-dom-renderer.js +0 -11
  119. package/dist/components/vertex-viewer-dom-renderer.js.map +0 -1
  120. package/dist/components/vertex-viewer-hit-result-indicator.d.ts +0 -11
  121. package/dist/components/vertex-viewer-hit-result-indicator.js +0 -335
  122. package/dist/components/vertex-viewer-hit-result-indicator.js.map +0 -1
  123. package/dist/components/vertex-viewer-icon.d.ts +0 -11
  124. package/dist/components/vertex-viewer-icon.js +0 -11
  125. package/dist/components/vertex-viewer-icon.js.map +0 -1
  126. package/dist/components/vertex-viewer-layer.d.ts +0 -11
  127. package/dist/components/vertex-viewer-layer.js +0 -11
  128. package/dist/components/vertex-viewer-layer.js.map +0 -1
  129. package/dist/components/vertex-viewer-markup-arrow.d.ts +0 -11
  130. package/dist/components/vertex-viewer-markup-arrow.js +0 -11
  131. package/dist/components/vertex-viewer-markup-arrow.js.map +0 -1
  132. package/dist/components/vertex-viewer-markup-circle.d.ts +0 -11
  133. package/dist/components/vertex-viewer-markup-circle.js +0 -11
  134. package/dist/components/vertex-viewer-markup-circle.js.map +0 -1
  135. package/dist/components/vertex-viewer-markup-freeform.d.ts +0 -11
  136. package/dist/components/vertex-viewer-markup-freeform.js +0 -11
  137. package/dist/components/vertex-viewer-markup-freeform.js.map +0 -1
  138. package/dist/components/vertex-viewer-markup-tool.d.ts +0 -11
  139. package/dist/components/vertex-viewer-markup-tool.js +0 -257
  140. package/dist/components/vertex-viewer-markup-tool.js.map +0 -1
  141. package/dist/components/vertex-viewer-markup.d.ts +0 -11
  142. package/dist/components/vertex-viewer-markup.js +0 -362
  143. package/dist/components/vertex-viewer-markup.js.map +0 -1
  144. package/dist/components/vertex-viewer-measurement-details.d.ts +0 -11
  145. package/dist/components/vertex-viewer-measurement-details.js +0 -307
  146. package/dist/components/vertex-viewer-measurement-details.js.map +0 -1
  147. package/dist/components/vertex-viewer-measurement-distance.d.ts +0 -11
  148. package/dist/components/vertex-viewer-measurement-distance.js +0 -1067
  149. package/dist/components/vertex-viewer-measurement-distance.js.map +0 -1
  150. package/dist/components/vertex-viewer-measurement-line.d.ts +0 -11
  151. package/dist/components/vertex-viewer-measurement-line.js +0 -11
  152. package/dist/components/vertex-viewer-measurement-line.js.map +0 -1
  153. package/dist/components/vertex-viewer-measurement-overlays.d.ts +0 -11
  154. package/dist/components/vertex-viewer-measurement-overlays.js +0 -11
  155. package/dist/components/vertex-viewer-measurement-overlays.js.map +0 -1
  156. package/dist/components/vertex-viewer-measurement-precise.d.ts +0 -11
  157. package/dist/components/vertex-viewer-measurement-precise.js +0 -362
  158. package/dist/components/vertex-viewer-measurement-precise.js.map +0 -1
  159. package/dist/components/vertex-viewer-pin-group.d.ts +0 -11
  160. package/dist/components/vertex-viewer-pin-group.js +0 -11
  161. package/dist/components/vertex-viewer-pin-group.js.map +0 -1
  162. package/dist/components/vertex-viewer-pin-label-line.d.ts +0 -11
  163. package/dist/components/vertex-viewer-pin-label-line.js +0 -11
  164. package/dist/components/vertex-viewer-pin-label-line.js.map +0 -1
  165. package/dist/components/vertex-viewer-pin-label.d.ts +0 -11
  166. package/dist/components/vertex-viewer-pin-label.js +0 -11
  167. package/dist/components/vertex-viewer-pin-label.js.map +0 -1
  168. package/dist/components/vertex-viewer-pin-tool.d.ts +0 -11
  169. package/dist/components/vertex-viewer-pin-tool.js +0 -430
  170. package/dist/components/vertex-viewer-pin-tool.js.map +0 -1
  171. package/dist/components/vertex-viewer-spinner.d.ts +0 -11
  172. package/dist/components/vertex-viewer-spinner.js +0 -11
  173. package/dist/components/vertex-viewer-spinner.js.map +0 -1
  174. package/dist/components/vertex-viewer-toolbar-group.d.ts +0 -11
  175. package/dist/components/vertex-viewer-toolbar-group.js +0 -11
  176. package/dist/components/vertex-viewer-toolbar-group.js.map +0 -1
  177. package/dist/components/vertex-viewer-toolbar.d.ts +0 -11
  178. package/dist/components/vertex-viewer-toolbar.js +0 -11
  179. package/dist/components/vertex-viewer-toolbar.js.map +0 -1
  180. package/dist/components/vertex-viewer-transform-widget.d.ts +0 -11
  181. package/dist/components/vertex-viewer-transform-widget.js +0 -838
  182. package/dist/components/vertex-viewer-transform-widget.js.map +0 -1
  183. package/dist/components/vertex-viewer-view-cube.d.ts +0 -11
  184. package/dist/components/vertex-viewer-view-cube.js +0 -270
  185. package/dist/components/vertex-viewer-view-cube.js.map +0 -1
  186. package/dist/components/vertex-viewer.d.ts +0 -11
  187. package/dist/components/vertex-viewer.js +0 -3543
  188. package/dist/components/vertex-viewer.js.map +0 -1
  189. package/dist/components/viewer-button.js +0 -35
  190. package/dist/components/viewer-button.js.map +0 -1
  191. package/dist/components/viewer-dom-element.js +0 -250
  192. package/dist/components/viewer-dom-element.js.map +0 -1
  193. package/dist/components/viewer-dom-group.js +0 -214
  194. package/dist/components/viewer-dom-group.js.map +0 -1
  195. package/dist/components/viewer-dom-renderer.js +0 -295
  196. package/dist/components/viewer-dom-renderer.js.map +0 -1
  197. package/dist/components/viewer-icon.js +0 -87
  198. package/dist/components/viewer-icon.js.map +0 -1
  199. package/dist/components/viewer-layer.js +0 -46
  200. package/dist/components/viewer-layer.js.map +0 -1
  201. package/dist/components/viewer-markup-arrow.js +0 -235
  202. package/dist/components/viewer-markup-arrow.js.map +0 -1
  203. package/dist/components/viewer-markup-circle-components.js +0 -42
  204. package/dist/components/viewer-markup-circle-components.js.map +0 -1
  205. package/dist/components/viewer-markup-circle.js +0 -201
  206. package/dist/components/viewer-markup-circle.js.map +0 -1
  207. package/dist/components/viewer-markup-freeform.js +0 -251
  208. package/dist/components/viewer-markup-freeform.js.map +0 -1
  209. package/dist/components/viewer-measurement-line.js +0 -77
  210. package/dist/components/viewer-measurement-line.js.map +0 -1
  211. package/dist/components/viewer-measurement-overlays.js +0 -184
  212. package/dist/components/viewer-measurement-overlays.js.map +0 -1
  213. package/dist/components/viewer-pin-group.js +0 -207
  214. package/dist/components/viewer-pin-group.js.map +0 -1
  215. package/dist/components/viewer-pin-label-line.js +0 -43
  216. package/dist/components/viewer-pin-label-line.js.map +0 -1
  217. package/dist/components/viewer-pin-label.js +0 -427
  218. package/dist/components/viewer-pin-label.js.map +0 -1
  219. package/dist/components/viewer-spinner.js +0 -53
  220. package/dist/components/viewer-spinner.js.map +0 -1
  221. package/dist/components/viewer-toolbar-group.js +0 -42
  222. package/dist/components/viewer-toolbar-group.js.map +0 -1
  223. package/dist/components/viewer-toolbar.js +0 -61
  224. package/dist/components/viewer-toolbar.js.map +0 -1
  225. package/dist/components/viewport.js +0 -188
  226. package/dist/components/viewport.js.map +0 -1
  227. package/dist/components/wrappers_pb.js +0 -1926
  228. package/dist/components/wrappers_pb.js.map +0 -1
@@ -1,928 +0,0 @@
1
- /*!
2
- * Copyright (c) 2023 Vertex Software LLC. All rights reserved.
3
- */
4
- import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
5
- import { p as point } from './bundle.esm.js';
6
- import { c as __assign } from './tslib.es6.js';
7
- import { r as readDOM } from './stencil.js';
8
- import { i as isLoadedRow } from './row.js';
9
- import { E as EventDispatcher } from './browser.esm.js';
10
-
11
- function getSceneTreeViewportHeight(el) {
12
- return el.clientHeight;
13
- }
14
- function getSceneTreeContainsElement(el, other) {
15
- return el.contains(other);
16
- }
17
-
18
- /**
19
- * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
20
- */
21
- /**
22
- * Lower case as a function.
23
- */
24
- function lowerCase(str) {
25
- return str.toLowerCase();
26
- }
27
-
28
- // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
29
- var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
30
- // Remove all non-word characters.
31
- var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
32
- /**
33
- * Normalize the string into something other libraries can manipulate easier.
34
- */
35
- function noCase(input, options) {
36
- if (options === void 0) { options = {}; }
37
- var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
38
- var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
39
- var start = 0;
40
- var end = result.length;
41
- // Trim the delimiter from around the output string.
42
- while (result.charAt(start) === "\0")
43
- start++;
44
- while (result.charAt(end - 1) === "\0")
45
- end--;
46
- // Transform each token independently.
47
- return result.slice(start, end).split("\0").map(transform).join(delimiter);
48
- }
49
- /**
50
- * Replace `re` in the input string with the replacement value.
51
- */
52
- function replace(input, re, value) {
53
- if (re instanceof RegExp)
54
- return input.replace(re, value);
55
- return re.reduce(function (input, re) { return input.replace(re, value); }, input);
56
- }
57
-
58
- function pascalCaseTransform(input, index) {
59
- var firstChar = input.charAt(0);
60
- var lowerChars = input.substr(1).toLowerCase();
61
- if (index > 0 && firstChar >= "0" && firstChar <= "9") {
62
- return "_" + firstChar + lowerChars;
63
- }
64
- return "" + firstChar.toUpperCase() + lowerChars;
65
- }
66
- function pascalCase(input, options) {
67
- if (options === void 0) { options = {}; }
68
- return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
69
- }
70
-
71
- function camelCaseTransform(input, index) {
72
- if (index === 0)
73
- return input.toLowerCase();
74
- return pascalCaseTransform(input, index);
75
- }
76
- function camelCase(input, options) {
77
- if (options === void 0) { options = {}; }
78
- return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
79
- }
80
-
81
- const bindingRegEx = /{{(.+)}}/;
82
- class CollectionBinding {
83
- constructor(bindings) {
84
- this.bindings = bindings;
85
- }
86
- bind(data) {
87
- this.bindings.forEach((binding) => binding.bind(data));
88
- }
89
- }
90
- class NodeBinding {
91
- constructor(node, expr) {
92
- this.node = node;
93
- this.expr = expr;
94
- }
95
- }
96
- class TextNodeBinding extends NodeBinding {
97
- constructor(node, expr) {
98
- super(node, expr);
99
- }
100
- bind(data) {
101
- const newContent = replaceBindingString(data, this.expr);
102
- if (newContent !== this.node.textContent) {
103
- this.node.textContent = newContent;
104
- }
105
- }
106
- }
107
- class AttributeBinding extends NodeBinding {
108
- constructor(node, expr, attr) {
109
- super(node, expr);
110
- this.attr = attr;
111
- }
112
- bind(data) {
113
- const newValue = replaceBindingString(data, this.expr);
114
- const oldValue = this.node.getAttribute(this.attr);
115
- if (oldValue !== newValue) {
116
- this.node.setAttribute(this.attr, newValue);
117
- }
118
- }
119
- }
120
- class PropertyBinding extends NodeBinding {
121
- constructor(node, expr, prop) {
122
- super(node, expr);
123
- this.prop = prop;
124
- }
125
- bind(data) {
126
- const newValue = replaceBinding(data, this.expr);
127
- /* eslint-disable @typescript-eslint/no-explicit-any */
128
- const oldValue = this.node[this.prop];
129
- if (oldValue !== newValue) {
130
- this.node[this.prop] = newValue;
131
- }
132
- /* eslint-enable @typescript-eslint/no-explicit-any */
133
- }
134
- }
135
- class EventHandlerBinding extends NodeBinding {
136
- constructor(node, expr, eventName) {
137
- super(node, expr);
138
- this.eventName = eventName;
139
- }
140
- bind(data) {
141
- var _a;
142
- const path = extractBindingPath(this.expr);
143
- if (path != null) {
144
- (_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();
145
- const listener = getBindableValue(data, path, true);
146
- this.node.addEventListener(this.eventName, listener);
147
- this.disposable = {
148
- dispose: () => {
149
- this.node.removeEventListener(this.eventName, listener);
150
- },
151
- };
152
- }
153
- }
154
- }
155
- function generateBindings(node) {
156
- const bindings = [];
157
- if (node.nodeType === Node.ELEMENT_NODE) {
158
- const el = node;
159
- const bindableAttributes = getBindableAttributes(el);
160
- bindableAttributes.forEach((attr) => {
161
- if (attr.name.startsWith('event:')) {
162
- const eventName = camelCase(attr.name.replace('event:', ''));
163
- bindings.push(new EventHandlerBinding(el, attr.value, eventName));
164
- }
165
- else if (attr.name.startsWith('attr:')) {
166
- bindings.push(new AttributeBinding(el, attr.value, attr.name.replace('attr:', '')));
167
- }
168
- else if (attr.name.startsWith('prop:')) {
169
- const propName = camelCase(attr.name.replace('prop:', ''));
170
- bindings.push(new PropertyBinding(el, attr.value, propName));
171
- }
172
- });
173
- }
174
- else if (node.nodeType === Node.TEXT_NODE &&
175
- node.textContent != null &&
176
- bindingRegEx.test(node.textContent)) {
177
- bindings.push(new TextNodeBinding(node, node.textContent));
178
- }
179
- for (let i = 0; i < node.childNodes.length; i++) {
180
- bindings.push(...generateBindings(node.childNodes[i]));
181
- }
182
- return bindings;
183
- }
184
- function getBindableAttributes(element) {
185
- return Array.from(element.attributes).filter((attr) => bindingRegEx.test(attr.value));
186
- }
187
- function extractBindingPath(expr) {
188
- const result = bindingRegEx.exec(expr);
189
- return result != null ? result[1] : undefined;
190
- }
191
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
192
- function replaceBindingString(data, expr) {
193
- const path = extractBindingPath(expr);
194
- if (path != null) {
195
- const value = getBindableValue(data, path, true);
196
- return expr.replace(`{{${path}}}`, value === null || value === void 0 ? void 0 : value.toString());
197
- }
198
- else {
199
- return expr;
200
- }
201
- }
202
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
203
- function replaceBinding(data, expr) {
204
- const path = extractBindingPath(expr);
205
- if (path != null) {
206
- const value = getBindableValue(data, path, true);
207
- return value;
208
- }
209
- else {
210
- return expr;
211
- }
212
- }
213
- function getBindableValue(
214
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
215
- data, path, isHead = false
216
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
217
- ) {
218
- const [head, ...tail] = path.split('.');
219
- if (isHead && tail.length === 0) {
220
- return data;
221
- }
222
- else if (isHead && tail.length > 0) {
223
- return getBindableValue(data, tail.join('.'), false);
224
- }
225
- else {
226
- const value = data[head];
227
- if (tail.length > 0) {
228
- return getBindableValue(value, tail.join('.'), false);
229
- }
230
- else {
231
- return value;
232
- }
233
- }
234
- }
235
-
236
- class ElementPool {
237
- constructor(container, elementFactory) {
238
- this.container = container;
239
- this.elementFactory = elementFactory;
240
- this.instanceMap = new Map();
241
- this.elements = [];
242
- }
243
- swapHeadToTail(count) {
244
- const sliced = this.elements.splice(0, count);
245
- this.elements.splice(this.elements.length, 0, ...sliced);
246
- return this.elements.concat();
247
- }
248
- swapTailToHead(count) {
249
- const sliced = this.elements.splice(-count, count);
250
- this.elements.splice(0, 0, ...sliced);
251
- return this.elements.concat();
252
- }
253
- updateElements(count) {
254
- const diff = count - this.elements.length;
255
- if (diff > 0) {
256
- for (let i = 0; i < diff; i++) {
257
- this.createElement();
258
- }
259
- }
260
- else {
261
- for (let i = 0; i < -diff; i++) {
262
- this.deleteElement();
263
- }
264
- }
265
- return this.elements.concat();
266
- }
267
- updateData(f) {
268
- this.elements.forEach((el, i) => {
269
- const instance = this.instanceMap.get(el);
270
- const data = f(i);
271
- instance === null || instance === void 0 ? void 0 : instance.bindings.bind(data);
272
- });
273
- }
274
- updateElementFactory(elementFactory) {
275
- this.elementFactory = elementFactory;
276
- this.updateElements(0);
277
- }
278
- iterateElements(f) {
279
- this.elements.forEach((el, i) => {
280
- const instance = this.instanceMap.get(el);
281
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
282
- f(el, instance.bindings, i);
283
- });
284
- }
285
- createElement() {
286
- const instance = this.elementFactory();
287
- this.elements.push(instance.element);
288
- this.instanceMap.set(instance.element, instance);
289
- this.container.append(instance.element);
290
- return instance;
291
- }
292
- deleteElement() {
293
- const element = this.elements.pop();
294
- if (element != null) {
295
- this.instanceMap.delete(element);
296
- element.remove();
297
- }
298
- }
299
- }
300
- function generateInstanceFromTemplate(template) {
301
- const fragment = template.content.cloneNode(true);
302
- const element = fragment.firstElementChild;
303
- const bindings = new CollectionBinding(generateBindings(fragment));
304
- return { element, bindings };
305
- }
306
-
307
- function getSceneTreeTableOffsetTop(el) {
308
- var _a;
309
- return (_a = el.getBoundingClientRect().top) !== null && _a !== void 0 ? _a : 0;
310
- }
311
- function getSceneTreeTableViewportWidth(el) {
312
- return el.clientWidth;
313
- }
314
- function scrollToTop(el, top, options) {
315
- el.scrollTo(Object.assign({ top }, options));
316
- }
317
-
318
- class SceneTreeCellHoverController {
319
- constructor() {
320
- this.onStateChange = new EventDispatcher();
321
- }
322
- setHovered(id) {
323
- this.onStateChange.emit(id);
324
- }
325
- stateChanged(listener) {
326
- return this.onStateChange.on(listener);
327
- }
328
- }
329
-
330
- function restartTimeout(fn, existingTimeout, delay = 200) {
331
- window.clearTimeout(existingTimeout);
332
- return window.setTimeout(fn, delay);
333
- }
334
-
335
- const sceneTreeTableLayoutCss = ":host{position:relative;display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;font-size:0.825rem;--scene-tree-table-row-padding:2px 0px;--scene-tree-table-column-gap:0.5rem;--scene-tree-table-column-resize-cursor:col-resize}.header{position:relative;display:grid;width:100%;border-bottom:var(--scene-tree-toolbar-separator)}.table{position:relative;display:grid;width:100%;height:100%;overflow:auto}.resize-overlay{position:absolute;top:0;cursor:var(--scene-tree-table-column-resize-cursor);z-index:1000;width:100%;height:100%}.divider-overlay{position:absolute;top:0;display:grid;pointer-events:none;z-index:2000;width:100%;height:100%}";
336
-
337
- const SceneTreeTableLayout = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
338
- constructor() {
339
- super();
340
- this.__registerHost();
341
- this.__attachShadow();
342
- this.layoutRendered = createEvent(this, "layoutRendered", 7);
343
- /**
344
- * @internal
345
- */
346
- this.rows = [];
347
- /**
348
- * @internal
349
- */
350
- this.totalRows = 0;
351
- /**
352
- * @internal
353
- */
354
- this.rowHeight = 24;
355
- /**
356
- * The number of offscreen rows above and below the viewport to render. Having
357
- * a higher number reduces the chance of the browser not displaying a row
358
- * while scrolling.
359
- *
360
- * This prop will be automatically populated based on the `overScanCount` prop
361
- * specified in the parent `<vertex-scene-tree />` element.
362
- */
363
- this.overScanCount = 25;
364
- /**
365
- * @internal
366
- */
367
- this.layoutOffset = 0;
368
- /**
369
- * @internal
370
- */
371
- this.scrollOffset = 0;
372
- /**
373
- * @internal
374
- */
375
- this.viewportStartIndex = 0;
376
- /**
377
- * @internal
378
- */
379
- this.viewportEndIndex = 0;
380
- this.columnGridLayout = '1fr';
381
- this.columnGridFixedLayout = '';
382
- this.isComputingCellHeight = true;
383
- this.isScrolling = false;
384
- /**
385
- * This stores internal state that you want to preserve across live-reloads,
386
- * but shouldn't trigger a refresh if the data changes. Marking this with
387
- * @State to allow to preserve state across live-reloads.
388
- */
389
- this.stateMap = {
390
- viewportRows: [],
391
- columnWidths: [],
392
- columnWidthPercentages: [],
393
- };
394
- this.lastStartIndex = 0;
395
- this.columnElements = [];
396
- this.cellHoverController = new SceneTreeCellHoverController();
397
- this.layoutColumns = () => {
398
- const visibleRowCount = this.viewportEndIndex - this.viewportStartIndex + 1;
399
- const diff = this.viewportStartIndex - this.lastStartIndex;
400
- this.lastStartIndex = this.viewportStartIndex;
401
- this.iterateColumns((col, pool, colIndex) => {
402
- pool.updateElements(visibleRowCount);
403
- if (diff > 0) {
404
- pool.swapHeadToTail(diff);
405
- }
406
- else {
407
- pool.swapTailToHead(-diff);
408
- }
409
- col.style.minHeight = `${this.rowHeight * this.totalRows}px`;
410
- const cellPaddingLeft = colIndex === 0
411
- ? (depth) => `calc(${depth} * 0.5rem)`
412
- : () => `0`;
413
- pool.iterateElements((el, binding, rowIndex) => {
414
- const row = this.stateMap.viewportRows[rowIndex];
415
- if (isLoadedRow(row)) {
416
- this.updateCell(row, el, binding, rowIndex, cellPaddingLeft);
417
- }
418
- });
419
- });
420
- };
421
- this.updateCell = (row, cell, binding, rowIndex, cellPaddingLeft) => {
422
- cell.style.position = 'absolute';
423
- cell.style.top = `${(this.viewportStartIndex + rowIndex) * this.rowHeight}px`;
424
- cell.style.boxSizing = 'border-box';
425
- cell.style.height = `${this.rowHeight}px`;
426
- cell.style.width = '100%';
427
- cell.style.paddingLeft = cellPaddingLeft(row.node.depth);
428
- /* eslint-disable @typescript-eslint/no-explicit-any */
429
- cell.tree = this.tree;
430
- cell.node = row.node;
431
- cell.hoverController = this.cellHoverController;
432
- cell.isScrolling = this.isScrolling;
433
- /* eslint-enable @typescript-eslint/no-explicit-any */
434
- binding.bind(row);
435
- };
436
- this.updateLayoutPosition = () => {
437
- readDOM(() => {
438
- if (this.tableElement != null) {
439
- this.layoutOffset = getSceneTreeTableOffsetTop(this.tableElement);
440
- }
441
- });
442
- };
443
- this.recomputeColumnWidths = () => {
444
- const layoutWidth = this.getLayoutWidth();
445
- if (layoutWidth != null &&
446
- this.stateMap.columnWidths.length ===
447
- this.stateMap.columnWidthPercentages.length) {
448
- this.stateMap.columnWidths = this.stateMap.columnWidthPercentages.map((w) => w * layoutWidth);
449
- }
450
- };
451
- this.recomputeColumnPercentages = () => {
452
- const layoutWidth = this.getLayoutWidth();
453
- if (layoutWidth != null &&
454
- this.stateMap.columnWidths.length ===
455
- this.stateMap.columnWidthPercentages.length) {
456
- this.stateMap.columnWidthPercentages = this.stateMap.columnWidths.map((w) => w / layoutWidth);
457
- }
458
- };
459
- this.computeInitialColumnWidths = () => {
460
- this.stateMap.columnWidths = this.columnElements.map((c) => { var _a; return (_a = c.initialWidth) !== null && _a !== void 0 ? _a : 100; });
461
- const layoutWidth = this.getLayoutWidth();
462
- if (layoutWidth != null) {
463
- this.stateMap.columnWidthPercentages = this.columnElements.map((c) => { var _a; return ((_a = c.initialWidth) !== null && _a !== void 0 ? _a : 100) / layoutWidth; });
464
- }
465
- };
466
- this.updateColumnElements = () => {
467
- this.columnElements = Array.from(this.hostEl.querySelectorAll('vertex-scene-tree-table-column'));
468
- };
469
- this.computeCellHeight = async () => {
470
- var _a;
471
- if (this.isComputingCellHeight && this.columnElements.length > 0) {
472
- const dummyData = {
473
- index: 0,
474
- node: {
475
- id: { hex: '' },
476
- name: 'Dummy row',
477
- expanded: false,
478
- selected: false,
479
- visible: false,
480
- partiallyVisible: false,
481
- isLeaf: false,
482
- depth: 0,
483
- columnsList: [],
484
- filterHit: false,
485
- phantom: false,
486
- endItem: false,
487
- },
488
- metadata: {},
489
- data: {},
490
- };
491
- const { bindings, element } = this.createColumnCellInstance(this.columnElements[0]);
492
- bindings.bind(dummyData);
493
- element.style.visibility = 'hidden';
494
- (_a = this.columnElements[0]) === null || _a === void 0 ? void 0 : _a.appendChild(element);
495
- /* eslint-disable @typescript-eslint/no-explicit-any */
496
- if (typeof element.componentOnReady === 'function') {
497
- await element.componentOnReady();
498
- }
499
- /* eslint-enable @typescript-eslint/no-explicit-any */
500
- let height = element.clientHeight;
501
- let attempts = 0;
502
- while (height === 0 && attempts < 10) {
503
- height = await new Promise((resolve) => {
504
- setTimeout(() => resolve(element.getBoundingClientRect().height), 5);
505
- });
506
- attempts = attempts + 1;
507
- }
508
- this.rowHeight = height !== null && height !== void 0 ? height : this.rowHeight;
509
- element.remove();
510
- this.isComputingCellHeight = this.rowHeight === 0;
511
- }
512
- };
513
- this.computeHeaderHeight = () => {
514
- var _a;
515
- if (this.stateMap.headerHeight == null) {
516
- this.stateMap.headerHeight =
517
- (_a = this.headerElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
518
- this.hostEl.style.setProperty('--header-height', `${this.stateMap.headerHeight}px`);
519
- }
520
- };
521
- this.computeColumnGridLayout = () => {
522
- if (this.stateMap.columnWidths.length === 0) {
523
- this.stateMap.columnWidths = this.columnElements.map((c) => { var _a; return (_a = c.initialWidth) !== null && _a !== void 0 ? _a : 100; });
524
- }
525
- const layoutWidth = this.getLayoutWidth();
526
- if (layoutWidth != null) {
527
- if (this.stateMap.columnWidthPercentages.length === 0) {
528
- this.stateMap.columnWidthPercentages = this.columnElements.map((c) => { var _a; return ((_a = c.initialWidth) !== null && _a !== void 0 ? _a : 100) / layoutWidth; });
529
- }
530
- }
531
- /**
532
- * This layout uses `1fr` instead of the final column width to
533
- * allow the final column to shrink when a scrollbar appears.
534
- *
535
- * This flex behavior is not desired for the header and divider
536
- * elements since they are not scrollable, and `columnGridFixedLayout`
537
- * should be used instead.
538
- */
539
- this.columnGridLayout = `${this.stateMap.columnWidths
540
- .slice(0, -1)
541
- .reduce((res, w) => `${res} ${w}px`, '')} 1fr`;
542
- this.columnGridFixedLayout = `${this.stateMap.columnWidths.reduce((res, w) => `${res} ${w}px`, '')}`;
543
- };
544
- this.bindHeaderData = () => {
545
- if (this.stateMap.headerInstances == null) {
546
- this.stateMap.headerInstances = this.columnElements
547
- .map((c, i) => {
548
- var _a;
549
- const instance = this.createHeaderInstance(c);
550
- if (instance != null) {
551
- instance.element.style.paddingRight =
552
- i === this.columnElements.length - 1
553
- ? `0`
554
- : `var(--scene-tree-table-column-gap)`;
555
- instance.element.slot = 'header';
556
- instance.element.style.gridColumnStart = `${i + 1}`;
557
- instance.element.style.gridColumnEnd = `${i + 2}`;
558
- (_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.appendChild(instance.element);
559
- }
560
- return instance;
561
- })
562
- .filter((i) => i != null);
563
- }
564
- if (this.stateMap.headerDividerInstances == null) {
565
- this.stateMap.headerDividerInstances = this.columnElements
566
- .slice(0, -1)
567
- .map((_, i) => {
568
- var _a;
569
- const instance = this.createDividerInstance();
570
- instance.element.slot = 'divider';
571
- instance.element.style.position = 'absolute';
572
- instance.element.style.right = '0';
573
- instance.element.style.pointerEvents = 'auto';
574
- instance.element.style.gridColumnStart = `${i + 1}`;
575
- instance.element.style.gridColumnEnd = `${i + 2}`;
576
- (_a = this.hostEl) === null || _a === void 0 ? void 0 : _a.appendChild(instance.element);
577
- return instance;
578
- });
579
- }
580
- };
581
- this.rebindHeaderData = () => {
582
- var _a, _b;
583
- this.removeDividerDragListeners();
584
- (_a = this.stateMap.headerInstances) === null || _a === void 0 ? void 0 : _a.forEach((i) => i.element.remove());
585
- (_b = this.stateMap.headerDividerInstances) === null || _b === void 0 ? void 0 : _b.forEach((i) => i.element.remove());
586
- this.stateMap.headerInstances = undefined;
587
- this.stateMap.headerDividerInstances = undefined;
588
- this.bindHeaderData();
589
- this.addDividerDragListeners();
590
- };
591
- this.createDividerPointerDownHandler = (index) => {
592
- return (event) => {
593
- var _a, _b;
594
- event.preventDefault();
595
- event.stopPropagation();
596
- this.lastDividerPointerPosition = point.create(Math.floor(event.clientX), Math.floor(event.clientY));
597
- this.resizingColumnIndex = index;
598
- (_b = (_a = this.stateMap.headerDividerInstances) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.element.classList.add('dragging');
599
- window.addEventListener('pointermove', this.handleDividerPointerMove);
600
- window.addEventListener('pointerup', this.handleDividerPointerUp);
601
- };
602
- };
603
- this.handleDividerPointerMove = (event) => {
604
- const current = point.create(Math.floor(event.clientX), Math.floor(event.clientY));
605
- if (this.lastDividerPointerPosition != null &&
606
- this.resizingColumnIndex != null) {
607
- const diff = point.subtract(this.lastDividerPointerPosition, current);
608
- if (Math.abs(diff.x) >= 1 &&
609
- this.isValidResize(diff, this.resizingColumnIndex)) {
610
- this.stateMap.columnWidths[this.resizingColumnIndex] -= diff.x;
611
- if (this.resizingColumnIndex + 1 < this.stateMap.columnWidths.length) {
612
- this.stateMap.columnWidths[this.resizingColumnIndex + 1] += diff.x;
613
- }
614
- this.lastDividerPointerPosition = current;
615
- this.computeColumnGridLayout();
616
- }
617
- }
618
- };
619
- this.handleDividerPointerUp = () => {
620
- var _a, _b;
621
- if (this.resizingColumnIndex != null) {
622
- (_b = (_a = this.stateMap.headerDividerInstances) === null || _a === void 0 ? void 0 : _a[this.resizingColumnIndex]) === null || _b === void 0 ? void 0 : _b.element.classList.remove('dragging');
623
- }
624
- this.lastDividerPointerPosition = undefined;
625
- this.resizingColumnIndex = undefined;
626
- this.recomputeColumnPercentages();
627
- window.removeEventListener('pointermove', this.handleDividerPointerMove);
628
- window.removeEventListener('pointerup', this.handleDividerPointerUp);
629
- };
630
- this.isValidResize = (diff, index) => {
631
- var _a, _b, _c, _d;
632
- const currentColumn = this.columnElements[index];
633
- const nextColumn = this.columnElements[index + 1];
634
- const currentWidth = this.stateMap.columnWidths[index];
635
- const nextWidth = this.stateMap.columnWidths[index + 1];
636
- const currentMinWidth = (_a = currentColumn.minWidth) !== null && _a !== void 0 ? _a : 0;
637
- const currentMaxWidth = (_b = currentColumn.maxWidth) !== null && _b !== void 0 ? _b : Number.MAX_SAFE_INTEGER;
638
- const nextMinWidth = (_c = nextColumn.minWidth) !== null && _c !== void 0 ? _c : 0;
639
- const nextMaxWidth = (_d = nextColumn.maxWidth) !== null && _d !== void 0 ? _d : Number.MAX_SAFE_INTEGER;
640
- const currentIsValid = currentWidth - diff.x > currentMinWidth &&
641
- currentWidth - diff.x < currentMaxWidth;
642
- const nextIsValid = nextColumn != null
643
- ? nextWidth + diff.x > nextMinWidth && nextWidth + diff.x < nextMaxWidth
644
- : true;
645
- return currentIsValid && nextIsValid;
646
- };
647
- this.handleScrollChanged = (event) => {
648
- this.isScrolling = true;
649
- this.scrollTimer = restartTimeout(() => {
650
- this.isScrolling = false;
651
- }, this.scrollTimer);
652
- this.scrollOffset = event.target.scrollTop;
653
- this.computeAndUpdateViewportRows();
654
- };
655
- }
656
- componentWillLoad() {
657
- this.updateColumnElements();
658
- this.createPools();
659
- this.headerResizeObserver = new ResizeObserver(() => {
660
- this.stateMap.headerHeight = undefined;
661
- this.computeHeaderHeight();
662
- this.updateLayoutPosition();
663
- });
664
- this.resizeObserver = new ResizeObserver(() => {
665
- this.updateLayoutPosition();
666
- this.clearLayoutHeight();
667
- this.clearLayoutWidth();
668
- this.recomputeColumnWidths();
669
- this.computeColumnGridLayout();
670
- });
671
- }
672
- componentDidLoad() {
673
- var _a, _b, _c;
674
- this.computeColumnGridLayout();
675
- this.ensureDividerTemplateDefined();
676
- this.computeCellHeight();
677
- this.computeHeaderHeight();
678
- this.computeInitialColumnWidths();
679
- this.rebindHeaderData();
680
- (_a = this.tableElement) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', this.handleScrollChanged, {
681
- passive: true,
682
- });
683
- if (this.headerElement != null) {
684
- (_b = this.headerResizeObserver) === null || _b === void 0 ? void 0 : _b.observe(this.headerElement);
685
- }
686
- (_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.observe(this.hostEl);
687
- }
688
- async componentWillRender() {
689
- await this.computeAndUpdateViewportRows();
690
- }
691
- componentDidRender() {
692
- this.layoutColumns();
693
- this.layoutRendered.emit();
694
- }
695
- disconnectedCallback() {
696
- var _a, _b, _c;
697
- (_a = this.tableElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', this.handleScrollChanged);
698
- this.removeDividerDragListeners();
699
- (_b = this.headerResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
700
- (_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
701
- this.stateMap.columnWidths = [];
702
- this.stateMap.columnWidthPercentages = [];
703
- }
704
- async handleViewportRowsPropsChanged() {
705
- if (this.isComputingCellHeight) {
706
- await this.computeCellHeight();
707
- }
708
- await this.computeAndUpdateViewportRows();
709
- }
710
- /**
711
- * Scrolls the table to the provided top value.
712
- *
713
- * @param top The position to scroll to.
714
- * @param options A set of options to configure the scrolling behavior.
715
- */
716
- async scrollToPosition(top, options) {
717
- if (this.tableElement != null) {
718
- scrollToTop(this.tableElement, top, options);
719
- }
720
- }
721
- render() {
722
- return (h(Host, null, h("div", { class: "header", ref: (ref) => (this.headerElement = ref), style: {
723
- gridTemplateColumns: this.columnGridFixedLayout,
724
- display: this.columnElements.length <= 1 ? 'none' : 'grid',
725
- } }, h("slot", { name: "header" })), h("div", { class: "table", ref: (ref) => (this.tableElement = ref), style: {
726
- gridTemplateColumns: this.columnGridLayout,
727
- } }, h("slot", { onSlotchange: () => {
728
- this.ensureDividerTemplateDefined();
729
- this.updateColumnElements();
730
- this.recreateColumnPools();
731
- this.computeInitialColumnWidths();
732
- this.rebindHeaderData();
733
- this.computeColumnGridLayout();
734
- } })), h("div", { class: "divider-overlay", style: {
735
- gridTemplateColumns: this.columnGridFixedLayout,
736
- } }, h("slot", { name: "divider" })), this.resizingColumnIndex != null && h("div", { class: "resize-overlay" })));
737
- }
738
- computeViewportRows() {
739
- const viewportHeight = this.getLayoutHeight();
740
- if (viewportHeight != null) {
741
- const viewportCount = Math.ceil(viewportHeight / this.rowHeight);
742
- const viewportStartIndex = Math.floor(this.scrollOffset / this.rowHeight);
743
- const viewportEndIndex = viewportStartIndex + viewportCount;
744
- const startIndex = Math.max(0, viewportStartIndex - this.overScanCount);
745
- const endIndex = Math.min(this.totalRows - 1, viewportEndIndex + this.overScanCount);
746
- const rows = this.getViewportRows(startIndex, endIndex);
747
- this.viewportStartIndex = startIndex;
748
- this.viewportEndIndex = endIndex;
749
- this.stateMap.viewportRows = rows;
750
- }
751
- }
752
- async computeAndUpdateViewportRows() {
753
- var _a;
754
- this.computeViewportRows();
755
- if (((_a = this.controller) === null || _a === void 0 ? void 0 : _a.isConnected) && this.totalRows > 0) {
756
- await this.controller.updateActiveRowRange(this.viewportStartIndex, this.viewportEndIndex);
757
- }
758
- }
759
- createPools() {
760
- if (this.stateMap.columnElementPools == null) {
761
- this.stateMap.columnElementPools = this.columnElements.reduce((map, c) => map.set(c, new ElementPool(c, () => this.createColumnCellInstance(c))), new WeakMap());
762
- }
763
- }
764
- recreateColumnPools() {
765
- this.columnElements.forEach((c) => {
766
- var _a, _b, _c;
767
- if (((_a = this.stateMap.columnElementPools) === null || _a === void 0 ? void 0 : _a.get(c)) == null) {
768
- (_b = this.stateMap.columnElementPools) === null || _b === void 0 ? void 0 : _b.set(c, new ElementPool(c, () => this.createColumnCellInstance(c)));
769
- }
770
- else {
771
- (_c = this.stateMap.columnElementPools
772
- .get(c)) === null || _c === void 0 ? void 0 : _c.updateElementFactory(() => this.createColumnCellInstance(c));
773
- }
774
- });
775
- }
776
- iterateColumns(f) {
777
- this.columnElements.forEach((column, i) => {
778
- var _a;
779
- const pool = (_a = this.stateMap.columnElementPools) === null || _a === void 0 ? void 0 : _a.get(column);
780
- if (pool != null) {
781
- f(column, pool, i);
782
- }
783
- else {
784
- throw new Error('Cannot find pool for column');
785
- }
786
- });
787
- }
788
- ensureDividerTemplateDefined() {
789
- const template = this.hostEl.querySelector('template[slot="divider"]');
790
- if (template == null) {
791
- const defaultDividerTemplate = document.createElement('template');
792
- defaultDividerTemplate.slot = 'divider';
793
- defaultDividerTemplate.innerHTML = `
794
- <vertex-scene-tree-table-resize-divider slot="divider">
795
- </vertex-scene-tree-table-resize-divider>
796
- `;
797
- this.hostEl.appendChild(defaultDividerTemplate);
798
- }
799
- }
800
- createHeaderInstance(column) {
801
- const template = column.querySelector('template[slot="header"]');
802
- if (template != null) {
803
- return generateInstanceFromTemplate(template);
804
- }
805
- }
806
- createDividerInstance() {
807
- const template = this.hostEl.querySelector('template[slot="divider"]');
808
- if (template != null) {
809
- return generateInstanceFromTemplate(template);
810
- }
811
- else {
812
- throw new Error('Table is missing divider template element');
813
- }
814
- }
815
- createColumnCellInstance(column) {
816
- const template = column.querySelector('template:not([slot="header"])');
817
- if (template != null) {
818
- return generateInstanceFromTemplate(template);
819
- }
820
- else {
821
- throw new Error('Column is missing cell template element');
822
- }
823
- }
824
- addDividerDragListeners() {
825
- var _a;
826
- this.stateMap.headerDividerListeners =
827
- (_a = this.stateMap.headerDividerInstances) === null || _a === void 0 ? void 0 : _a.map((d, i) => {
828
- const listener = this.createDividerPointerDownHandler(i);
829
- d.element.addEventListener('pointerdown', listener);
830
- return listener;
831
- });
832
- }
833
- removeDividerDragListeners() {
834
- var _a;
835
- if (this.stateMap.headerDividerListeners != null) {
836
- const listeners = this.stateMap.headerDividerListeners;
837
- (_a = this.stateMap.headerDividerInstances) === null || _a === void 0 ? void 0 : _a.forEach((d, i) => {
838
- const listener = listeners[i];
839
- if (listener != null) {
840
- d.element.removeEventListener('pointerdown', listener);
841
- }
842
- });
843
- this.stateMap.headerDividerListeners = undefined;
844
- }
845
- }
846
- getViewportRows(startIndex, endIndex) {
847
- const rows = this.rows.slice(startIndex, endIndex + 1);
848
- return rows.map((row) => (row != null ? this.populateRowData(row) : row));
849
- }
850
- populateRowData(row) {
851
- var _a;
852
- if (this.rowData != null && row != null) {
853
- const data = ((_a = this.rowData) === null || _a === void 0 ? void 0 : _a.call(this, row)) || {};
854
- return Object.assign(Object.assign({}, row), { data });
855
- }
856
- else {
857
- return row;
858
- }
859
- }
860
- getLayoutHeight() {
861
- if (this.layoutHeight == null && this.tableElement != null) {
862
- this.layoutHeight = getSceneTreeViewportHeight(this.tableElement);
863
- }
864
- return this.layoutHeight;
865
- }
866
- getLayoutWidth() {
867
- if (this.layoutWidth == null) {
868
- const computedWidth = getSceneTreeTableViewportWidth(this.hostEl);
869
- if (computedWidth > 0) {
870
- this.layoutWidth = computedWidth;
871
- }
872
- }
873
- return this.layoutWidth;
874
- }
875
- clearLayoutHeight() {
876
- this.layoutHeight = undefined;
877
- }
878
- clearLayoutWidth() {
879
- this.layoutWidth = undefined;
880
- }
881
- get hostEl() { return this; }
882
- static get watchers() { return {
883
- "rows": ["handleViewportRowsPropsChanged"],
884
- "totalRows": ["handleViewportRowsPropsChanged"],
885
- "rowHeight": ["handleViewportRowsPropsChanged"]
886
- }; }
887
- static get style() { return sceneTreeTableLayoutCss; }
888
- }, [1, "vertex-scene-tree-table-layout", {
889
- "tree": [16],
890
- "controller": [16],
891
- "rows": [16],
892
- "totalRows": [2, "total-rows"],
893
- "rowHeight": [1026, "row-height"],
894
- "overScanCount": [2, "over-scan-count"],
895
- "rowData": [16],
896
- "layoutOffset": [1026, "layout-offset"],
897
- "scrollOffset": [1026, "scroll-offset"],
898
- "layoutHeight": [1026, "layout-height"],
899
- "layoutWidth": [1026, "layout-width"],
900
- "viewportStartIndex": [1026, "viewport-start-index"],
901
- "viewportEndIndex": [1026, "viewport-end-index"],
902
- "columnGridLayout": [32],
903
- "columnGridFixedLayout": [32],
904
- "isComputingCellHeight": [32],
905
- "lastDividerPointerPosition": [32],
906
- "resizingColumnIndex": [32],
907
- "isScrolling": [32],
908
- "scrollTimer": [32],
909
- "stateMap": [32],
910
- "scrollToPosition": [64]
911
- }]);
912
- function defineCustomElement() {
913
- if (typeof customElements === "undefined") {
914
- return;
915
- }
916
- const components = ["vertex-scene-tree-table-layout"];
917
- components.forEach(tagName => { switch (tagName) {
918
- case "vertex-scene-tree-table-layout":
919
- if (!customElements.get(tagName)) {
920
- customElements.define(tagName, SceneTreeTableLayout);
921
- }
922
- break;
923
- } });
924
- }
925
-
926
- export { SceneTreeTableLayout as S, defineCustomElement as d, getSceneTreeContainsElement as g };
927
-
928
- //# sourceMappingURL=scene-tree-table-layout.js.map