@vertexvis/ui 0.1.0-testing.8 → 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.
Files changed (185) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{color-circle-picker-13396ec4.js → color-circle-picker-d0403f1c.js} +2 -2
  3. package/dist/cjs/color-picker-2a4820fa.js +46 -0
  4. package/dist/cjs/{color-circle-05be54bf.js → color-swatch-8aaf6c0b.js} +42 -17
  5. package/dist/cjs/components.cjs.js +1 -1
  6. package/dist/cjs/{dialog-88e2308a.js → dialog-34f1dd6e.js} +1 -1
  7. package/dist/cjs/dom-a2c535e3.js +17 -0
  8. package/dist/cjs/{icon-460fd0f5.js → icon-3b1349ea.js} +1 -1
  9. package/dist/cjs/{icon-button-786427d6.js → icon-button-19061994.js} +1 -1
  10. package/dist/cjs/{icon-helper-ba408f49.js → icon-helper-cb479ba1.js} +107 -0
  11. package/dist/cjs/index.cjs.js +18 -12
  12. package/dist/cjs/lib-1bd1e383.js +9 -0
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/{search-bar-91cbcd07.js → search-bar-2e7ee35a.js} +130 -24
  15. package/dist/cjs/{select-5f8aecfe.js → select-2b2bdb97.js} +1 -1
  16. package/dist/cjs/{slider-13594e49.js → slider-7714cccb.js} +7 -1
  17. package/dist/cjs/tab-4335cd8f.js +26 -0
  18. package/dist/cjs/tabs-6f3e76e1.js +111 -0
  19. package/dist/cjs/{tooltip-e9f63631.js → tooltip-9d097c55.js} +2 -5
  20. package/dist/cjs/vertex-color-circle-picker.cjs.entry.js +1 -1
  21. package/dist/cjs/vertex-color-picker.cjs.entry.js +2 -1
  22. package/dist/cjs/vertex-color-swatch.cjs.entry.js +12 -0
  23. package/dist/cjs/vertex-dialog.cjs.entry.js +1 -1
  24. package/dist/cjs/vertex-icon-button.cjs.entry.js +2 -2
  25. package/dist/cjs/vertex-icon.cjs.entry.js +2 -2
  26. package/dist/cjs/vertex-search-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/vertex-select.cjs.entry.js +1 -1
  28. package/dist/cjs/vertex-slider.cjs.entry.js +2 -1
  29. package/dist/cjs/{vertex-color-circle.cjs.entry.js → vertex-tab.cjs.entry.js} +3 -2
  30. package/dist/cjs/vertex-tabs.cjs.entry.js +12 -0
  31. package/dist/cjs/vertex-tooltip.cjs.entry.js +2 -1
  32. package/dist/collection/collection-manifest.json +4 -2
  33. package/dist/collection/components/color-circle-picker/color-circle-picker.js +8 -8
  34. package/dist/collection/components/color-picker/color-picker.css +95 -15
  35. package/dist/collection/components/color-picker/color-picker.js +57 -3
  36. package/dist/collection/components/color-swatch/color-swatch.css +43 -0
  37. package/dist/collection/components/{color-circle/color-circle.js → color-swatch/color-swatch.js} +96 -23
  38. package/dist/collection/components/color-swatch/lib.js +5 -0
  39. package/dist/collection/components/dialog/dialog.css +0 -1
  40. package/dist/collection/components/icon/icon-helper.js +51 -0
  41. package/dist/collection/components/icon/icon.js +1 -1
  42. package/dist/collection/components/icon/icons/arrow-left-circled.js +2 -0
  43. package/dist/collection/components/icon/icons/arrow-right-circled.js +2 -0
  44. package/dist/collection/components/icon/icons/camera-add.js +2 -0
  45. package/dist/collection/components/icon/icons/caution.js +2 -0
  46. package/dist/collection/components/icon/icons/columns-add.js +2 -0
  47. package/dist/collection/components/icon/icons/compare.js +2 -0
  48. package/dist/collection/components/icon/icons/compress.js +2 -0
  49. package/dist/collection/components/icon/icons/cube-stack.js +2 -0
  50. package/dist/collection/components/icon/icons/expand.js +2 -0
  51. package/dist/collection/components/icon/icons/file-folder.js +2 -0
  52. package/dist/collection/components/icon/icons/pin-text-square.js +2 -0
  53. package/dist/collection/components/icon/icons/plus-with-arrow.js +2 -0
  54. package/dist/collection/components/icon/icons/pmi.js +2 -0
  55. package/dist/collection/components/icon/icons/report.js +2 -0
  56. package/dist/collection/components/icon/icons/square-dot-outline.js +2 -0
  57. package/dist/collection/components/icon/icons/update.js +2 -0
  58. package/dist/collection/components/icon/icons/views.js +2 -0
  59. package/dist/collection/components/icon-button/icon-button.js +1 -1
  60. package/dist/collection/components/index.js +3 -1
  61. package/dist/collection/components/search-bar/dom.js +17 -0
  62. package/dist/collection/components/search-bar/lib.js +45 -4
  63. package/dist/collection/components/search-bar/search-bar.js +76 -23
  64. package/dist/collection/components/select/select.css +8 -0
  65. package/dist/collection/components/slider/slider.js +8 -2
  66. package/dist/collection/components/tab/tab.css +16 -0
  67. package/dist/collection/components/tab/tab.js +85 -0
  68. package/dist/collection/components/tab/util.js +3 -0
  69. package/dist/collection/components/tabs/tabs.css +67 -0
  70. package/dist/collection/components/tabs/tabs.js +159 -0
  71. package/dist/collection/types/icon.js +17 -0
  72. package/dist/collection/util/components/dom.js +3 -0
  73. package/dist/components/components.css +1 -1
  74. package/dist/components/components.esm.js +1 -1
  75. package/dist/components/index.esm.js +1 -1
  76. package/dist/components/p-01d4be1d.entry.js +1 -0
  77. package/dist/components/{p-165aed7d.js → p-0d4a0d61.js} +1 -1
  78. package/dist/components/p-18ed73e9.js +1 -0
  79. package/dist/components/p-1d08dd79.entry.js +1 -0
  80. package/dist/components/p-2ae8175d.entry.js +1 -0
  81. package/dist/components/p-2b4aedaa.entry.js +1 -0
  82. package/dist/components/p-3438c441.js +1 -0
  83. package/dist/components/{p-912f6e24.js → p-4327deea.js} +1 -1
  84. package/dist/components/p-45848878.js +1 -0
  85. package/dist/components/p-48629bf1.js +1 -0
  86. package/dist/components/{p-103249b4.js → p-5384f198.js} +1 -1
  87. package/dist/components/p-655053df.js +1 -0
  88. package/dist/components/p-65f9817e.js +1 -0
  89. package/dist/components/p-6a49c365.entry.js +1 -0
  90. package/dist/components/p-6b6c2260.js +1 -0
  91. package/dist/components/p-6ff20817.js +1 -0
  92. package/dist/components/{p-ca52a423.js → p-7bd92281.js} +1 -1
  93. package/dist/components/p-8bbc344d.entry.js +1 -0
  94. package/dist/components/p-8d83dfff.entry.js +1 -0
  95. package/dist/components/p-96f55673.js +1 -0
  96. package/dist/components/{p-9374ef6c.js → p-b9dab446.js} +1 -1
  97. package/dist/components/p-c6841378.entry.js +1 -0
  98. package/dist/components/p-cbfc041e.entry.js +1 -0
  99. package/dist/components/p-d2d75bcf.entry.js +1 -0
  100. package/dist/components/p-d539f530.js +1 -0
  101. package/dist/components/p-decf635f.entry.js +1 -0
  102. package/dist/components/p-e35057b5.entry.js +1 -0
  103. package/dist/esm/{color-circle-picker-998a7e9c.js → color-circle-picker-35ad3b3e.js} +2 -2
  104. package/dist/esm/color-picker-1d67effe.js +44 -0
  105. package/dist/esm/{color-circle-842f3321.js → color-swatch-0e62d13d.js} +42 -17
  106. package/dist/esm/components.js +1 -1
  107. package/dist/esm/{dialog-e3f49527.js → dialog-1cef715c.js} +1 -1
  108. package/dist/esm/dom-9d0f7bf4.js +13 -0
  109. package/dist/esm/{icon-d37150b4.js → icon-bf8df898.js} +1 -1
  110. package/dist/esm/{icon-button-aad3c0e7.js → icon-button-a4bdeabc.js} +1 -1
  111. package/dist/esm/{icon-helper-83f10f73.js → icon-helper-94d45002.js} +107 -0
  112. package/dist/esm/index.js +15 -11
  113. package/dist/esm/lib-73fbca8b.js +7 -0
  114. package/dist/esm/loader.js +1 -1
  115. package/dist/esm/{search-bar-f12a3599.js → search-bar-8d18626e.js} +130 -24
  116. package/dist/esm/{select-d4e135b7.js → select-78aeff96.js} +1 -1
  117. package/dist/esm/{slider-dcdb388f.js → slider-3d8545e3.js} +8 -2
  118. package/dist/esm/tab-c76332b0.js +24 -0
  119. package/dist/esm/tabs-e9f6dcbe.js +109 -0
  120. package/dist/esm/{tooltip-933da261.js → tooltip-db8ebd41.js} +1 -4
  121. package/dist/esm/vertex-color-circle-picker.entry.js +1 -1
  122. package/dist/esm/vertex-color-picker.entry.js +2 -1
  123. package/dist/esm/vertex-color-swatch.entry.js +4 -0
  124. package/dist/esm/vertex-dialog.entry.js +1 -1
  125. package/dist/esm/vertex-icon-button.entry.js +2 -2
  126. package/dist/esm/vertex-icon.entry.js +2 -2
  127. package/dist/esm/vertex-search-bar.entry.js +1 -1
  128. package/dist/esm/vertex-select.entry.js +1 -1
  129. package/dist/esm/vertex-slider.entry.js +2 -1
  130. package/dist/esm/vertex-tab.entry.js +3 -0
  131. package/dist/esm/vertex-tabs.entry.js +4 -0
  132. package/dist/esm/vertex-tooltip.entry.js +2 -1
  133. package/dist/types/components/color-circle-picker/color-circle-picker.d.ts +7 -7
  134. package/dist/types/components/color-picker/color-picker.d.ts +19 -0
  135. package/dist/types/components/{color-circle/color-circle.d.ts → color-swatch/color-swatch.d.ts} +23 -5
  136. package/dist/types/components/color-swatch/lib.d.ts +1 -0
  137. package/dist/types/components/icon/icons/arrow-left-circled.d.ts +3 -0
  138. package/dist/types/components/icon/icons/arrow-right-circled.d.ts +3 -0
  139. package/dist/types/components/icon/icons/camera-add.d.ts +3 -0
  140. package/dist/types/components/icon/icons/caution.d.ts +3 -0
  141. package/dist/types/components/icon/icons/columns-add.d.ts +3 -0
  142. package/dist/types/components/icon/icons/compare.d.ts +3 -0
  143. package/dist/types/components/icon/icons/compress.d.ts +3 -0
  144. package/dist/types/components/icon/icons/cube-stack.d.ts +3 -0
  145. package/dist/types/components/icon/icons/expand.d.ts +3 -0
  146. package/dist/types/components/icon/icons/file-folder.d.ts +3 -0
  147. package/dist/types/components/icon/icons/pin-text-square.d.ts +3 -0
  148. package/dist/types/components/icon/icons/plus-with-arrow.d.ts +3 -0
  149. package/dist/types/components/icon/icons/pmi.d.ts +3 -0
  150. package/dist/types/components/icon/icons/report.d.ts +3 -0
  151. package/dist/types/components/icon/icons/square-dot-outline.d.ts +3 -0
  152. package/dist/types/components/icon/icons/update.d.ts +3 -0
  153. package/dist/types/components/icon/icons/views.d.ts +3 -0
  154. package/dist/types/components/index.d.ts +3 -1
  155. package/dist/types/components/search-bar/dom.d.ts +5 -0
  156. package/dist/types/components/search-bar/lib.d.ts +9 -2
  157. package/dist/types/components/search-bar/search-bar.d.ts +1 -0
  158. package/dist/types/components/slider/slider.d.ts +1 -0
  159. package/dist/types/components/tab/tab.d.ts +11 -0
  160. package/dist/types/components/tab/util.d.ts +1 -0
  161. package/dist/types/components/tabs/tabs.d.ts +23 -0
  162. package/dist/types/components.d.ts +162 -76
  163. package/dist/types/types/icon.d.ts +17 -0
  164. package/dist/types/util/components/dom.d.ts +1 -0
  165. package/package.json +2 -2
  166. package/dist/cjs/color-picker-876ace00.js +0 -37
  167. package/dist/collection/components/color-circle/color-circle.css +0 -18
  168. package/dist/components/p-03dbb28c.js +0 -1
  169. package/dist/components/p-0b1cdc8a.entry.js +0 -1
  170. package/dist/components/p-0f8b9ede.entry.js +0 -1
  171. package/dist/components/p-16719272.entry.js +0 -1
  172. package/dist/components/p-20a74d5d.entry.js +0 -1
  173. package/dist/components/p-35e7ab78.entry.js +0 -1
  174. package/dist/components/p-7cfb3736.entry.js +0 -1
  175. package/dist/components/p-7dba2574.entry.js +0 -1
  176. package/dist/components/p-7f64b251.entry.js +0 -1
  177. package/dist/components/p-8434602f.js +0 -1
  178. package/dist/components/p-92930f2a.js +0 -1
  179. package/dist/components/p-cd6ddb10.js +0 -1
  180. package/dist/components/p-cfe369bf.entry.js +0 -1
  181. package/dist/components/p-d9b9aebe.js +0 -1
  182. package/dist/components/p-db34f10c.js +0 -1
  183. package/dist/components/p-f71fc166.entry.js +0 -1
  184. package/dist/esm/color-picker-2e3b51fa.js +0 -35
  185. package/dist/esm/vertex-color-circle.entry.js +0 -2
