@vertexvis/ui 0.1.0-canary.2 → 0.1.0-canary.21

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 (202) hide show
  1. package/dist/cjs/{color-circle-picker-13396ec4.js → color-circle-picker-a8f9a80a.js} +1 -1
  2. package/dist/cjs/color-picker-2a4820fa.js +46 -0
  3. package/dist/cjs/{color-circle-05be54bf.js → color-swatch-8aaf6c0b.js} +42 -17
  4. package/dist/cjs/components.cjs.js +1 -1
  5. package/dist/cjs/{dialog-88e2308a.js → dialog-34f1dd6e.js} +1 -1
  6. package/dist/cjs/dom-b6c5fbf4.js +13 -0
  7. package/dist/cjs/{icon-button-786427d6.js → icon-button-2256a63a.js} +1 -1
  8. package/dist/cjs/{icon-460fd0f5.js → icon-c3ab7a57.js} +1 -1
  9. package/dist/cjs/{icon-helper-ba408f49.js → icon-helper-35893713.js} +60 -0
  10. package/dist/cjs/index.cjs.js +20 -14
  11. package/dist/cjs/lib-1bd1e383.js +9 -0
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{popover-d9ec8e10.js → popover-942209b8.js} +23 -1
  14. package/dist/cjs/{result-list-1e592c3c.js → result-list-241ffe8d.js} +46 -2
  15. package/dist/cjs/search-bar-2e7ee35a.js +527 -0
  16. package/dist/cjs/{select-0eb7203f.js → select-2b2bdb97.js} +27 -4
  17. package/dist/cjs/tab-4335cd8f.js +26 -0
  18. package/dist/cjs/tabs-ece62a01.js +111 -0
  19. package/dist/cjs/{text-field-0397fb34.js → text-field-bccbde1f.js} +1 -0
  20. package/dist/cjs/{tooltip-80a7b722.js → tooltip-9ac797a0.js} +59 -23
  21. package/dist/cjs/vertex-color-circle-picker.cjs.entry.js +1 -1
  22. package/dist/cjs/vertex-color-picker.cjs.entry.js +2 -1
  23. package/dist/cjs/vertex-color-swatch.cjs.entry.js +12 -0
  24. package/dist/cjs/vertex-dialog.cjs.entry.js +1 -1
  25. package/dist/cjs/vertex-icon-button.cjs.entry.js +2 -2
  26. package/dist/cjs/vertex-icon.cjs.entry.js +2 -2
  27. package/dist/cjs/vertex-popover.cjs.entry.js +1 -1
  28. package/dist/cjs/vertex-result-list.cjs.entry.js +1 -1
  29. package/dist/cjs/vertex-search-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/vertex-select.cjs.entry.js +1 -1
  31. package/dist/cjs/{vertex-color-circle.cjs.entry.js → vertex-tab.cjs.entry.js} +3 -2
  32. package/dist/cjs/vertex-tabs.cjs.entry.js +12 -0
  33. package/dist/cjs/vertex-textfield.cjs.entry.js +1 -1
  34. package/dist/cjs/vertex-tooltip.cjs.entry.js +2 -1
  35. package/dist/collection/collection-manifest.json +5 -3
  36. package/dist/collection/components/color-circle-picker/color-circle-picker.js +7 -7
  37. package/dist/collection/components/color-picker/color-picker.css +95 -15
  38. package/dist/collection/components/color-picker/color-picker.js +57 -3
  39. package/dist/collection/components/color-swatch/color-swatch.css +43 -0
  40. package/dist/collection/components/{color-circle/color-circle.js → color-swatch/color-swatch.js} +96 -23
  41. package/dist/collection/components/color-swatch/lib.js +5 -0
  42. package/dist/collection/components/dialog/dialog.css +0 -1
  43. package/dist/collection/components/icon/icon-helper.js +33 -0
  44. package/dist/collection/components/icon/icon.js +1 -1
  45. package/dist/collection/components/icon/icons/caution.js +2 -0
  46. package/dist/collection/components/icon/icons/compare.js +2 -0
  47. package/dist/collection/components/icon/icons/compress.js +2 -0
  48. package/dist/collection/components/icon/icons/cube-stack.js +2 -0
  49. package/dist/collection/components/icon/icons/expand.js +2 -0
  50. package/dist/collection/components/icon/icons/pin-text-square.js +2 -0
  51. package/dist/collection/components/icon/icons/plus-with-arrow.js +2 -0
  52. package/dist/collection/components/icon/icons/pmi.js +2 -0
  53. package/dist/collection/components/icon/icons/square-dot-outline.js +2 -0
  54. package/dist/collection/components/icon/icons/update.js +2 -0
  55. package/dist/collection/components/icon/icons/views.js +2 -0
  56. package/dist/collection/components/icon-button/icon-button.js +1 -1
  57. package/dist/collection/components/index.js +3 -1
  58. package/dist/collection/components/menu/menu.js +1 -1
  59. package/dist/collection/components/popover/popover.js +51 -0
  60. package/dist/collection/components/result-list/result-list.js +52 -5
  61. package/dist/collection/components/result-list/types.js +1 -0
  62. package/dist/collection/components/search-bar/dom.js +29 -0
  63. package/dist/collection/components/search-bar/lib.js +76 -15
  64. package/dist/collection/components/search-bar/search-bar.css +0 -16
  65. package/dist/collection/components/search-bar/search-bar.js +429 -320
  66. package/dist/collection/components/select/select.css +24 -0
  67. package/dist/collection/components/select/select.js +49 -2
  68. package/dist/collection/components/tab/tab.css +16 -0
  69. package/dist/collection/components/tab/tab.js +85 -0
  70. package/dist/collection/components/tab/util.js +3 -0
  71. package/dist/collection/components/tabs/tabs.css +67 -0
  72. package/dist/collection/components/tabs/tabs.js +159 -0
  73. package/dist/collection/components/text-field/text-field.js +1 -0
  74. package/dist/collection/components/tooltip/tooltip.js +62 -18
  75. package/dist/collection/types/icon.js +11 -0
  76. package/dist/collection/util/templates/element-pool.js +19 -1
  77. package/dist/components/components.css +1 -1
  78. package/dist/components/components.esm.js +1 -1
  79. package/dist/components/index.esm.js +1 -1
  80. package/dist/components/p-036a0be0.js +1 -0
  81. package/dist/components/{p-165aed7d.js → p-0d4a0d61.js} +1 -1
  82. package/dist/components/{p-9374ef6c.js → p-1367d3af.js} +1 -1
  83. package/dist/components/{p-103249b4.js → p-1971ed0b.js} +1 -1
  84. package/dist/components/p-1d08dd79.entry.js +1 -0
  85. package/dist/components/p-2ae8175d.entry.js +1 -0
  86. package/dist/components/p-2b4aedaa.entry.js +1 -0
  87. package/dist/components/p-3438c441.js +1 -0
  88. package/dist/components/p-3dd7a75f.entry.js +1 -0
  89. package/dist/components/p-406e73da.entry.js +1 -0
  90. package/dist/components/p-4327deea.js +1 -0
  91. package/dist/components/p-43b1b3f9.js +1 -0
  92. package/dist/components/p-49db6547.entry.js +1 -0
  93. package/dist/components/p-606596de.entry.js +1 -0
  94. package/dist/components/{p-ca52a423.js → p-63b48634.js} +1 -1
  95. package/dist/components/p-655053df.js +1 -0
  96. package/dist/components/p-69496858.js +1 -0
  97. package/dist/components/p-6a49c365.entry.js +1 -0
  98. package/dist/components/p-6b6c2260.js +1 -0
  99. package/dist/components/p-6b862967.js +1 -0
  100. package/dist/components/p-76b961b8.js +1 -0
  101. package/dist/components/p-8bbc344d.entry.js +1 -0
  102. package/dist/components/p-96f55673.js +1 -0
  103. package/dist/components/p-a0eac69c.entry.js +1 -0
  104. package/dist/components/p-bc2fbd68.entry.js +1 -0
  105. package/dist/components/p-c2706288.js +1 -0
  106. package/dist/components/p-d3fd9ca3.entry.js +1 -0
  107. package/dist/components/p-d539f530.js +1 -0
  108. package/dist/components/p-e35057b5.entry.js +1 -0
  109. package/dist/components/p-ee496965.entry.js +1 -0
  110. package/dist/components/p-ff7c70b9.js +1 -0
  111. package/dist/esm/{color-circle-picker-998a7e9c.js → color-circle-picker-e2a2cfb5.js} +1 -1
  112. package/dist/esm/color-picker-1d67effe.js +44 -0
  113. package/dist/esm/{color-circle-842f3321.js → color-swatch-0e62d13d.js} +42 -17
  114. package/dist/esm/components.js +1 -1
  115. package/dist/esm/{dialog-e3f49527.js → dialog-1cef715c.js} +1 -1
  116. package/dist/esm/dom-613e2677.js +10 -0
  117. package/dist/esm/{icon-d37150b4.js → icon-55b22de7.js} +1 -1
  118. package/dist/esm/{icon-button-aad3c0e7.js → icon-button-e6c72aec.js} +1 -1
  119. package/dist/esm/{icon-helper-83f10f73.js → icon-helper-67de1067.js} +60 -0
  120. package/dist/esm/index.js +17 -13
  121. package/dist/esm/lib-73fbca8b.js +7 -0
  122. package/dist/esm/loader.js +1 -1
  123. package/dist/esm/{popover-67c88e4b.js → popover-6e806354.js} +23 -1
  124. package/dist/esm/{result-list-36cfb08a.js → result-list-16c6afbd.js} +46 -2
  125. package/dist/esm/search-bar-8d18626e.js +525 -0
  126. package/dist/esm/{select-75ed5653.js → select-78aeff96.js} +27 -4
  127. package/dist/esm/tab-c76332b0.js +24 -0
  128. package/dist/esm/tabs-8e5353ba.js +109 -0
  129. package/dist/esm/{text-field-e542da25.js → text-field-32ac877e.js} +1 -0
  130. package/dist/esm/{tooltip-97c1b3ec.js → tooltip-29278ea4.js} +58 -22
  131. package/dist/esm/vertex-color-circle-picker.entry.js +1 -1
  132. package/dist/esm/vertex-color-picker.entry.js +2 -1
  133. package/dist/esm/vertex-color-swatch.entry.js +4 -0
  134. package/dist/esm/vertex-dialog.entry.js +1 -1
  135. package/dist/esm/vertex-icon-button.entry.js +2 -2
  136. package/dist/esm/vertex-icon.entry.js +2 -2
  137. package/dist/esm/vertex-popover.entry.js +1 -1
  138. package/dist/esm/vertex-result-list.entry.js +1 -1
  139. package/dist/esm/vertex-search-bar.entry.js +1 -1
  140. package/dist/esm/vertex-select.entry.js +1 -1
  141. package/dist/esm/vertex-tab.entry.js +3 -0
  142. package/dist/esm/vertex-tabs.entry.js +4 -0
  143. package/dist/esm/vertex-textfield.entry.js +1 -1
  144. package/dist/esm/vertex-tooltip.entry.js +2 -1
  145. package/dist/types/components/color-circle-picker/color-circle-picker.d.ts +7 -7
  146. package/dist/types/components/color-picker/color-picker.d.ts +19 -0
  147. package/dist/types/components/{color-circle/color-circle.d.ts → color-swatch/color-swatch.d.ts} +23 -5
  148. package/dist/types/components/color-swatch/lib.d.ts +1 -0
  149. package/dist/types/components/icon/icons/caution.d.ts +3 -0
  150. package/dist/types/components/icon/icons/compare.d.ts +3 -0
  151. package/dist/types/components/icon/icons/compress.d.ts +3 -0
  152. package/dist/types/components/icon/icons/cube-stack.d.ts +3 -0
  153. package/dist/types/components/icon/icons/expand.d.ts +3 -0
  154. package/dist/types/components/icon/icons/pin-text-square.d.ts +3 -0
  155. package/dist/types/components/icon/icons/plus-with-arrow.d.ts +3 -0
  156. package/dist/types/components/icon/icons/pmi.d.ts +3 -0
  157. package/dist/types/components/icon/icons/square-dot-outline.d.ts +3 -0
  158. package/dist/types/components/icon/icons/update.d.ts +3 -0
  159. package/dist/types/components/icon/icons/views.d.ts +3 -0
  160. package/dist/types/components/index.d.ts +3 -1
  161. package/dist/types/components/popover/popover.d.ts +7 -0
  162. package/dist/types/components/result-list/result-list.d.ts +6 -1
  163. package/dist/types/components/result-list/types.d.ts +4 -0
  164. package/dist/types/components/search-bar/dom.d.ts +8 -0
  165. package/dist/types/components/search-bar/lib.d.ts +31 -6
  166. package/dist/types/components/search-bar/search-bar.d.ts +125 -42
  167. package/dist/types/components/select/select.d.ts +8 -0
  168. package/dist/types/components/tab/tab.d.ts +11 -0
  169. package/dist/types/components/tab/util.d.ts +1 -0
  170. package/dist/types/components/tabs/tabs.d.ts +23 -0
  171. package/dist/types/components/tooltip/tooltip.d.ts +7 -0
  172. package/dist/types/components.d.ts +254 -96
  173. package/dist/types/types/icon.d.ts +11 -0
  174. package/dist/types/util/templates/element-pool.d.ts +10 -1
  175. package/package.json +4 -3
  176. package/dist/cjs/color-picker-876ace00.js +0 -37
  177. package/dist/cjs/search-bar-bb40cfa7.js +0 -290
  178. package/dist/collection/components/color-circle/color-circle.css +0 -18
  179. package/dist/components/p-03dbb28c.js +0 -1
  180. package/dist/components/p-0f8b9ede.entry.js +0 -1
  181. package/dist/components/p-19318fee.entry.js +0 -1
  182. package/dist/components/p-1d6cb015.entry.js +0 -1
  183. package/dist/components/p-209db2ba.entry.js +0 -1
  184. package/dist/components/p-20a74d5d.entry.js +0 -1
  185. package/dist/components/p-35e7ab78.entry.js +0 -1
  186. package/dist/components/p-4224c2ad.js +0 -1
  187. package/dist/components/p-52739247.js +0 -1
  188. package/dist/components/p-552c128f.js +0 -1
  189. package/dist/components/p-6505cdb3.js +0 -1
  190. package/dist/components/p-7dba2574.entry.js +0 -1
  191. package/dist/components/p-7f64b251.entry.js +0 -1
  192. package/dist/components/p-8434602f.js +0 -1
  193. package/dist/components/p-ae6a3c46.entry.js +0 -1
  194. package/dist/components/p-bd11e7d1.js +0 -1
  195. package/dist/components/p-d9b9aebe.js +0 -1
  196. package/dist/components/p-e576818b.entry.js +0 -1
  197. package/dist/components/p-ebabee40.entry.js +0 -1
  198. package/dist/components/p-f49a7ffd.js +0 -1
  199. package/dist/components/p-f71fc166.entry.js +0 -1
  200. package/dist/esm/color-picker-2e3b51fa.js +0 -35
  201. package/dist/esm/search-bar-59cc151d.js +0 -288
  202. package/dist/esm/vertex-color-circle.entry.js +0 -2
@@ -0,0 +1,525 @@
1
+ import { r as registerInstance, e as createEvent, h, H as Host, g as getElement } from './index-72f28b71.js';
2
+ import { c as classnames } from './index-9c609209.js';
3
+ import { g as generateInstanceFromTemplate } from './templates-797420bf.js';
4
+
5
+ // do not edit .js files directly - edit src/index.jst
6
+
7
+
8
+
9
+ var fastDeepEqual = function equal(a, b) {
10
+ if (a === b) return true;
11
+
12
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
13
+ if (a.constructor !== b.constructor) return false;
14
+
15
+ var length, i, keys;
16
+ if (Array.isArray(a)) {
17
+ length = a.length;
18
+ if (length != b.length) return false;
19
+ for (i = length; i-- !== 0;)
20
+ if (!equal(a[i], b[i])) return false;
21
+ return true;
22
+ }
23
+
24
+
25
+
26
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
27
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
28
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
29
+
30
+ keys = Object.keys(a);
31
+ length = keys.length;
32
+ if (length !== Object.keys(b).length) return false;
33
+
34
+ for (i = length; i-- !== 0;)
35
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
36
+
37
+ for (i = length; i-- !== 0;) {
38
+ var key = keys[i];
39
+
40
+ if (!equal(a[key], b[key])) return false;
41
+ }
42
+
43
+ return true;
44
+ }
45
+
46
+ // true if both NaN, false otherwise
47
+ return a!==a && b!==b;
48
+ };
49
+
50
+ const getWindowSelection = () => {
51
+ if (typeof window !== 'undefined') {
52
+ return window.getSelection();
53
+ }
54
+ return undefined;
55
+ };
56
+ const nodeHasChildNodes = (node) => {
57
+ return node.hasChildNodes();
58
+ };
59
+ const createDocumentRange = () => {
60
+ return document.createRange();
61
+ };
62
+ const createTextNode = (text) => {
63
+ return new Text(text);
64
+ };
65
+ const createBreak = () => {
66
+ return document.createElement('br');
67
+ };
68
+ const isHtmlElement = (node) => {
69
+ return node instanceof HTMLElement;
70
+ };
71
+ const isBrElement = (node) => {
72
+ return node instanceof HTMLBRElement;
73
+ };
74
+
75
+ const createResultUri = (result) => {
76
+ return `${result.type}:${result.id}`;
77
+ };
78
+ const createSearchResultReplacement = (result, before, after) => {
79
+ const urn = createResultUri(result);
80
+ return {
81
+ before: createTextNode(before),
82
+ beforeSpace: createTextNode(createHairSpace()),
83
+ result: createTextNode(urn),
84
+ afterSpace: after != null
85
+ ? createTextNode(createNoBreakSpace())
86
+ : createTextNode(createHairSpace()),
87
+ after: after != null ? createTextNode(after) : undefined,
88
+ };
89
+ };
90
+ /**
91
+ * Newline characters and spaces are represented slightly differently within a
92
+ * content editable element between browsers. This method standardizes the
93
+ * representation of those characters to avoid having to write branching logic
94
+ * to support each individual browser.
95
+ */
96
+ const standardizeNewlinesAndSpaces = (node) => {
97
+ const content = node.textContent;
98
+ if (content === '\n') {
99
+ return [createBreak()];
100
+ }
101
+ else if (content != null && content.includes('\n')) {
102
+ const split = content.split('\n');
103
+ return split.reduce((res, substr, i) => {
104
+ const previous = split[i - 1];
105
+ // Ignore the empty string if the prior element was converted
106
+ // to a breaking element to prevent duplication of newlines.
107
+ if (substr === '' && previous !== '') {
108
+ return res;
109
+ }
110
+ return [
111
+ ...res,
112
+ // Standard spaces are not always respected with in `Text`
113
+ // elements when appended to a contenteditable element. This
114
+ // conversion preserves that spacing.
115
+ createTextNode(substr.replace(/ /g, createNoBreakSpace())),
116
+ createBreak(),
117
+ ];
118
+ }, []);
119
+ }
120
+ return [node];
121
+ };
122
+ const getNodesForSearchResultReplacement = (replacement, isBreaking = false) => {
123
+ const keys = Object.keys(replacement);
124
+ const replacementElements = keys
125
+ .map((key) => replacement[key])
126
+ .filter((node) => node != null);
127
+ // If the element is intended to replace a breaking element such
128
+ // as a `<div>` wrapper, a newline is required alongside the standard
129
+ // replacement elements.
130
+ if (isBreaking) {
131
+ return [createTextNode('\n'), ...replacementElements];
132
+ }
133
+ return replacementElements;
134
+ };
135
+ /**
136
+ * We leverage a couple unique spaces to represent mentions, allowing for
137
+ * correct cursor movement when using arrow keys. As these characters are
138
+ * purely for functional behavior of the input, `trimNonstandardSpaces`
139
+ * will remove them so the input is suitable for emitting.
140
+ *
141
+ * U+200A is a "Hair Space" which acts as a space, but is not visually
142
+ * represented as one.
143
+ *
144
+ * U+00A0 is a "No-Break Space" which is commonly added by browsers
145
+ * when interacting with a contenteditable element.
146
+ */
147
+ const trimNonstandardSpaces = (text) => {
148
+ return text.replace(/[\u200A]/g, '').replace(/[\u00A0]/g, ' ');
149
+ };
150
+ const createHairSpace = () => {
151
+ return String.fromCharCode(8202);
152
+ };
153
+ const createNoBreakSpace = () => {
154
+ return String.fromCharCode(160);
155
+ };
156
+
157
+ const searchBarCss = ".wrapper.sc-vertex-search-bar{display:flex;align-items:center;width:100%;box-sizing:border-box;background:none;border:1px solid transparent;border-radius:4px;font-family:var(--vertex-ui-font-family);font-size:0.875rem;line-height:1.4}.content-input.sc-vertex-search-bar{width:100%;box-sizing:border-box;padding:6px 0.5em 7px;border:1px solid transparent;background:none;font-family:var(--vertex-ui-font-family);font-weight:var(--vertex-ui-font-weight-base);font-size:0.875rem;line-height:1.4;white-space:pre-line}.content-input.sc-vertex-search-bar:focus{outline:none}.standard.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);color:var(--vertex-ui-neutral-800)}.standard.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.standard.sc-vertex-search-bar:hover:not(.disabled),.standard.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-500)}.standard.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.standard.disabled.sc-vertex-search-bar,.standard.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.blank.sc-vertex-search-bar{color:var(--vertex-ui-neutral-800)}.blank.sc-vertex-search-bar:not(:hover) .content-input.sc-vertex-search-bar:focus{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-500)}.blank.sc-vertex-search-bar:hover:not(.disabled) .content-input.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-400);border-radius:4px}.blank.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-200)}.blank.disabled.sc-vertex-search-bar,.blank.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-800)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.filled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.filled.sc-vertex-search-bar:hover:not(.disabled),.filled.sc-vertex-search-bar:focus{border-bottom-color:var(--vertex-ui-blue-600)}.filled.disabled.sc-vertex-search-bar{border-color:var(--vertex-ui-neutral-100)}.filled.disabled.sc-vertex-search-bar,.filled.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar{background-color:var(--vertex-ui-white);border-color:var(--vertex-ui-white) var(--vertex-ui-white) var(--vertex-ui-neutral-400) var(--vertex-ui-white);color:var(--vertex-ui-neutral-800)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-700)}.underlined.sc-vertex-search-bar:hover:not(.disabled),.underlined.sc-vertex-search-bar:focus{background-color:var(--vertex-ui-neutral-200);border-color:var(--vertex-ui-neutral-200);border-bottom-color:var(--vertex-ui-blue-600)}.underlined.disabled.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-neutral-200)}.underlined.disabled.sc-vertex-search-bar,.underlined.disabled.sc-vertex-search-bar .content-input.sc-vertex-search-bar:empty::before{content:attr(data-placeholder);color:var(--vertex-ui-neutral-400)}.underlined.has-error.sc-vertex-search-bar{border-bottom-color:var(--vertex-ui-red-600)}";
158
+
159
+ const SearchBar = class {
160
+ constructor(hostRef) {
161
+ registerInstance(this, hostRef);
162
+ this.searchChanged = createEvent(this, "searchChanged", 7);
163
+ this.inputChanged = createEvent(this, "inputChanged", 7);
164
+ this.resultReplaced = createEvent(this, "resultReplaced", 7);
165
+ this.inputFocus = createEvent(this, "inputFocus", 7);
166
+ this.inputBlur = createEvent(this, "inputBlur", 7);
167
+ this.rawElements = [];
168
+ this.attemptReplaceElement = (child, other, replacement, isBreaking = false) => {
169
+ // In the case that the child we're evaluating has its own children
170
+ // (often a wrapper `<div>`), we want to evaluate whether any of its
171
+ // children is the target to replace.
172
+ if (nodeHasChildNodes(child) &&
173
+ Array.from(child.childNodes).some((c) => nodeHasChildNodes(c) || this.isIdenticalElement(c, other))) {
174
+ return Array.from(child.childNodes).reduce((res, c) => [
175
+ ...res,
176
+ ...this.attemptReplaceElement(c, other, replacement,
177
+ // If the element we're evaluating is a wrapper, we want to
178
+ // consider it a breaking element and add a newline to the
179
+ // replaced element only if the previous node is a `Text` node.
180
+ !isHtmlElement(child.previousSibling)),
181
+ ], []);
182
+ }
183
+ else {
184
+ return this.isIdenticalElement(child, other)
185
+ ? getNodesForSearchResultReplacement(replacement, isBreaking)
186
+ : [child];
187
+ }
188
+ };
189
+ this.isIdenticalElement = (child, other) => {
190
+ return (child === this.triggeredElement ||
191
+ this.getTextContent(child) === this.getTextContent(other));
192
+ };
193
+ this.getTextContent = (node) => {
194
+ var _a;
195
+ if (isHtmlElement(node)) {
196
+ return node.innerText;
197
+ }
198
+ return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
199
+ };
200
+ /**
201
+ * Inspects the cursor position for the following conditions:
202
+ *
203
+ * 1. The cursor has moved to text that contains a valid string
204
+ * and trigger character, indicating we need to dispatch a
205
+ * `searchChanged` event and display the results.
206
+ *
207
+ * 2. The cursor has moved within text that contains a valid string
208
+ * and trigger character, indicating we need to dispatch a
209
+ * `searchChanged` event to update the currently displayed results.
210
+ *
211
+ * 3. The cursor has moved to text that does not contain a valid
212
+ * string and trigger character, indicating we need to hide any
213
+ * displayed search results.
214
+ */
215
+ this.handleCursorPositionUpdate = () => {
216
+ var _a, _b;
217
+ const windowRange = (_a = getWindowSelection()) === null || _a === void 0 ? void 0 : _a.getRangeAt(0);
218
+ if (windowRange != null) {
219
+ const triggerText = this.readTriggerValue((_b = windowRange.commonAncestorContainer.textContent) !== null && _b !== void 0 ? _b : '', windowRange.startOffset);
220
+ if (!this.hasTriggered && triggerText != null) {
221
+ this.hasTriggered = true;
222
+ this.triggeredRange = windowRange;
223
+ this.triggeredElement = windowRange.commonAncestorContainer;
224
+ this.searchChanged.emit(triggerText.replace(this.triggerCharacter, ''));
225
+ }
226
+ else if (this.hasTriggered && triggerText != null) {
227
+ this.triggeredRange = windowRange;
228
+ this.triggeredElement = windowRange.commonAncestorContainer;
229
+ this.searchChanged.emit(triggerText.replace(this.triggerCharacter, ''));
230
+ }
231
+ else {
232
+ this.hasTriggered = false;
233
+ this.triggeredRange = undefined;
234
+ this.triggeredElement = undefined;
235
+ }
236
+ }
237
+ this.cursorPosition = this.getCursorPosition();
238
+ };
239
+ this.readTriggerValue = (value, fromIndex) => {
240
+ const adjustedValue = value.replace(String.fromCharCode(160), ' ');
241
+ const beforeSubstr = adjustedValue.substring(0, fromIndex);
242
+ const afterSubstr = adjustedValue.substring(fromIndex);
243
+ const adjustedBeforeSubstr = beforeSubstr.includes(this.triggerCharacter)
244
+ ? beforeSubstr.substring(beforeSubstr.lastIndexOf(this.triggerCharacter))
245
+ : '';
246
+ const adjustedAfterSubstr = afterSubstr.substring(0, this.firstIndexOfBreakCharacter(afterSubstr));
247
+ const result = `${adjustedBeforeSubstr}${adjustedAfterSubstr}`;
248
+ return result.includes(this.triggerCharacter) &&
249
+ !this.includesBreakCharacter(result)
250
+ ? result
251
+ : undefined;
252
+ };
253
+ this.includesBreakCharacter = (value) => {
254
+ return this.breakCharacters.some((bc) => value.includes(bc));
255
+ };
256
+ this.firstIndexOfBreakCharacter = (value) => {
257
+ const indices = this.breakCharacters
258
+ .map((bc) => value.indexOf(bc))
259
+ .filter((i) => i >= 0);
260
+ return indices.length > 0 ? Math.min(...indices) : value.length;
261
+ };
262
+ this.moveCursorToNodeEnd = (node, collapseToStart = false) => {
263
+ const selection = getWindowSelection();
264
+ if (selection != null) {
265
+ const range = createDocumentRange();
266
+ range.selectNodeContents(node);
267
+ range.collapse(collapseToStart);
268
+ selection.removeAllRanges();
269
+ selection.addRange(range);
270
+ }
271
+ };
272
+ this.getContentAsString = (element) => {
273
+ if (element != null) {
274
+ const res = trimNonstandardSpaces(Array.from(element.childNodes).reduce((res, n) => {
275
+ var _a;
276
+ const previousSiblingIsBlock = n.previousSibling == null || isHtmlElement(n.previousSibling);
277
+ if (isHtmlElement(n) && n.getAttribute('data-replaced') === 'true') {
278
+ /**
279
+ * If an element has been replaced visually, append the original
280
+ * value prior to being replaced.
281
+ */
282
+ return `${res}${n.getAttribute('data-original')}`;
283
+ }
284
+ else if (isHtmlElement(n) && n.childElementCount > 0) {
285
+ /**
286
+ * If an element is a wrapper, we want to treat it as a block element,
287
+ * ensuring newlines before and after the content.
288
+ * Additionally, we want to evaluate each of its children independently.
289
+ * Some browsers will conditionally wrap content in additional wrapper
290
+ * elements we need to unravel.
291
+ */
292
+ return `${res}${previousSiblingIsBlock ? '' : '\n'}${this.getContentAsString(n)}`;
293
+ }
294
+ else if (isBrElement(n)) {
295
+ /**
296
+ * If an element is a `<br>` element, we want to simply represent
297
+ * it as a newline in the returned string.
298
+ */
299
+ return `${res}\n`;
300
+ }
301
+ else if (isHtmlElement(n)) {
302
+ /**
303
+ * If an element is a wrapper, we want to treat it as a block element,
304
+ * ensuring newlines before and after the content.
305
+ * If the prior element is also to be treated as a block format, we
306
+ * will omit the newline before the content to avoid duplicating the
307
+ * behavior.
308
+ */
309
+ return `${res}${previousSiblingIsBlock ? '' : '\n'}${n.innerText}\n`;
310
+ }
311
+ else {
312
+ /**
313
+ * If a node is simply a `Text` node, we just want to append the text
314
+ * if defined.
315
+ */
316
+ return `${res}${(_a = n.textContent) !== null && _a !== void 0 ? _a : ''}`;
317
+ }
318
+ }, ''));
319
+ return res;
320
+ }
321
+ return '';
322
+ };
323
+ this.createReplacedElement = (original, data) => {
324
+ const template = this.hostEl.querySelector('template[slot="replaced"]');
325
+ if (template != null) {
326
+ const instance = generateInstanceFromTemplate(template);
327
+ instance.bindings.bind(data);
328
+ instance.element.id = data.id;
329
+ instance.element.style.display = 'inline-block';
330
+ instance.element.contentEditable = 'false';
331
+ instance.element.tabIndex = -1;
332
+ instance.element.setAttribute('data-replaced', 'true');
333
+ instance.element.setAttribute('data-original', original);
334
+ return instance.element;
335
+ }
336
+ else {
337
+ throw new Error('Replaced template not defined.');
338
+ }
339
+ };
340
+ this.variant = 'standard';
341
+ this.disabled = false;
342
+ this.triggerCharacter = '@';
343
+ this.breakCharacters = [' ', '\n'];
344
+ this.resultItems = undefined;
345
+ this.placement = 'bottom-start';
346
+ this.value = undefined;
347
+ this.placeholder = undefined;
348
+ this.replacements = [];
349
+ this.replacementUriType = 'user';
350
+ this.cursorPosition = undefined;
351
+ this.displayedElements = [];
352
+ this.hasTriggered = false;
353
+ this.handleKeyDown = this.handleKeyDown.bind(this);
354
+ this.handleKeyUp = this.handleKeyUp.bind(this);
355
+ this.handleResultClick = this.handleResultClick.bind(this);
356
+ this.handleClick = this.handleClick.bind(this);
357
+ this.handleWindowClick = this.handleWindowClick.bind(this);
358
+ this.handleInput = this.handleInput.bind(this);
359
+ this.handleBlur = this.handleBlur.bind(this);
360
+ this.handleFocus = this.handleFocus.bind(this);
361
+ this.handleCursorPositionUpdate =
362
+ this.handleCursorPositionUpdate.bind(this);
363
+ this.updateContent = this.updateContent.bind(this);
364
+ this.replaceContent = this.replaceContent.bind(this);
365
+ }
366
+ componentDidLoad() {
367
+ this.replaceContent(this.value);
368
+ }
369
+ connectedCallback() {
370
+ window.addEventListener('click', this.handleWindowClick);
371
+ }
372
+ disconnectedCallback() {
373
+ window.removeEventListener('click', this.handleWindowClick);
374
+ }
375
+ replaceContent(newValue, oldValue) {
376
+ if (newValue != null && newValue !== oldValue) {
377
+ const pattern = `${this.replacementUriType}:[0-9a-z-]{36}`;
378
+ const matches = newValue.match(new RegExp(pattern, 'g'));
379
+ const replacementsMap = this.replacements.reduce((map, r) => (Object.assign(Object.assign({}, map), { [createResultUri(r)]: r })), {});
380
+ let nextSubstr = newValue;
381
+ const parts = matches != null
382
+ ? matches === null || matches === void 0 ? void 0 : matches.reduce((res, m) => {
383
+ if (replacementsMap[m] != null) {
384
+ const urn = createResultUri(replacementsMap[m]);
385
+ const index = nextSubstr.indexOf(urn);
386
+ const before = nextSubstr.substring(0, index);
387
+ const after = nextSubstr.substring(index + urn.length);
388
+ const replacement = createSearchResultReplacement(replacementsMap[m], before);
389
+ nextSubstr = after;
390
+ return [
391
+ ...res,
392
+ replacement.before,
393
+ replacement.beforeSpace,
394
+ replacement.result,
395
+ replacement.afterSpace,
396
+ ];
397
+ }
398
+ return res;
399
+ }, [])
400
+ : [];
401
+ this.rawElements = [...parts, createTextNode(nextSubstr)].reduce((res, p) => [...res, ...standardizeNewlinesAndSpaces(p)], []);
402
+ this.updateContent(this.replacements);
403
+ }
404
+ }
405
+ updateContent(newValue, oldValue) {
406
+ if (this.contentEl != null && !fastDeepEqual(newValue, oldValue)) {
407
+ this.contentEl.innerHTML = '';
408
+ this.displayedElements = this.rawElements.map((el) => {
409
+ const raw = isHtmlElement(el) ? el.innerText : el.textContent;
410
+ const replacement = this.replacements.find((r) => raw === null || raw === void 0 ? void 0 : raw.includes(createResultUri(r)));
411
+ if (raw != null && replacement != null) {
412
+ const replacementElement = this.createReplacedElement(raw, replacement);
413
+ return replacementElement;
414
+ }
415
+ return el;
416
+ });
417
+ this.displayedElements.forEach((el) => {
418
+ var _a;
419
+ (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.appendChild(typeof el === 'string' ? createTextNode(el) : el);
420
+ });
421
+ if (this.lastReplacedSpace != null) {
422
+ this.moveCursorToNodeEnd(this.lastReplacedSpace);
423
+ }
424
+ this.inputChanged.emit(this.getContentAsString(this.contentEl));
425
+ }
426
+ }
427
+ render() {
428
+ var _a;
429
+ const classes = classnames('wrapper', {
430
+ standard: this.variant === 'standard',
431
+ filled: this.variant === 'filled',
432
+ underlined: this.variant === 'underlined',
433
+ blank: this.variant === 'blank',
434
+ disabled: this.disabled,
435
+ });
436
+ 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 &&
437
+ this.resultItems != null &&
438
+ 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" })));
439
+ }
440
+ handleKeyDown(event) {
441
+ if (this.hasTriggered && this.breakCharacters.includes(event.key)) {
442
+ this.hasTriggered = false;
443
+ this.triggeredRange = undefined;
444
+ this.triggeredElement = undefined;
445
+ }
446
+ }
447
+ handleKeyUp(event) {
448
+ this.handleCursorPositionUpdate();
449
+ this.cursorPosition = this.getCursorPosition();
450
+ }
451
+ async handleInput() {
452
+ this.inputChanged.emit(this.getContentAsString(this.contentEl));
453
+ }
454
+ handleClick() {
455
+ this.handleCursorPositionUpdate();
456
+ }
457
+ handleWindowClick(event) {
458
+ if (isHtmlElement(event.target) &&
459
+ event.target.getAttribute('data-replaced') === 'true' &&
460
+ event.target.nextSibling != null) {
461
+ this.moveCursorToNodeEnd(event.target.nextSibling, true);
462
+ }
463
+ }
464
+ handleFocus(event) {
465
+ this.inputFocus.emit(event);
466
+ }
467
+ handleBlur(event) {
468
+ this.hasTriggered = false;
469
+ this.inputBlur.emit(event);
470
+ }
471
+ handleResultClick(event) {
472
+ var _a;
473
+ const triggeredRange = this.triggeredRange;
474
+ const triggeredElement = this.triggeredElement;
475
+ const value = isHtmlElement(triggeredElement)
476
+ ? triggeredElement.innerText
477
+ : triggeredElement === null || triggeredElement === void 0 ? void 0 : triggeredElement.textContent;
478
+ if (this.contentEl != null &&
479
+ triggeredRange != null &&
480
+ triggeredElement != null &&
481
+ value != null) {
482
+ const triggeredValue = (_a = this.readTriggerValue(value, triggeredRange.startOffset)) !== null && _a !== void 0 ? _a : '';
483
+ const split = value.split(triggeredValue);
484
+ const before = split[0];
485
+ const after = split[1];
486
+ const replacement = createSearchResultReplacement(event.detail, before, after);
487
+ this.lastReplacedSpace = replacement.afterSpace;
488
+ this.rawElements = Array.from(this.contentEl.childNodes).reduce((re, e) => {
489
+ return [
490
+ ...re,
491
+ ...this.attemptReplaceElement(e, triggeredElement, replacement),
492
+ ];
493
+ }, []);
494
+ this.hasTriggered = false;
495
+ this.resultReplaced.emit(event.detail);
496
+ this.replacements = [
497
+ ...this.replacements.filter((r) => r.id !== event.detail.id),
498
+ event.detail,
499
+ ];
500
+ }
501
+ }
502
+ getCursorPosition() {
503
+ var _a;
504
+ const selection = getWindowSelection();
505
+ if (selection != null && selection.rangeCount > 0) {
506
+ const cursorBounds = selection.getRangeAt(0).getBoundingClientRect();
507
+ const contentBounds = (_a = this.contentEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
508
+ const cursorBottom = cursorBounds.bottom || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.bottom) || 0;
509
+ const cursorTop = cursorBounds.top || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.top) || 0;
510
+ return {
511
+ x: cursorBounds.left || (contentBounds === null || contentBounds === void 0 ? void 0 : contentBounds.left) || 0,
512
+ y: this.placement.includes('top') ? cursorTop : cursorBottom,
513
+ };
514
+ }
515
+ throw new Error('Unable to retrieve window selection.');
516
+ }
517
+ get hostEl() { return getElement(this); }
518
+ static get watchers() { return {
519
+ "value": ["replaceContent"],
520
+ "replacements": ["updateContent"]
521
+ }; }
522
+ };
523
+ SearchBar.style = searchBarCss;
524
+
525
+ export { SearchBar as S };
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, e as createEvent, h, c as readTask, g as getElement } from './index-72f28b71.js';
2
2
  import { c as classnames } from './index-9c609209.js';