@@ -2,18 +2,39 @@ import { h, Host, } from '@stencil/core';
2
2
  import classNames from 'classnames';
3
3
  import deepEqual from 'fast-deep-equal';
4
4
  import { generateInstanceFromTemplate } from '../../util/templates/templates';
5
- import { createDocumentRange, createTextNode, getWindowSelection } from './dom';
6
- import { createResultUri, createSearchResultReplacement, getNodesForSearchResultReplacement, trimNonstandardSpaces, } from './lib';
5
+ import { createDocumentRange, createTextNode, getWindowSelection, isBrElement, isHtmlElement, nodeHasChildNodes, } from './dom';
6
+ import { createResultUri, createSearchResultReplacement, getNodesForSearchResultReplacement, standardizeNewlinesAndSpaces, trimNonstandardSpaces, } from './lib';
7
7
  export class SearchBar {
8
8
  constructor() {
9
9
  this.rawElements = [];
10
+ this.attemptReplaceElement = (child, other, replacement, isBreaking = false) => {
11
+ // In the case that the child we're evaluating has its own children
12
+ // (often a wrapper `<div>`), we want to evaluate whether any of its
13
+ // children is the target to replace.
14
+ if (nodeHasChildNodes(child) &&
15
+ Array.from(child.childNodes).some((c) => nodeHasChildNodes(c) || this.isIdenticalElement(c, other))) {
16
+ return Array.from(child.childNodes).reduce((res, c) => [
17
+ ...res,
18
+ ...this.attemptReplaceElement(c, other, replacement,
19
+ // If the element we're evaluating is a wrapper, we want to
20
+ // consider it a breaking element and add a newline to the
21
+ // replaced element only if the previous node is a `Text` node.
22
+ !isHtmlElement(child.previousSibling)),
23
+ ], []);
24
+ }
25
+ else {
26
+ return this.isIdenticalElement(child, other)
27
+ ? getNodesForSearchResultReplacement(replacement, isBreaking)
28
+ : [child];
29
+ }
30
+ };
10
31
  this.isIdenticalElement = (child, other) => {
11
32
  return (child === this.triggeredElement ||
12
33
  this.getTextContent(child) === this.getTextContent(other));
13
34
  };
14
35
  this.getTextContent = (node) => {
15
36
  var _a;
16
- if (node instanceof HTMLElement) {
37
+ if (isHtmlElement(node)) {
17
38
  return node.innerText;
18
39
  }
19
40
  return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
@@ -90,21 +111,54 @@ export class SearchBar {
90
111
  selection.addRange(range);
91
112
  }
92
113
  };
93
- this.getContentAsString = () => {
94
- if (this.contentEl != null) {
95
- return trimNonstandardSpaces(Array.from(this.contentEl.childNodes).reduce((res, n) => {
114
+ this.getContentAsString = (element) => {
115
+ if (element != null) {
116
+ const res = trimNonstandardSpaces(Array.from(element.childNodes).reduce((res, n) => {
96
117
  var _a;
97
- if (n instanceof HTMLElement &&
98
- n.getAttribute('data-replaced') === 'true') {
118
+ const previousSiblingIsBlock = n.previousSibling == null || isHtmlElement(n.previousSibling);
119
+ if (isHtmlElement(n) && n.getAttribute('data-replaced') === 'true') {
120
+ /**
121
+ * If an element has been replaced visually, append the original
122
+ * value prior to being replaced.
123
+ */
99
124
  return `${res}${n.getAttribute('data-original')}`;
100
125
  }
101
- else if (n instanceof HTMLElement) {
102
- return `${res}${n.innerText}`;
126
+ else if (isHtmlElement(n) && n.childElementCount > 0) {
127
+ /**
128
+ * If an element is a wrapper, we want to treat it as a block element,
129
+ * ensuring newlines before and after the content.
130
+ * Additionally, we want to evaluate each of its children independently.
131
+ * Some browsers will conditionally wrap content in additional wrapper
132
+ * elements we need to unravel.
133
+ */
134
+ return `${res}${previousSiblingIsBlock ? '' : '\n'}${this.getContentAsString(n)}`;
135
+ }
136
+ else if (isBrElement(n)) {
137
+ /**
138
+ * If an element is a `<br>` element, we want to simply represent
139
+ * it as a newline in the returned string.
140
+ */
141
+ return `${res}\n`;
142
+ }
143
+ else if (isHtmlElement(n)) {
144
+ /**
145
+ * If an element is a wrapper, we want to treat it as a block element,
146
+ * ensuring newlines before and after the content.
147
+ * If the prior element is also to be treated as a block format, we
148
+ * will omit the newline before the content to avoid duplicating the
149
+ * behavior.
150
+ */
151
+ return `${res}${previousSiblingIsBlock ? '' : '\n'}${n.innerText}\n`;
103
152
  }
104
153
  else {
154
+ /**
155
+ * If a node is simply a `Text` node, we just want to append the text
156
+ * if defined.
157
+ */
105
158
  return `${res}${(_a = n.textContent) !== null && _a !== void 0 ? _a : ''}`;
106
159
  }
107
160
  }, ''));
161
+ return res;
108
162
  }
109
163
  return '';
110
164
  };
@@ -180,12 +234,13 @@ export class SearchBar {
180
234
  replacement.before,
181
235
  replacement.beforeSpace,
182
236
  replacement.result,
237
+ replacement.afterSpace,
183
238
  ];
184
239
  }
185
240
  return res;
186
241
  }, [])
187
242
  : [];
188
- this.rawElements = [...parts, createTextNode(nextSubstr)];
243
+ this.rawElements = [...parts, createTextNode(nextSubstr)].reduce((res, p) => [...res, ...standardizeNewlinesAndSpaces(p)], []);
189
244
  this.updateContent(this.replacements);
190
245
  }
191
246
  }
@@ -193,7 +248,7 @@ export class SearchBar {
193
248
  if (this.contentEl != null && !deepEqual(newValue, oldValue)) {
194
249
  this.contentEl.innerHTML = '';
195
250
  this.displayedElements = this.rawElements.map((el) => {
196
- const raw = el instanceof HTMLElement ? el.innerText : el.textContent;
251
+ const raw = isHtmlElement(el) ? el.innerText : el.textContent;
197
252
  const replacement = this.replacements.find((r) => raw === null || raw === void 0 ? void 0 : raw.includes(createResultUri(r)));
198
253
  if (raw != null && replacement != null) {
199
254
  const replacementElement = this.createReplacedElement(raw, replacement);
@@ -208,7 +263,7 @@ export class SearchBar {
208
263
  if (this.lastReplacedSpace != null) {
209
264
  this.moveCursorToNodeEnd(this.lastReplacedSpace);
210
265
  }
211
- this.inputChanged.emit(this.getContentAsString());
266
+ this.inputChanged.emit(this.getContentAsString(this.contentEl));
212
267
  }
213
268
  }
214
269
  render() {
@@ -220,7 +275,7 @@ export class SearchBar {
220
275
  blank: this.variant === 'blank',
221
276
  disabled: this.disabled,
222
277
  });
223
- return (h(Host, null, h("div", { class: classes }, h("span", { class: "content-input", role: "textbox", contentEditable: "true", "aria-multiline": "true", "data-placeholder": this.placeholder, ref: (el) => (this.contentEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleCursorPositionUpdate, onClick: this.handleCursorPositionUpdate, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("vertex-result-list", { position: this.cursorPosition, placement: this.placement, open: this.hasTriggered &&
278
+ return (h(Host, null, h("div", { class: classes }, h("span", { class: "content-input", role: "textbox", contentEditable: "true", "aria-multiline": "true", "data-placeholder": this.placeholder, ref: (el) => (this.contentEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, onClick: this.handleCursorPositionUpdate, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur })), h("vertex-result-list", { position: this.cursorPosition, placement: this.placement, open: this.hasTriggered &&
224
279
  this.resultItems != null &&
225
280
  this.resultItems.length > 0, items: (_a = this.resultItems) !== null && _a !== void 0 ? _a : [], onEnterPressed: this.handleResultClick, onResultClick: this.handleResultClick }, h("slot", { name: "results" })), h("slot", { name: "replaced" })));
226
281
  }
@@ -236,13 +291,13 @@ export class SearchBar {
236
291
  this.cursorPosition = this.getCursorPosition();
237
292
  }
238
293
  async handleInput() {
239
- this.inputChanged.emit(this.getContentAsString());
294
+ this.inputChanged.emit(this.getContentAsString(this.contentEl));
240
295
  }
241
296
  handleClick() {
242
297
  this.handleCursorPositionUpdate();
243
298
  }
244
299
  handleWindowClick(event) {
245
- if (event.target instanceof HTMLElement &&
300
+ if (isHtmlElement(event.target) &&
246
301
  event.target.getAttribute('data-replaced') === 'true' &&
247
302
  event.target.nextSibling != null) {
248
303
  this.moveCursorToNodeEnd(event.target.nextSibling, true);
@@ -259,7 +314,7 @@ export class SearchBar {
259
314
  var _a;
260
315
  const triggeredRange = this.triggeredRange;
261
316
  const triggeredElement = this.triggeredElement;
262
- const value = triggeredElement instanceof HTMLElement
317
+ const value = isHtmlElement(triggeredElement)
263
318
  ? triggeredElement.innerText
264
319
  : triggeredElement === null || triggeredElement === void 0 ? void 0 : triggeredElement.textContent;
265
320
  if (this.contentEl != null &&
@@ -273,12 +328,10 @@ export class SearchBar {
273
328
  const replacement = createSearchResultReplacement(event.detail, before, after);
274
329
  this.lastReplacedSpace = replacement.afterSpace;
275
330
  this.rawElements = Array.from(this.contentEl.childNodes).reduce((re, e) => {
276
- if (this.isIdenticalElement(e, triggeredElement)) {
277
- return [...re, ...getNodesForSearchResultReplacement(replacement)];
278
- }
279
- else {
280
- return [...re, e];
281
- }
331
+ return [
332
+ ...re,
333
+ ...this.attemptReplaceElement(e, triggeredElement, replacement),
334
+ ];
282
335
  }, []);
283
336
  this.hasTriggered = false;
284
337
  this.resultReplaced.emit(event.detail);
@@ -10,6 +10,12 @@
10
10
  Defaults to `normal`.
11
11
  */
12
12
  --select-option-white-space: normal;
13
+
14
+ /*
15
+ The maximum height of the dropdown.
16
+ Defaults to `80vh`.
17
+ */
18
+ --max-dropdown-height: 80vh;
13
19
  }
14
20
 
15
21
  .root {
@@ -76,6 +82,8 @@
76
82
  top: -0.25rem;
77
83
  box-shadow: 0px 2px 4px -1px rgb(0 0 0 / 20%),
78
84
  0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);
85
+ max-height: var(--max-dropdown-height);
86
+ overflow-y: auto;
79
87
  }
80
88
 
81
89
  .options.animated {
@@ -1,5 +1,6 @@
1
- import { h } from '@stencil/core';
1
+ import { h, } from '@stencil/core';
2
2
  import classNames from 'classnames';
3
+ import { blurElement } from '../../util/components/dom';
3
4
  export class Slider {
4
5
  constructor() {
5
6
  this.handleChange = (event) => {
@@ -19,7 +20,11 @@ export class Slider {
19
20
  this.disabled = false;
20
21
  }
21
22
  render() {
22
- return (h("vertex-tooltip", { disabled: this.valueLabelDisplay === 'off', content: `${this.value}`, placement: 'top', class: "tooltip" }, h("input", { class: classNames('input', { disabled: this.disabled }, this.size), type: "range", disabled: this.disabled, min: this.min, max: this.max, step: this.step, value: this.value, onChange: this.handleChange, onInput: this.handleInput })));
23
+ return (h("vertex-tooltip", { disabled: this.valueLabelDisplay === 'off', content: `${this.value}`, placement: 'top', class: "tooltip" }, h("input", { class: classNames('input', { disabled: this.disabled }, this.size), type: "range", disabled: this.disabled, min: this.min, max: this.max, step: this.step, value: this.value, onChange: this.handleChange, onInput: this.handleInput, onPointerUp: () => {
24
+ // Blur the slider on pointerup to prevent an issue where pressing
25
+ // any key on the keyboard would result in a focus state.
26
+ blurElement(this.hostEl);
27
+ } })));
23
28
  }
24
29
  updateValueFromEvent(event) {
25
30
  this.value = event.target.valueAsNumber;
@@ -214,4 +219,5 @@ export class Slider {
214
219
  }
215
220
  }];
216
221
  }
222
+ static get elementRef() { return "hostEl"; }
217
223
  }
@@ -0,0 +1,16 @@
1
+ :host {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ }
6
+
7
+ .content {
8
+ display: none;
9
+ height: 0px;
10
+ }
11
+
12
+ .content.active {
13
+ display: flex;
14
+ width: 100%;
15
+ height: 100%;
16
+ }
@@ -0,0 +1,85 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import classNames from 'classnames';
3
+ export class Tab {
4
+ constructor() {
5
+ this.handleClick = () => {
6
+ this.tabClick.emit(this.label);
7
+ };
8
+ this.label = undefined;
9
+ this.active = false;
10
+ }
11
+ render() {
12
+ return (h(Host, null, h("div", { class: classNames('content', {
13
+ active: this.active,
14
+ }) }, h("slot", null))));
15
+ }
16
+ static get is() { return "vertex-tab"; }
17
+ static get encapsulation() { return "shadow"; }
18
+ static get originalStyleUrls() {
19
+ return {
20
+ "$": ["tab.css"]
21
+ };
22
+ }
23
+ static get styleUrls() {
24
+ return {
25
+ "$": ["tab.css"]
26
+ };
27
+ }
28
+ static get properties() {
29
+ return {
30
+ "label": {
31
+ "type": "string",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "string",
35
+ "resolved": "string",
36
+ "references": {}
37
+ },
38
+ "required": true,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": "The label to include in tab list."
43
+ },
44
+ "attribute": "label",
45
+ "reflect": false
46
+ },
47
+ "active": {
48
+ "type": "boolean",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "boolean",
52
+ "resolved": "boolean",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "active",
62
+ "reflect": false,
63
+ "defaultValue": "false"
64
+ }
65
+ };
66
+ }
67
+ static get events() {
68
+ return [{
69
+ "method": "tabClick",
70
+ "name": "tabClick",
71
+ "bubbles": true,
72
+ "cancelable": true,
73
+ "composed": true,
74
+ "docs": {
75
+ "tags": [],
76
+ "text": ""
77
+ },
78
+ "complexType": {
79
+ "original": "string",
80
+ "resolved": "string",
81
+ "references": {}
82
+ }
83
+ }];
84
+ }
85
+ }
@@ -0,0 +1,3 @@
1
+ export function isTabElement(element) {
2
+ return element.tagName === 'VERTEX-TAB';
3
+ }
@@ -0,0 +1,67 @@
1
+ button {
2
+ border: none;
3
+ background-color: transparent;
4
+ font-family: var(--vertex-ui-font-family);
5
+ font-size: 0.875rem;
6
+ padding: 0;
7
+ }
8
+
9
+ :host {
10
+ display: flex;
11
+ position: relative;
12
+ width: 100%;
13
+ height: 100%;
14
+ }
15
+
16
+ .wrapper {
17
+ display: flex;
18
+ flex-direction: column;
19
+ position: relative;
20
+ height: 100%;
21
+ width: 100%;
22
+ }
23
+
24
+ .labels {
25
+ display: flex;
26
+ position: relative;
27
+ border-bottom: solid 1px var(--vertex-ui-neutral-300);
28
+ }
29
+
30
+ .indicator {
31
+ position: absolute;
32
+ bottom: 0;
33
+ height: 3px;
34
+ background-color: var(--vertex-ui-blue-700);
35
+ transition: left 0.2s ease-in-out;
36
+ }
37
+
38
+ .label {
39
+ position: relative;
40
+ cursor: pointer;
41
+ color: var(--vertex-ui-neutral-700);
42
+ white-space: nowrap;
43
+ font-family: var(--vertex-ui-font-family);
44
+ font-size: var(--vertex-ui-text-md);
45
+ padding: 0.75rem 1.25rem;
46
+ }
47
+
48
+ .label:not(.active):hover {
49
+ color: var(--vertex-ui-neutral-800);
50
+ }
51
+
52
+ .label.active {
53
+ color: var(--vertex-ui-blue-700);
54
+ font-weight: var(--vertex-ui-font-weight-bold);
55
+ }
56
+
57
+ .hidden-label-text {
58
+ font-weight: bold;
59
+ visibility: hidden;
60
+ height: 0px;
61
+ }
62
+
63
+ .tab-content {
64
+ display: flex;
65
+ height: 5%;
66
+ flex-grow: 1;
67
+ }
@@ -0,0 +1,159 @@
1
+ import { h, Host, } from '@stencil/core';
2
+ import classNames from 'classnames';
3
+ import { getBoundingClientRect, readDOM } from '../../util/components/dom';
4
+ import { isTabElement } from '../tab/util';
5
+ export class Tabs {
6
+ constructor() {
7
+ this.indicatorInitialized = false;
8
+ this.handleLabelClick = (label) => {
9
+ if (this.active != null) {
10
+ this.updateActiveOnTab(this.active, false);
11
+ }
12
+ this.active = label;
13
+ this.updateActiveOnTab(this.active, true);
14
+ this.selectedTabChanged.emit(label);
15
+ };
16
+ this.updateActiveOnTab = (label, active) => {
17
+ const activeTab = this.findTabByLabel(label);
18
+ if (activeTab != null) {
19
+ activeTab.active = active;
20
+ }
21
+ };
22
+ this.findTabByLabel = (label) => {
23
+ var _a;
24
+ const slotEl = ((_a = this.hostEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot:not([name])')) || undefined;
25
+ const slotAssignedElements = slotEl === null || slotEl === void 0 ? void 0 : slotEl.assignedElements();
26
+ const slotChildren = slotAssignedElements != null && slotAssignedElements.length > 0
27
+ ? Array.from(slotAssignedElements[0].children)
28
+ : undefined;
29
+ return slotChildren != null
30
+ ? slotChildren.filter(isTabElement).find((el) => el.label === label)
31
+ : undefined;
32
+ };
33
+ this.updateTabLabels = () => {
34
+ var _a;
35
+ const slotEl = ((_a = this.hostEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot:not([name])')) || undefined;
36
+ const slotAssignedElements = slotEl === null || slotEl === void 0 ? void 0 : slotEl.assignedElements();
37
+ const slotChildren = slotAssignedElements != null && slotAssignedElements.length > 0
38
+ ? Array.from(slotAssignedElements[0].children)
39
+ : undefined;
40
+ this.labels =
41
+ slotChildren != null
42
+ ? slotChildren.filter(isTabElement).map((t) => t.label)
43
+ : [];
44
+ };
45
+ this.active = undefined;
46
+ this.labels = [];
47
+ this.activeBounds = undefined;
48
+ this.activeButtonEl = undefined;
49
+ }
50
+ componentWillLoad() {
51
+ this.updateTabLabels();
52
+ }
53
+ componentDidLoad() {
54
+ if (this.active != null) {
55
+ this.updateActiveOnTab(this.active, true);
56
+ }
57
+ this.indicatorInitialized = false;
58
+ this.handleActiveButtonChange();
59
+ }
60
+ componentDidUpdate() {
61
+ // Place the indicator if it hasn't been initialized yet
62
+ if (!this.indicatorInitialized) {
63
+ this.handleActiveButtonChange();
64
+ }
65
+ }
66
+ handleActiveButtonChange() {
67
+ const button = this.activeButtonEl;
68
+ if (button != null) {
69
+ readDOM(() => {
70
+ const hostElBounds = getBoundingClientRect(this.hostEl);
71
+ const activeBounds = getBoundingClientRect(button);
72
+ this.activeBounds = {
73
+ x: activeBounds.x - hostElBounds.x,
74
+ width: activeBounds.width,
75
+ };
76
+ if (this.activeBounds.width !== 0) {
77
+ this.indicatorInitialized = true;
78
+ }
79
+ });
80
+ }
81
+ }
82
+ render() {
83
+ return (h(Host, null, h("div", { class: "wrapper" }, h("div", { class: "labels" }, this.labels.map((label) => (h("button", { class: classNames('label', {
84
+ active: this.active === label,
85
+ }), "data-label": label, ref: (el) => {
86
+ if (this.active === label) {
87
+ this.activeButtonEl = el;
88
+ }
89
+ }, onClick: () => this.handleLabelClick(label) }, label, h("div", { class: "hidden-label-text" }, label)))), h("slot", { name: "label-header" }), this.activeBounds && (h("div", { class: "indicator", style: {
90
+ left: `${this.activeBounds.x}px`,
91
+ width: `${this.activeBounds.width}px`,
92
+ } }))), h("div", { class: "tab-content" }, h("slot", { onSlotchange: this.updateTabLabels })))));
93
+ }
94
+ static get is() { return "vertex-tabs"; }
95
+ static get encapsulation() { return "shadow"; }
96
+ static get originalStyleUrls() {
97
+ return {
98
+ "$": ["tabs.css"]
99
+ };
100
+ }
101
+ static get styleUrls() {
102
+ return {
103
+ "$": ["tabs.css"]
104
+ };
105
+ }
106
+ static get properties() {
107
+ return {
108
+ "active": {
109
+ "type": "string",
110
+ "mutable": true,
111
+ "complexType": {
112
+ "original": "string",
113
+ "resolved": "string | undefined",
114
+ "references": {}
115
+ },
116
+ "required": false,
117
+ "optional": true,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": ""
121
+ },
122
+ "attribute": "active",
123
+ "reflect": false
124
+ }
125
+ };
126
+ }
127
+ static get states() {
128
+ return {
129
+ "labels": {},
130
+ "activeBounds": {},
131
+ "activeButtonEl": {}
132
+ };
133
+ }
134
+ static get events() {
135
+ return [{
136
+ "method": "selectedTabChanged",
137
+ "name": "selectedTabChanged",
138
+ "bubbles": true,
139
+ "cancelable": true,
140
+ "composed": true,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "An event that is emitted whenever the selected tab changes\nand contains the label of the newly selected tab."
144
+ },
145
+ "complexType": {
146
+ "original": "string",
147
+ "resolved": "string",
148
+ "references": {}
149
+ }
150
+ }];
151
+ }
152
+ static get elementRef() { return "hostEl"; }
153
+ static get watchers() {
154
+ return [{
155
+ "propName": "activeButtonEl",
156
+ "methodName": "handleActiveButtonChange"
157
+ }];
158
+ }
159
+ }
@@ -7,9 +7,11 @@ export var IconNames;
7
7
  IconNames["align-view-to-plane"] = "align-view-to-plane";
8
8
  IconNames["annotation"] = "annotation";
9
9
  IconNames["arrow-filled"] = "arrow-filled";
10
+ IconNames["arrow-left-circled"] = "arrow-left-circled";
10
11
  IconNames["arrow-line-left"] = "arrow-line-left";
11
12
  IconNames["arrow-line-right"] = "arrow-line-right";
12
13
  IconNames["arrow-partial"] = "arrow-partial";
14
+ IconNames["arrow-right-circled"] = "arrow-right-circled";
13
15
  IconNames["arrow-triangle-left"] = "arrow-triangle-left";
14
16
  IconNames["arrow-triangle-right"] = "arrow-triangle-right";
15
17
  IconNames["arrow-up-circled"] = "arrow-up-circled";
@@ -21,9 +23,11 @@ export var IconNames;
21
23
  IconNames["box-cursor"] = "box-cursor";
22
24
  IconNames["box-select"] = "box-select";
23
25
  IconNames["camera"] = "camera";
26
+ IconNames["camera-add"] = "camera-add";
24
27
  IconNames["caret-down"] = "caret-down";
25
28
  IconNames["caret-left"] = "caret-left";
26
29
  IconNames["caret-up"] = "caret-up";
30
+ IconNames["caution"] = "caution";
27
31
  IconNames["check"] = "check";
28
32
  IconNames["check-circle"] = "check-circle";
29
33
  IconNames["caret-right"] = "caret-right";
@@ -37,23 +41,29 @@ export var IconNames;
37
41
  IconNames["close-circle"] = "close-circle";
38
42
  IconNames["collapse-all"] = "collapse-all";
39
43
  IconNames["columns"] = "columns";
44
+ IconNames["columns-add"] = "columns-add";
40
45
  IconNames["comment-add"] = "comment-add";
41
46
  IconNames["comment-filled"] = "comment-filled";
42
47
  IconNames["comment-reopen"] = "comment-reopen";
43
48
  IconNames["comment-resolve"] = "comment-resolve";
44
49
  IconNames["comment-show"] = "comment-show";
50
+ IconNames["compare"] = "compare";
51
+ IconNames["compress"] = "compress";
45
52
  IconNames["copy"] = "copy";
46
53
  IconNames["cross-section"] = "cross-section";
47
54
  IconNames["cube-orthographic"] = "cube-orthographic";
48
55
  IconNames["cube-perspective"] = "cube-perspective";
56
+ IconNames["cube-stack"] = "cube-stack";
49
57
  IconNames["delete"] = "delete";
50
58
  IconNames["download"] = "download";
51
59
  IconNames["drag-indicator"] = "drag-indicator";
52
60
  IconNames["ellipse"] = "ellipse";
53
61
  IconNames["error-circle"] = "error-circle";
62
+ IconNames["expand"] = "expand";
54
63
  IconNames["expand-all"] = "expand-all";
55
64
  IconNames["export"] = "export";
56
65
  IconNames["file"] = "file";
66
+ IconNames["file-folder"] = "file-folder";
57
67
  IconNames["file-pdf"] = "file-pdf";
58
68
  IconNames["fit-all"] = "fit-all";
59
69
  IconNames["fit-selected"] = "fit-selected";
@@ -86,9 +96,13 @@ export var IconNames;
86
96
  IconNames["pin-line"] = "pin-line";
87
97
  IconNames["pin-text"] = "pin-text";
88
98
  IconNames["pin-text-fill"] = "pin-text-fill";
99
+ IconNames["pin-text-square"] = "pin-text-square";
89
100
  IconNames["plus"] = "plus";
101
+ IconNames["plus-with-arrow"] = "plus-with-arrow";
102
+ IconNames["pmi"] = "pmi";
90
103
  IconNames["precise-measurement"] = "precise-measurement";
91
104
  IconNames["rabbit"] = "rabbit";
105
+ IconNames["report"] = "report";
92
106
  IconNames["reset"] = "reset";
93
107
  IconNames["resize"] = "resize";
94
108
  IconNames["rotate"] = "rotate";
@@ -97,12 +111,15 @@ export var IconNames;
97
111
  IconNames["show-only-nearby"] = "show-only-nearby";
98
112
  IconNames["snapshots"] = "snapshots";
99
113
  IconNames["star"] = "star";
114
+ IconNames["square-dot-outline"] = "square-dot-outline";
100
115
  IconNames["tape-measure"] = "tape-measure";
101
116
  IconNames["teleport-and-align"] = "teleport-and-align";
102
117
  IconNames["teleport-toward"] = "teleport-toward";
103
118
  IconNames["teleport"] = "teleport";
104
119
  IconNames["turtle"] = "turtle";
120
+ IconNames["update"] = "update";
105
121
  IconNames["version-history"] = "version-history";
122
+ IconNames["views"] = "views";
106
123
  IconNames["visibility-hidden"] = "visibility-hidden";
107
124
  IconNames["visibility-partial"] = "visibility-partial";
108
125
  IconNames["visibility-visible"] = "visibility-visible";
@@ -8,3 +8,6 @@ export function getBoundingClientRect(el) {
8
8
  export function getComputedStyle(el) {
9
9
  return window.getComputedStyle(el);
10
10
  }
11
+ export function blurElement(el) {
12
+ el.blur();
13
+ }