3
3
 
4
- const selectCss = ":host{--select-width:100%}.root{display:inline-block;color:var(--vertex-ui-neutral-700);width:var(--select-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);overflow:hidden;user-select:none}.root:not(.disabled):hover{color:var(--vertex-ui-neutral-800)}.root.disabled{color:var(--vertex-ui-neutral-400)}.target,.selected-option{background-color:var(--vertex-ui-neutral-200);width:100%;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;padding:0.375rem 0.75rem 0.375rem 0.75rem}.target.hidden{box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)}.selected-option.disabled,.target.disabled{background-color:var(--vertex-ui-neutral-100);cursor:default}.target{border-radius:4px}.icon{padding-left:1rem;margin-left:auto}.options{position:relative;cursor:pointer;background-color:var(--vertex-ui-white);border-radius:4px;padding:0.25rem 0;top:-0.25rem;box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)}.options.animated{transition:opacity 0.1s ease-in 0.05s;opacity:0}.options.hidden{background-color:transparent}.options.visible{opacity:1}.options>*,.options>slot::slotted(*){padding:0.375rem 0.75rem 0.375rem 0.75rem}.options.hidden>*,.options.hidden>slot::slotted(*){opacity:0}.options>slot::slotted(:hover){background-color:var(--vertex-ui-neutral-200)}vertex-popover{--transform-origin:top left;--open-animation-name:open-scale-y;--close-animation-name:close-scale-y}";
4
+ const selectCss = ":host{--select-width:100%;--select-option-white-space:normal;--max-dropdown-height:80vh}.root{display:inline-block;color:var(--vertex-ui-neutral-700);width:var(--select-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);overflow:hidden;user-select:none}.root:not(.disabled):hover{color:var(--vertex-ui-neutral-800)}.root.disabled{color:var(--vertex-ui-neutral-400)}.target,.selected-option{background-color:var(--vertex-ui-neutral-200);width:100%;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;padding:0.375rem 0.75rem 0.375rem 0.75rem}.target.hidden{box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)}.selected-option.disabled,.target.disabled{background-color:var(--vertex-ui-neutral-100);cursor:default}.target{border-radius:4px}.text{white-space:var(--select-option-white-space);overflow:hidden;text-overflow:ellipsis}.icon{padding-left:1rem;margin-left:auto}.options{position:relative;cursor:pointer;background-color:var(--vertex-ui-white);border-radius:4px;padding:0.25rem 0;top:-0.25rem;box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);max-height:var(--max-dropdown-height);overflow-y:auto}.options.animated{transition:opacity 0.1s ease-in 0.05s;opacity:0}.options.hidden{background-color:transparent}.options.visible{opacity:1}.options>*,.options>slot::slotted(*){padding:0.375rem 0.75rem 0.375rem 0.75rem}.options.hidden>*,.options.hidden>slot::slotted(*){opacity:0}.options>slot::slotted(:hover){background-color:var(--vertex-ui-neutral-200)}.options>slot::slotted([data-selected=\"true\"]){display:none}vertex-popover{--transform-origin:top left;--open-animation-name:open-scale-y;--close-animation-name:close-scale-y}";
5
5
 
6
6
  const GET_BOUNDS_DEBOUNCE_THRESHOLD = 200;
7
7
  const Select = class {
@@ -14,6 +14,7 @@ const Select = class {
14
14
  this.placeholder = 'Select an option...';
15
15
  this.disabled = false;
16
16
  this.animated = true;
17
+ this.hideSelected = true;
17
18
  this.open = false;
18
19
  this.position = undefined;
19
20
  this.displayValue = undefined;
@@ -33,6 +34,9 @@ const Select = class {
33
34
  if (this.value != null) {
34
35
  this.handleUpdateValue(this.value);
35
36
  }
37
+ else {
38
+ this.handleUpdateDisplayValue();
39
+ }
36
40
  }
37
41
  connectedCallback() {
38
42
  window.addEventListener('resize', this.getBounds);
@@ -50,6 +54,13 @@ const Select = class {
50
54
  }
51
55
  this.controlled = value != null;
52
56
  }
57
+ handleUpdateDisplayValue() {
58
+ var _a;
59
+ this.clearSelectedOptionFlag();
60
+ if (this.hideSelected) {
61
+ (_a = this.getSelectedOption()) === null || _a === void 0 ? void 0 : _a.setAttribute('data-selected', 'true');
62
+ }
63
+ }
53
64
  render() {
54
65
  return (h("div", { class: classnames('root', {
55
66
  disabled: this.disabled,
@@ -58,7 +69,7 @@ const Select = class {
58
69
  }, onClick: !this.open && !this.disabled ? this.handleOpen : undefined }, h("div", { class: classnames('target', {
59
70
  hidden: this.open,
60
71
  disabled: this.disabled,
61
- }) }, this.displayValue || this.placeholder, h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("vertex-popover", { position: this.position, open: this.open, animated: this.animated, resizeBehavior: "fixed", onDismissed: this.handleDismiss }, h("div", { class: classnames('options', {
72
+ }) }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("vertex-popover", { position: this.position, open: this.open, animated: this.animated, resizeBehavior: "fixed", onDismissed: this.handleDismiss }, h("div", { class: classnames('options', {
62
73
  hidden: !this.open,
63
74
  visible: this.open,
64
75
  animated: this.animated,
@@ -66,7 +77,7 @@ const Select = class {
66
77
  minWidth: this.width != null ? `${this.width}px` : 'var(--select-width)',
67
78
  } }, h("div", { class: classnames('selected-option', {
68
79
  disabled: this.disabled,
69
- }), onClick: this.handleDismiss }, this.displayValue || this.placeholder, h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("slot", null)))));
80
+ }), onClick: this.handleDismiss }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("slot", null)))));
70
81
  }
71
82
  handleOpen() {
72
83
  var _a, _b;
@@ -105,6 +116,15 @@ const Select = class {
105
116
  this.removeListeners.forEach((l) => l());
106
117
  this.removeListeners = [];
107
118
  }
119
+ clearSelectedOptionFlag() {
120
+ var _a, _b;
121
+ (_b = (_a = this.slotElement) === null || _a === void 0 ? void 0 : _a.assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a).forEach((e) => e.removeAttribute('data-selected'));
122
+ }
123
+ getSelectedOption() {
124
+ var _a, _b, _c;
125
+ const value = (_a = this.displayValue) !== null && _a !== void 0 ? _a : this.placeholder;
126
+ return (_c = (_b = this.slotElement) === null || _b === void 0 ? void 0 : _b.assignedElements) === null || _c === void 0 ? void 0 : _c.call(_b).find((e) => e.getAttribute('data-value') === value || e.innerHTML === value);
127
+ }
108
128
  getBounds() {
109
129
  if (this.getBoundsTimeout != null) {
110
130
  clearTimeout(this.getBoundsTimeout);
@@ -128,7 +148,10 @@ const Select = class {
128
148
  }
129
149
  get hostElement() { return getElement(this); }
130
150
  static get watchers() { return {
131
- "value": ["handleUpdateValue"]
151
+ "value": ["handleUpdateValue"],
152
+ "displayValue": ["handleUpdateDisplayValue"],
153
+ "hideSelected": ["handleUpdateDisplayValue"],
154
+ "placeholder": ["handleUpdateDisplayValue"]
132
155
  }; }
133
156
  };
134
157
  Select.style = selectCss;
@@ -0,0 +1,24 @@
1
+ import { r as registerInstance, e as createEvent, h, H as Host } from './index-72f28b71.js';
2
+ import { c as classnames } from './index-9c609209.js';
3
+
4
+ const tabCss = ":host{position:relative;width:100%;height:100%}.content{display:none;height:0px}.content.active{display:flex;width:100%;height:100%}";
5
+
6
+ const Tab = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.tabClick = createEvent(this, "tabClick", 7);
10
+ this.handleClick = () => {
11
+ this.tabClick.emit(this.label);
12
+ };
13
+ this.label = undefined;
14
+ this.active = false;
15
+ }
16
+ render() {
17
+ return (h(Host, null, h("div", { class: classnames('content', {
18
+ active: this.active,
19
+ }) }, h("slot", null))));
20
+ }
21
+ };
22
+ Tab.style = tabCss;
23
+
24
+ export { Tab as T };