q2-tecton-elements 1.13.0-alpha.0 → 1.13.2

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 (235) hide show
  1. package/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
  2. package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
  3. package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
  4. package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
  7. package/dist/cjs/q2-badge.cjs.entry.js +43 -0
  8. package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
  9. package/dist/cjs/q2-calendar.cjs.entry.js +54 -59
  10. package/dist/cjs/q2-card.cjs.entry.js +127 -0
  11. package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
  12. package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
  13. package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
  14. package/dist/cjs/q2-checkbox.cjs.entry.js +19 -11
  15. package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
  16. package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
  17. package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
  18. package/dist/cjs/q2-icon.cjs.entry.js +3 -3
  19. package/dist/cjs/q2-input.cjs.entry.js +439 -437
  20. package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
  21. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-message.cjs.entry.js +5 -5
  23. package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
  24. package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
  25. package/dist/cjs/q2-option.cjs.entry.js +3 -11
  26. package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
  27. package/dist/cjs/q2-pill.cjs.entry.js +137 -0
  28. package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
  29. package/dist/cjs/q2-radio.cjs.entry.js +21 -4
  30. package/dist/cjs/q2-section.cjs.entry.js +5 -7
  31. package/dist/cjs/q2-select.cjs.entry.js +36 -31
  32. package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
  33. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
  34. package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
  35. package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
  36. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-tag.cjs.entry.js +94 -0
  38. package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
  39. package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
  40. package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
  41. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
  42. package/dist/collection/collection-manifest.json +10 -3
  43. package/dist/collection/components/click-elsewhere/index.js +4 -6
  44. package/dist/collection/components/q2-badge/index.js +148 -0
  45. package/dist/collection/components/q2-badge/styles.css +134 -0
  46. package/dist/collection/components/q2-btn/index.js +14 -14
  47. package/dist/collection/components/q2-btn/styles.css +1 -1
  48. package/dist/collection/components/q2-calendar/helpers.js +22 -20
  49. package/dist/collection/components/q2-calendar/index.js +45 -37
  50. package/dist/collection/components/q2-calendar/validation.js +4 -2
  51. package/dist/collection/components/q2-card/index.js +347 -0
  52. package/dist/collection/components/q2-card/styles.css +177 -0
  53. package/dist/collection/components/q2-carousel/index.js +11 -16
  54. package/dist/collection/components/q2-carousel/styles.css +3 -3
  55. package/dist/collection/components/q2-carousel-pane/index.js +2 -2
  56. package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
  57. package/dist/collection/components/q2-checkbox/index.js +36 -11
  58. package/dist/collection/components/q2-checkbox/styles.css +1 -0
  59. package/dist/collection/components/q2-checkbox-group/index.js +22 -1
  60. package/dist/collection/components/q2-dropdown/index.js +6 -15
  61. package/dist/collection/components/q2-dropdown-item/index.js +5 -5
  62. package/dist/collection/components/q2-editable-field/index.js +3 -6
  63. package/dist/collection/components/q2-icon/icons.js +393 -383
  64. package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
  65. package/dist/collection/components/q2-input/formatting/currency.js +162 -162
  66. package/dist/collection/components/q2-input/formatting/date.js +1 -1
  67. package/dist/collection/components/q2-input/formatting/generic.js +7 -8
  68. package/dist/collection/components/q2-input/formatting/number.js +6 -9
  69. package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
  70. package/dist/collection/components/q2-input/formatting/phone.js +215 -215
  71. package/dist/collection/components/q2-input/formatting/postal.js +1 -1
  72. package/dist/collection/components/q2-input/index.js +81 -25
  73. package/dist/collection/components/q2-input/styles.css +19 -14
  74. package/dist/collection/components/q2-loading/index.js +4 -4
  75. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
  76. package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
  77. package/dist/collection/components/q2-message/index.js +3 -3
  78. package/dist/collection/components/q2-optgroup/index.js +1 -1
  79. package/dist/collection/components/q2-option/index.js +19 -25
  80. package/dist/collection/components/q2-option/styles.css +5 -0
  81. package/dist/collection/components/q2-option-list/index.js +648 -0
  82. package/dist/collection/components/q2-option-list/styles.css +128 -0
  83. package/dist/collection/components/q2-pagination/index.js +275 -0
  84. package/dist/collection/components/q2-pagination/styles.css +120 -0
  85. package/dist/collection/components/q2-pill/index.js +324 -0
  86. package/dist/collection/components/q2-pill/styles.css +229 -0
  87. package/dist/collection/components/q2-radio/index.js +38 -1
  88. package/dist/collection/components/q2-radio-group/index.js +66 -24
  89. package/dist/collection/components/q2-section/index.js +5 -7
  90. package/dist/collection/components/q2-select/index.js +53 -30
  91. package/dist/collection/components/q2-stepper/index.js +8 -10
  92. package/dist/collection/components/q2-stepper/styles.css +5 -5
  93. package/dist/collection/components/q2-stepper-pane/index.js +133 -5
  94. package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
  95. package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
  96. package/dist/collection/components/q2-tab-container/index.js +11 -7
  97. package/dist/collection/components/q2-tag/index.js +200 -0
  98. package/dist/collection/components/q2-tag/styles.css +141 -0
  99. package/dist/collection/components/q2-textarea/index.js +6 -6
  100. package/dist/collection/components/tecton-tab-pane/index.js +3 -10
  101. package/dist/collection/utils/index.js +25 -13
  102. package/dist/esm/click-elsewhere.entry.js +5 -7
  103. package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
  104. package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
  105. package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
  106. package/dist/esm/loader.js +3 -3
  107. package/dist/esm/polyfills/css-shim.js +1 -1
  108. package/dist/esm/q2-avatar.entry.js +2 -2
  109. package/dist/esm/q2-badge.entry.js +39 -0
  110. package/dist/esm/q2-btn_2.entry.js +13 -13
  111. package/dist/esm/q2-calendar.entry.js +54 -59
  112. package/dist/esm/q2-card.entry.js +123 -0
  113. package/dist/esm/q2-carousel-pane.entry.js +5 -5
  114. package/dist/esm/q2-carousel.entry.js +318 -106
  115. package/dist/esm/q2-checkbox-group.entry.js +6 -3
  116. package/dist/esm/q2-checkbox.entry.js +19 -11
  117. package/dist/esm/q2-dropdown-item.entry.js +7 -7
  118. package/dist/esm/q2-dropdown.entry.js +8 -17
  119. package/dist/esm/q2-editable-field.entry.js +5 -8
  120. package/dist/esm/q2-icon.entry.js +3 -3
  121. package/dist/esm/q2-input.entry.js +439 -437
  122. package/dist/esm/q2-loading-element.entry.js +3 -3
  123. package/dist/esm/q2-loc.entry.js +2 -2
  124. package/dist/esm/q2-message.entry.js +5 -5
  125. package/dist/esm/q2-optgroup.entry.js +3 -3
  126. package/dist/esm/q2-option-list.entry.js +355 -0
  127. package/dist/esm/q2-option.entry.js +3 -11
  128. package/dist/esm/q2-pagination.entry.js +112 -0
  129. package/dist/esm/q2-pill.entry.js +133 -0
  130. package/dist/esm/q2-radio-group.entry.js +43 -18
  131. package/dist/esm/q2-radio.entry.js +21 -4
  132. package/dist/esm/q2-section.entry.js +5 -7
  133. package/dist/esm/q2-select.entry.js +36 -31
  134. package/dist/esm/q2-stepper-pane.entry.js +42 -4
  135. package/dist/esm/q2-stepper-vertical.entry.js +274 -0
  136. package/dist/esm/q2-stepper.entry.js +10 -12
  137. package/dist/esm/q2-tab-container.entry.js +12 -8
  138. package/dist/esm/q2-tab-pane.entry.js +1 -1
  139. package/dist/esm/q2-tag.entry.js +90 -0
  140. package/dist/esm/q2-tecton-elements.js +3 -3
  141. package/dist/esm/q2-textarea.entry.js +8 -8
  142. package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
  143. package/dist/esm/tecton-tab-pane.entry.js +2 -5
  144. package/dist/loader/index.d.ts +0 -1
  145. package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
  146. package/dist/q2-tecton-elements/p-01ae8461.entry.js +1 -0
  147. package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
  148. package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
  149. package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
  150. package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
  151. package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
  152. package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
  153. package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
  154. package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
  155. package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
  156. package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
  157. package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
  158. package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
  159. package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
  160. package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
  161. package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
  162. package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
  163. package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
  164. package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
  165. package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
  167. package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
  168. package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
  170. package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
  171. package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/p-ae130f70.entry.js +1 -0
  173. package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
  174. package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
  175. package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
  176. package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
  177. package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
  178. package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
  179. package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
  180. package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
  181. package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
  182. package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
  183. package/dist/q2-tecton-elements/p-ffbded54.entry.js +1 -0
  184. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  185. package/dist/test/elements/q2-tag-test.js +151 -0
  186. package/dist/test/helpers.js +20 -9
  187. package/dist/types/components/q2-badge/index.d.ts +13 -0
  188. package/dist/types/components/q2-btn/index.d.ts +3 -3
  189. package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
  190. package/dist/types/components/q2-calendar/index.d.ts +2 -1
  191. package/dist/types/components/q2-calendar/validation.d.ts +1 -1
  192. package/dist/types/components/q2-card/index.d.ts +35 -0
  193. package/dist/types/components/q2-checkbox/index.d.ts +3 -1
  194. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
  195. package/dist/types/components/q2-dropdown/index.d.ts +1 -1
  196. package/dist/types/components/q2-editable-field/index.d.ts +1 -1
  197. package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
  198. package/dist/types/components/q2-input/index.d.ts +5 -2
  199. package/dist/types/components/q2-option/index.d.ts +2 -3
  200. package/dist/types/components/q2-option-list/index.d.ts +62 -0
  201. package/dist/types/components/q2-pagination/index.d.ts +30 -0
  202. package/dist/types/components/q2-pill/index.d.ts +39 -0
  203. package/dist/types/components/q2-radio/index.d.ts +4 -1
  204. package/dist/types/components/q2-radio-group/index.d.ts +5 -1
  205. package/dist/types/components/q2-select/index.d.ts +2 -1
  206. package/dist/types/components/q2-stepper/index.d.ts +1 -1
  207. package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
  208. package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
  209. package/dist/types/components/q2-tab-container/index.d.ts +1 -1
  210. package/dist/types/components/q2-tag/index.d.ts +28 -0
  211. package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
  212. package/dist/types/components.d.ts +235 -11
  213. package/dist/types/global.d.ts +1 -0
  214. package/dist/types/stencil-public-runtime.d.ts +6 -4
  215. package/dist/types/util.d.ts +2 -10
  216. package/dist/types/utils/index.d.ts +1 -0
  217. package/dist/types/workspace/workspace/tecton-production_release_1.13.x/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
  218. package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → tecton-production_release_1.13.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
  219. package/package.json +13 -13
  220. package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
  221. package/dist/q2-tecton-elements/p-080839ed.js +0 -1
  222. package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
  223. package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
  224. package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
  225. package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
  226. package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
  227. package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
  228. package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
  229. package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
  230. package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
  231. package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
  232. package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
  233. package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
  234. package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
  235. package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
@@ -1,22 +1,60 @@
1
- import { r as registerInstance, h, g as getElement } from './index-be8376c0.js';
2
- import { c as createGuid, l as loc } from './index-ec6660af.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-dbfb3ecc.js';
2
+ import { c as createGuid, n as nextPaint, l as loc } from './index-0ff8de52.js';
3
3
 
4
4
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;position:relative}";
5
5
 
6
6
  const Q2StepperPane = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
+ this.statusChange = createEvent(this, "statusChange", 7);
10
+ this.activeChange = createEvent(this, "activeChange", 7);
11
+ this.isChildActive = false;
9
12
  }
10
- ////////// LIFECYCLE HOOKS ////////
13
+ /// LifeCycle Hooks ///
11
14
  connectedCallback() {
12
15
  if (!this.hostElement.id)
13
16
  this.hostElement.id = `step-${createGuid()}`;
14
17
  }
18
+ componentWillLoad() {
19
+ this.checkForActiveChildren();
20
+ }
21
+ /// Watchers and Listeners ///
22
+ statusChanged(status) {
23
+ this.statusChange.emit({
24
+ status,
25
+ isActive: !!this.isActive,
26
+ id: this.hostElement.id,
27
+ host: this.hostElement,
28
+ });
29
+ }
30
+ isActiveChanged(isActive) {
31
+ this.activeChange.emit({
32
+ status: this.status || '',
33
+ isActive,
34
+ id: this.hostElement.id,
35
+ host: this.hostElement,
36
+ });
37
+ }
38
+ checkForActiveChildren() {
39
+ if (!this.showWithChildren)
40
+ return;
41
+ nextPaint(() => {
42
+ setTimeout(() => {
43
+ this.isChildActive = !!this.hostElement.querySelector("[slot='children'] > q2-stepper-pane[is-active]");
44
+ });
45
+ });
46
+ }
47
+ /// DOM ///
15
48
  render() {
16
49
  const { label, description, isActive } = this;
17
- return (h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive }, h("slot", null)));
50
+ return (h(Fragment, null, h("div", { role: "tabpanel", "aria-label": label && loc(label), "aria-description": description && loc(description), tabindex: "0", hidden: !isActive && !(this.isChildActive && this.showWithChildren) }, h("slot", null)), h("slot", { name: "children" })));
18
51
  }
19
52
  get hostElement() { return getElement(this); }
53
+ static get watchers() { return {
54
+ "status": ["statusChanged"],
55
+ "isActive": ["isActiveChanged"],
56
+ "showWithChildren": ["checkForActiveChildren"]
57
+ }; }
20
58
  };
21
59
  Q2StepperPane.style = stylesCss;
22
60
 
@@ -0,0 +1,274 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-dbfb3ecc.js';
2
+ import { o as overrideFocus, c as createGuid, i as isEventFromElement, l as loc } from './index-0ff8de52.js';
3
+
4
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:grid;grid-template-columns:var(--tct-advanced-stepper-list-width, var(--t-advanced-stepper-list-width, 180px)) 1fr;gap:var(--tct-advanced-stepper-layout-gap, var(--t-advanced-stepper-layout-gap, 120px))}.step-label,.step-child-label{color:var(--comp-btn-label-color);font-size:var(--comp-btn-label-font-size);font-weight:var(--comp-label-font-weight, 400);height:1.5em}.step-label{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}[aria-selected=true] .step-label{font-weight:var(--tct-advanced-stepper-btn-active-font-weight, var(--t-advanced-stepper-btn-active-font-weight, 600))}[aria-describedby] .step-label{-webkit-line-clamp:1}.step-child-label{grid-area:content;color:var(--comp-btn-label-color)}.step-description{color:var(--tct-advanced-stepper-description-color, var(--t-advanced-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));font-size:var(--tct-advanced-stepper-description-font-size, var(--t-advanced-stepper-description-font-size, var(--app-font-size-small, 12px)));padding-bottom:0.2em}ul{--comp-top-btn-icon-size:var(--tct-advanced-stepper-btn-icon-size, var(--t-advanced-stepper-btn-icon-size, 24px));--comp-btn-icon-size:var(--comp-top-btn-icon-size);--comp-btn-content-gap:var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-3x, 15px)));--comp-btn-label-font-size:var-list(var-prefixer(advanced-stepper-btn-label-font-size), 16px);--comp-btn-label-color:var(--tct-advanced-stepper-label-color, var(--t-advanced-stepper-label-color, var(--t-text, #4d4d4d)));--comp-tween:var(--tct-advanced-stepper-tween, var(--t-advanced-stepper-tween, var(--app-tween-1, 0.2s ease)));list-style:none;margin:0;padding:0}ul ul{--comp-btn-icon-size:var(--tct-advanced-stepper-child-btn-icon-size, var(--t-advanced-stepper-child-btn-icon-size, 12px));--comp-btn-content-gap:var(--tct-advanced-stepper-btn-gap, var(--t-advanced-stepper-btn-gap, var(--app-scale-2x, 10px)));--comp-btn-label-font-size:var-list(\n var-prefixer(advanced-stepper-child-btn-label-font-size),\n --app-font-size-small,\n 12px\n )}ul ul[aria-hidden=true]{display:none}.step-btn,.step-child-btn{display:grid;grid-template-columns:var(--comp-btn-icon-size) 1fr;gap:var(--comp-btn-content-gap);text-align:var(--tct-advanced-stepper-btn-text-align, var(--t-advanced-stepper-btn-text-align, start));grid-template-areas:\"icon content\";align-items:center;width:100%;position:relative;background:transparent;border:0;cursor:pointer;padding:0;transition-property:box-shadow;outline:none}.step-btn[aria-disabled],.step-child-btn[aria-disabled]{cursor:default;--comp-label-font-weight:300;--comp-btn-label-color:var(--tct-advanced-stepper-btn-locked-color, var(--t-advanced-stepper-btn-locked-color, var(--t-textA, rgba(77, 77, 77, 0.77))))}.step-btn[aria-selected=true],.step-child-btn[aria-selected=true]{--comp-label-font-weight:600}.step-btn{min-height:var(--tct-advanced-stepper-btn-height, var(--t-advanced-stepper-btn-height, 40px));font-size:var(--tct-advanced-stepper-btn-font-size, var(--t-advanced-stepper-btn-font-size, 16px));--comp-active-color:var(--t-primary)}.step-btn.status-complete{--comp-active-color:var(--const-stoplight-success)}.step-btn.status-error{--comp-active-color:var(--const-stoplight-alert)}.step-btn.status-locked{cursor:not-allowed}.step-child-btn{--comp-active-color:var(--t-primary);min-height:var(--tct-advanced-stepper-child-btn-height, var(--t-advanced-stepper-child-btn-height, 30px));padding-left:var(--tct-advanced-stepper-child-btn-left-padding, var(--t-advanced-stepper-child-btn-left-padding, var(--app-scale-2x, 10px)));font-size:var(--tct-advanced-stepper-child-btn-font-size, var(--t-advanced-stepper-child-btn-font-size, 12px));border-left-width:var(--tct-advanced-stepper-child-btn-left-border-width, var(--t-advanced-stepper-child-btn-left-border-width, 3px));border-left-style:var(--tct-advanced-stepper-child-btn-left-border-style, var(--t-advanced-stepper-child-btn-left-border-style, solid));border-left-color:transparent}.step-child-btn[aria-selected=true]{--comp-btn-label-color:var(--comp-active-color);border-left-color:var(--comp-active-color)}.step-child-btn.status-error{--comp-btn-label-color:var(--const-stoplight-alert);--comp-active-color:var(--const-stoplight-alert)}.step-child-btn.status-locked{cursor:not-allowed}.step-content{grid-area:content}.step-icon,.step-bubble,.step-child-icon{grid-area:icon;width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size)}.step-icon q2-icon,.step-bubble q2-icon,.step-child-icon q2-icon{width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);--tct-icon-stroke-primary:var(--comp-active-color)}.step-icon,.step-bubble{background:var(--t-primary);color:var(--t-base);border-radius:50%}.status-complete .step-icon,.status-error .step-icon,.status-complete .step-bubble,.status-error .step-bubble{background:var(--comp-active-color)}.step-icon q2-icon,.step-bubble q2-icon{--tct-icon-stroke-secondary:var(--t-base)}.status-locked .step-icon,.status-locked .step-bubble{background:var(--t-gray-12);color:var(--t-text)}[aria-selected=true] .step-icon,[aria-selected=true] .step-bubble{box-shadow:0 0 0 2px var(--t-base), 0 0 0 4px var(--comp-active-color)}.step-bubble{display:flex;justify-content:center;align-items:center;line-height:0}.step-child-icon q2-icon{--tct-icon-stroke-primary:var(--comp-active-color);--tct-icon-stroke-secondary:var(--comp-active-color)}[aria-selected=true] .step-child-icon q2-icon{fill:var(--comp-active-color);--tct-icon-stroke-secondary:var(--t-base)}.spacer{height:var(--tct-advanced-stepper-spacer-height, var(--t-advanced-stepper-spacer-height, var(--app-scale-6x, 30px)));border-left-width:var(--tct-advanced-stepper-child-border-width, var(--t-advanced-stepper-child-border-width, 1px));border-left-style:var(--tct-advanced-stepper-child-border-style, var(--t-advanced-stepper-child-border-style, solid));border-left-color:var(--tct-advanced-stepper-child-border-color, var(--t-advanced-stepper-child-border-color, var(--t-gray-12, #d9d9d9)));overflow:hidden;margin-left:calc(var(--comp-top-btn-icon-size) / 2);transition:height var(--comp-tween)}.spacer ul{opacity:0;transition:opacity var(--comp-tween)}.spacer.is-opening ul,.spacer.is-open ul{display:block;opacity:1 !important}.spacer.is-open{overflow:visible}";
5
+
6
+ const Q2AdvancedStepper = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.change = createEvent(this, "change", 7);
10
+ this.structuredPanes = [];
11
+ this.scheduledAfterRender = [];
12
+ this.determinePaneChanges = (mutations) => {
13
+ mutations.forEach(mutation => {
14
+ var _a, _b;
15
+ if (mutation.type !== 'childList')
16
+ return;
17
+ if (!mutation.addedNodes.length && !mutation.removedNodes.length)
18
+ return;
19
+ if (((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.nodeType) !== Node.ELEMENT_NODE &&
20
+ ((_b = mutation.removedNodes[0]) === null || _b === void 0 ? void 0 : _b.nodeType) !== Node.ELEMENT_NODE)
21
+ return;
22
+ this.buildPaneList();
23
+ });
24
+ };
25
+ this.buildPaneList = () => {
26
+ const { allRootPanes } = this;
27
+ if (!allRootPanes.length)
28
+ return;
29
+ this.structuredPanes = Array.from(allRootPanes).reduce((accum, pane) => {
30
+ var _a, _b;
31
+ const children = Array.from((_b = (_a = pane.querySelector('[slot=children]')) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [])
32
+ .filter(({ tagName }) => tagName === 'Q2-STEPPER-PANE')
33
+ .map(this.extractDetails);
34
+ accum.push(Object.assign(Object.assign({}, this.extractDetails(pane)), { children }));
35
+ return accum;
36
+ }, []);
37
+ };
38
+ /// Event Handlers ///
39
+ this.onStepClick = (event, stepId) => {
40
+ event.stopPropagation();
41
+ const { currentStepId } = this;
42
+ if (stepId === currentStepId)
43
+ return;
44
+ const selectedStep = this.allPanes.find(pane => pane.id === stepId);
45
+ this.change.emit({
46
+ selectedStep,
47
+ selectedStepId: stepId,
48
+ currentStepId,
49
+ });
50
+ };
51
+ this.onStepKeyDown = (event, stepId) => {
52
+ const { key } = event;
53
+ let selectedStepId;
54
+ switch (key) {
55
+ case 'ArrowUp':
56
+ case 'ArrowLeft':
57
+ event.preventDefault();
58
+ selectedStepId = this.getStepId(stepId, 'prev');
59
+ break;
60
+ case 'ArrowDown':
61
+ case 'ArrowRight':
62
+ event.preventDefault();
63
+ selectedStepId = this.getStepId(stepId, 'next');
64
+ break;
65
+ case 'Home':
66
+ event.preventDefault();
67
+ selectedStepId = this.getStepId(stepId, 'first');
68
+ break;
69
+ case 'End':
70
+ event.preventDefault();
71
+ selectedStepId = this.getStepId(stepId, 'last');
72
+ break;
73
+ }
74
+ if (!selectedStepId)
75
+ return;
76
+ this.focusStepBtn(selectedStepId, true);
77
+ };
78
+ }
79
+ /// LifeCycle Hooks ///
80
+ componentWillLoad() {
81
+ this.setDefaultPane();
82
+ this.buildPaneList();
83
+ const observer = new MutationObserver(this.determinePaneChanges);
84
+ const observerOptions = {
85
+ childList: true,
86
+ };
87
+ observer.observe(this.hostElement, observerOptions);
88
+ this.allRootPanes.forEach(pane => {
89
+ const childrenSlot = pane.querySelector('[slot=children]');
90
+ if (childrenSlot)
91
+ observer.observe(childrenSlot, observerOptions);
92
+ });
93
+ this.mutationObserver = observer;
94
+ }
95
+ componentDidLoad() {
96
+ overrideFocus(this.hostElement);
97
+ setTimeout(() => this.showStep(this.currentStepId), 0);
98
+ }
99
+ componentWillUpdate() {
100
+ this.expandedStepChildrenList = null;
101
+ }
102
+ componentDidRender() {
103
+ this.scheduledAfterRender.forEach(fn => fn());
104
+ this.scheduledAfterRender = [];
105
+ this.openCurrentStepChildren();
106
+ }
107
+ disconnectedCallback() {
108
+ this.mutationObserver.disconnect();
109
+ this.mutationObserver = null;
110
+ }
111
+ /// Getters ///
112
+ get allRootPanes() {
113
+ return Array.from(this.hostElement.querySelectorAll(':scope > q2-stepper-pane'));
114
+ }
115
+ get allPanes() {
116
+ return Array.from(this.hostElement.querySelectorAll('q2-stepper-pane'));
117
+ }
118
+ /// Helpers ///
119
+ setDefaultPane() {
120
+ if (this.currentStepId)
121
+ return;
122
+ const firstEnabledStep = this.hostElement.querySelector('q2-stepper-pane');
123
+ if (!firstEnabledStep)
124
+ return;
125
+ if (!firstEnabledStep.id)
126
+ firstEnabledStep.id = `step-${createGuid()}`;
127
+ this.currentStepId = firstEnabledStep.id;
128
+ }
129
+ getStepId(currentStepId, goTo) {
130
+ const allEnabledStepBtns = Array.from(this.hostElement.shadowRoot.querySelectorAll('ul:not([aria-hidden="true"]) > li > button:not([aria-disabled="true"])'));
131
+ const currentStepIndex = allEnabledStepBtns.findIndex(btn => btn.getAttribute('aria-controls') === currentStepId);
132
+ let nextStepIndex;
133
+ switch (goTo) {
134
+ case 'prev':
135
+ nextStepIndex = Math.max(currentStepIndex - 1, 0);
136
+ break;
137
+ case 'next':
138
+ nextStepIndex = Math.min(currentStepIndex + 1, allEnabledStepBtns.length - 1);
139
+ break;
140
+ case 'first':
141
+ nextStepIndex = 0;
142
+ break;
143
+ case 'last':
144
+ nextStepIndex = allEnabledStepBtns.length - 1;
145
+ break;
146
+ }
147
+ return allEnabledStepBtns[nextStepIndex].getAttribute('aria-controls');
148
+ }
149
+ showStep(stepId) {
150
+ this.scheduledAfterRender.push(this.resizeIframe);
151
+ this.showStepPane(stepId);
152
+ this.focusStepBtn(stepId);
153
+ }
154
+ extractDetails(pane) {
155
+ const { label, description, status } = pane;
156
+ if (!pane.id)
157
+ pane.id = `step-${createGuid()}`;
158
+ return {
159
+ id: pane.id,
160
+ label,
161
+ description,
162
+ status,
163
+ };
164
+ }
165
+ resizeIframe() {
166
+ var _a, _b;
167
+ return (_b = (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
168
+ }
169
+ openCurrentStepChildren() {
170
+ const { expandedStepChildrenList } = this;
171
+ const allSpacers = this.hostElement.shadowRoot.querySelectorAll('.spacer');
172
+ allSpacers.forEach(spacer => {
173
+ if (expandedStepChildrenList && spacer.contains(expandedStepChildrenList)) {
174
+ spacer.style.height = `${expandedStepChildrenList.clientHeight}px`;
175
+ if (spacer.classList.contains('is-open'))
176
+ return;
177
+ spacer.classList.add('is-opening');
178
+ spacer.addEventListener('transitionend', () => {
179
+ spacer.classList.remove('is-opening');
180
+ spacer.classList.add('is-open');
181
+ }, { once: true });
182
+ }
183
+ else {
184
+ spacer.removeAttribute('style');
185
+ spacer.classList.remove('is-open', 'is-opening');
186
+ }
187
+ });
188
+ }
189
+ showStepPane(stepId) {
190
+ this.allPanes.forEach(pane => {
191
+ if (pane.isActive || pane.id === stepId) {
192
+ pane.isActive = stepId === pane.id;
193
+ }
194
+ });
195
+ }
196
+ focusStepBtn(stepId, forceFocus) {
197
+ const stepBtn = this.hostElement.shadowRoot.querySelector(`button[aria-controls="${stepId}"]`);
198
+ const isComponentActive = document.activeElement === this.hostElement;
199
+ if (!stepBtn)
200
+ return;
201
+ if (isComponentActive || forceFocus) {
202
+ stepBtn.focus();
203
+ }
204
+ }
205
+ /// Listeners ///
206
+ defaultChangeHandler(event) {
207
+ const { hostElement } = this;
208
+ if (event.target === hostElement && !hostElement.getAttribute('onchange') && !!event.detail) {
209
+ this.currentStepId = event.detail.selectedStepId;
210
+ }
211
+ }
212
+ delegateFocus(event) {
213
+ if (!isEventFromElement(event, this.hostElement))
214
+ return;
215
+ this.focusStepBtn(this.currentStepId, true);
216
+ }
217
+ statusChangeHandler() {
218
+ this.buildPaneList();
219
+ }
220
+ /// Watchers ///
221
+ currentStepChanged(stepId) {
222
+ this.showStep(stepId);
223
+ }
224
+ /// DOM ///
225
+ renderStepBtn(pane, index) {
226
+ const { currentStepId, structuredPanes } = this;
227
+ const isLastStep = index === structuredPanes.length - 1;
228
+ const { id, label, description, status } = pane;
229
+ const stepNumber = index + 1;
230
+ const isCurrentStep = id === currentStepId;
231
+ const labelId = label && `label-${id}`;
232
+ const isLocked = status === 'locked';
233
+ const stepLabel = label && loc(label);
234
+ const descriptionId = label && description && `description-${id}`;
235
+ const btnLabel = !label && loc('tecton.element.advancedStepper.number', [`${stepNumber}`, `${structuredPanes.length}`]);
236
+ let statusIcon;
237
+ if (status === 'complete')
238
+ statusIcon = 'success';
239
+ else if (status === 'error')
240
+ statusIcon = 'warning';
241
+ const stepClasses = ['step-btn'];
242
+ if (status)
243
+ stepClasses.push(`status-${status}`);
244
+ const childIds = pane.children.map(child => child.id);
245
+ const isExpanded = isCurrentStep || childIds.includes(currentStepId);
246
+ return (h("li", { role: "presentation" }, h("button", { class: stepClasses.join(' '), type: "button", "aria-labelledby": labelId, "aria-describedBy": descriptionId, "aria-label": btnLabel, "aria-selected": `${isCurrentStep}`, "aria-expanded": !!pane.children.length ? `${isExpanded}` : null, "aria-controls": id, "aria-disabled": isLocked ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => !isLocked && this.onStepKeyDown(ev, id), onClick: ev => !isLocked && this.onStepClick(ev, id) }, statusIcon ? (h("div", { class: "step-icon" }, h("q2-icon", { type: statusIcon }))) : (h("div", { class: "step-bubble" }, stepNumber)), label && (h("div", null, h("div", { class: "step-label", id: labelId }, stepLabel), description && (h("div", { class: "step-description", id: descriptionId }, loc(description)))))), ((isLastStep && !!pane.children.length) || !isLastStep) && (h("div", { class: "spacer" }, !!pane.children.length && (h("ul", { ref: el => isExpanded && (this.expandedStepChildrenList = el), "aria-hidden": `${!isExpanded}` }, pane.children.map((child, index, children) => this.renderChildStepBtn(child, index, children.length, stepLabel))))))));
247
+ }
248
+ renderChildStepBtn(pane, index, children, parentLabel) {
249
+ const { currentStepId } = this;
250
+ const { id, label, status } = pane;
251
+ const stepNumber = index + 1;
252
+ const labelId = label && `label-${id}`;
253
+ const isCurrentStep = id === currentStepId;
254
+ const isLocked = status === 'locked';
255
+ const btnLabel = !label && loc('tecton.element.advancedStepper.childNumber', [`${stepNumber}`, `${children}`, parentLabel]);
256
+ let statusIcon;
257
+ if (status === 'error')
258
+ statusIcon = 'warning';
259
+ const stepClasses = ['step-child-btn'];
260
+ if (status)
261
+ stepClasses.push(`status-${status}`);
262
+ return (h("li", { role: "presentation" }, h("button", { class: stepClasses.join(' '), type: "button", "aria-labelledby": labelId, "aria-label": btnLabel, "aria-selected": `${isCurrentStep}`, "aria-controls": id, "aria-disabled": isLocked ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => !isLocked && this.onStepKeyDown(ev, id), onClick: ev => !isLocked && this.onStepClick(ev, id) }, statusIcon && (h("div", { class: "step-child-icon" }, h("q2-icon", { type: statusIcon }))), label && (h("div", { class: "step-child-label", id: labelId }, loc(label))))));
263
+ }
264
+ render() {
265
+ return (h(Fragment, null, h("ul", { role: "tablist" }, this.structuredPanes.map((pane, index) => this.renderStepBtn(pane, index))), h("div", null, h("slot", null))));
266
+ }
267
+ get hostElement() { return getElement(this); }
268
+ static get watchers() { return {
269
+ "currentStepId": ["currentStepChanged"]
270
+ }; }
271
+ };
272
+ Q2AdvancedStepper.style = stylesCss;
273
+
274
+ export { Q2AdvancedStepper as q2_stepper_vertical };
@@ -1,7 +1,7 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-be8376c0.js';
2
- import { a as addSmoothScrollPolyfill, o as overrideFocus, i as isEventFromElement, l as loc } from './index-ec6660af.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-dbfb3ecc.js';
2
+ import { b as addSmoothScrollPolyfill, o as overrideFocus, i as isEventFromElement, l as loc } from './index-0ff8de52.js';
3
3
 
4
- const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;position:relative}ul{--comp-bullet-bg:var(--tct-stepper-bullet-active-bg, var(--t-stepper-bullet-active-bg, var(--t-primary, #0079c1)));--comp-bullet-font-color:var(--tct-stepper-bullet-active-font-color, var(--t-stepper-bullet-active-font-color, var(--t-primary-font-color, #ffffff)));--comp-bullet-size:var(--tct-stepper-bullet-size, var(--t-stepper-bullet-size, 18px));--comp-bullet-gap:var(--tct-stepper-bullet-padding, var(--t-stepper-bullet-padding, var(--app-scale-2x, 10px)));--comp-bullet-border-offset:var(--tct-stepper-bullet-border-offset, var(--t-stepper-bullet-border-offset, 4px));--comp-bullet-border:var(--tct-stepper-bullet-border, var(--t-stepper-bullet-border, 2px solid var(--t-primary-l3)));--comp-bullet-font-size:var(--tct-stepper-bullet-font-size, var(--t-stepper-bullet-font-size, var(--app-font-size-small, 12px)));--comp-step-width:var(--tct-stepper-step-width, var(--t-stepper-step-width, var(--t-stepper-step-width, 80px)));--comp-step-gap:var(--tct-stepper-step-gap, var(--t-stepper-step-gap, 5px));--comp-tween:var(--tct-stepper-tween, var(--t-stepper-tween, var(--app-tween-1, 0.2s ease)));overflow-x:auto;display:flex;justify-content:center;list-style:none;padding:0;padding:var(--tct-stepper-list-padding, var(--t-stepper-list-padding, 2px));margin:0;gap:var(--comp-step-gap);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}ul::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}ul::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}ul::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}.has-scroll ul{justify-content:unset}li{min-height:var(--tct-stepper-min-height, var(--t-stepper-min-height, 50px));flex:0 0 auto;position:relative;width:var(--comp-step-width);text-align:center;max-width:150px;min-width:80px}.step-btn{position:relative;background:transparent;border:0;cursor:pointer;display:flex;flex-direction:column;align-items:center;height:calc(100% - 4px);width:100%;transition:var(--comp-tween);padding:0;transition-property:box-shadow;outline:none}.step-btn[aria-disabled]{cursor:default}.step-btn[aria-disabled],.step-btn[aria-disabled]+hr{--comp-bullet-font-color:var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));--comp-bullet-bg:var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray12, #d9d9d9)))}.step-bubble{margin:var(--comp-bullet-gap) auto;background:var(--comp-bullet-bg);color:var(--comp-bullet-font-color);width:var(--comp-bullet-size);height:var(--comp-bullet-size);min-height:var(--comp-bullet-size);font-size:var(--comp-bullet-font-size);transition:var(--comp-tween);transition-property:background, color;border-radius:50%;position:relative}[aria-selected] .step-bubble{font-weight:var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600))}[aria-selected] .step-bubble:before{content:\"\";position:absolute;inset:calc(var(--comp-bullet-border-offset) * -1);width:calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));height:calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));border-radius:50%;border:var(--comp-bullet-border)}hr{width:calc(var(--comp-step-width) - var(--comp-step-gap) - var(--comp-bullet-gap) - var(--comp-bullet-size));top:calc(var(--comp-bullet-size) / 2 + var(--comp-bullet-gap));left:calc(var(--comp-step-width) * -0.5 + var(--comp-step-gap) + var(--comp-bullet-gap));border:0;border-top:1px solid var(--comp-bullet-bg);height:0;position:absolute;margin:0;transition:border var(--comp-tween)}.step-container{position:relative}.step-label{color:var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d)));font-size:var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px)));height:1.5em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}[aria-selected] .step-label{font-weight:var(--tct-stepper-active-font-weight, var(--t-stepper-active-font-weight, 600))}[aria-describedby] .step-label{-webkit-line-clamp:1}.step-description{color:var(--tct-stepper-description-color, var(--t-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));font-size:var(--tct-stepper-description-font-size, var(--t-stepper-description-font-size, var(--app-font-size-small, 12px)));display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:0.2em}.gradient-left,.gradient-right{z-index:1;position:absolute;top:0;height:100%;width:18px}.gradient-left{background-image:linear-gradient(to right, var(--t-base), var(--t-base-a0));left:0}.gradient-right{background-image:linear-gradient(to right, var(--t-base-a0), var(--t-base));right:0}.btn-left,.btn-right{--tct-icon-size:18px;--tct-btn-icon-hover-bg:transparent;--tct-btn-icon-width:22px;--tct-icon-stroke-primary:var(--tct-stepper-scroll-arrow-color, var(--t-stepper-scroll-arrow-color, var(--t-text, #4d4d4d)));position:absolute;top:calc(50% - 22px);z-index:2}.btn-left{left:0}.btn-right{right:0}";
4
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;position:relative}ul{--comp-bullet-bg:var(--tct-stepper-bullet-active-bg, var(--t-stepper-bullet-active-bg, var(--t-primary, #0079c1)));--comp-bullet-font-color:var(--tct-stepper-bullet-active-font-color, var(--t-stepper-bullet-active-font-color, var(--t-primary-font-color, #ffffff)));--comp-bullet-size:var(--tct-stepper-bullet-size, var(--t-stepper-bullet-size, 18px));--comp-bullet-gap:var(--tct-stepper-bullet-padding, var(--t-stepper-bullet-padding, var(--app-scale-2x, 10px)));--comp-bullet-border-offset:var(--tct-stepper-bullet-border-offset, var(--t-stepper-bullet-border-offset, 4px));--comp-bullet-border:var(--tct-stepper-bullet-border, var(--t-stepper-bullet-border, 2px solid var(--t-primary-l3)));--comp-bullet-font-size:var(--tct-stepper-bullet-font-size, var(--t-stepper-bullet-font-size, var(--app-font-size-small, 12px)));--comp-step-width:var(--tct-stepper-step-width, var(--t-stepper-step-width, var(--t-stepper-step-width, 80px)));--comp-step-gap:var(--tct-stepper-step-gap, var(--t-stepper-step-gap, 5px));--comp-tween:var(--tct-stepper-tween, var(--t-stepper-tween, var(--app-tween-1, 0.2s ease)));overflow-x:auto;display:flex;justify-content:center;list-style:none;padding:0;padding:var(--tct-stepper-list-padding, var(--t-stepper-list-padding, 2px));margin:0;gap:var(--comp-step-gap);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}ul::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}ul::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}ul::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}.has-scroll ul{justify-content:unset}li{min-height:var(--tct-stepper-min-height, var(--t-stepper-min-height, 50px));flex:0 0 auto;position:relative;width:var(--comp-step-width);text-align:center;max-width:150px;min-width:80px}.step-btn{position:relative;background:transparent;border:0;cursor:pointer;display:flex;flex-direction:column;align-items:center;height:calc(100% - 4px);width:100%;transition:var(--comp-tween);padding:0;transition-property:box-shadow;outline:none}.step-btn[aria-disabled]{cursor:default}.step-btn[aria-disabled],.step-btn[aria-disabled]+hr{--comp-bullet-font-color:var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));--comp-bullet-bg:var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray-12, #d9d9d9)))}.step-bubble{margin:var(--comp-bullet-gap) auto;background:var(--comp-bullet-bg);color:var(--comp-bullet-font-color);width:var(--comp-bullet-size);height:var(--comp-bullet-size);min-height:var(--comp-bullet-size);font-size:var(--comp-bullet-font-size);transition:var(--comp-tween);transition-property:background, color;border-radius:50%;position:relative}[aria-selected] .step-bubble{font-weight:var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600))}[aria-selected] .step-bubble:before{content:\"\";position:absolute;inset:calc(var(--comp-bullet-border-offset) * -1);width:calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));height:calc(var(--comp-bullet-size) + var(--comp-bullet-border-offset));border-radius:50%;border:var(--comp-bullet-border)}hr{width:calc(var(--comp-step-width) - var(--comp-step-gap) - var(--comp-bullet-gap) - var(--comp-bullet-size));top:calc(var(--comp-bullet-size) / 2 + var(--comp-bullet-gap));left:calc(var(--comp-step-width) * -0.5 + var(--comp-step-gap) + var(--comp-bullet-gap));border:0;border-top:1px solid var(--comp-bullet-bg);height:0;position:absolute;margin:0;transition:border var(--comp-tween)}.step-container{position:relative}.step-label{color:var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d)));font-size:var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px)));height:1.5em;text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}[aria-selected] .step-label{font-weight:var(--tct-stepper-active-font-weight, var(--t-stepper-active-font-weight, 600))}[aria-describedby] .step-label{-webkit-line-clamp:1}.step-description{color:var(--tct-stepper-description-color, var(--t-stepper-description-color, var(--t-textA, rgba(77, 77, 77, 0.77))));font-size:var(--tct-stepper-description-font-size, var(--t-stepper-description-font-size, var(--app-font-size-small, 12px)));text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;padding-bottom:0.2em}.gradient-left,.gradient-right{z-index:1;position:absolute;top:0;height:100%;width:18px}.gradient-left{background-image:linear-gradient(to right, var(--t-base), var(--t-base-a0));left:0}.gradient-right{background-image:linear-gradient(to right, var(--t-base-a0), var(--t-base));right:0}.btn-left,.btn-right{--tct-icon-size:18px;--tct-btn-icon-hover-bg:transparent;--tct-btn-icon-width:22px;--tct-icon-stroke-primary:var(--tct-stepper-scroll-arrow-color, var(--t-stepper-scroll-arrow-color, var(--t-text, #4d4d4d)));position:absolute;top:calc(50% - 22px);z-index:2}.btn-left{left:0}.btn-right{right:0}";
5
5
 
6
6
  addSmoothScrollPolyfill();
7
7
  const Q2Stepper = class {
@@ -22,7 +22,7 @@ const Q2Stepper = class {
22
22
  const scrollAmount = Math.floor(this.listElement.clientWidth / 2);
23
23
  this.listElement.scrollBy({
24
24
  left: direction === 'left' ? -scrollAmount : scrollAmount,
25
- behavior: 'smooth'
25
+ behavior: 'smooth',
26
26
  });
27
27
  };
28
28
  this.onStepClick = (event, selectedStep) => {
@@ -34,7 +34,7 @@ const Q2Stepper = class {
34
34
  selectedStep,
35
35
  lastEnabledStep,
36
36
  currentStep,
37
- stepCount
37
+ stepCount,
38
38
  });
39
39
  };
40
40
  this.onStepKeyDown = (event, stepNumber) => {
@@ -105,9 +105,7 @@ const Q2Stepper = class {
105
105
  ////////// HOST EVENTS ////////
106
106
  defaultChangeHandler(event) {
107
107
  const { hostElement } = this;
108
- if (event.target === hostElement &&
109
- !hostElement.getAttribute('onchange') &&
110
- !!event.detail) {
108
+ if (event.target === hostElement && !hostElement.getAttribute('onchange') && !!event.detail) {
111
109
  this.currentStep = event.detail.selectedStep;
112
110
  }
113
111
  }
@@ -129,7 +127,7 @@ const Q2Stepper = class {
129
127
  selectedStep: null,
130
128
  lastEnabledStep: stepNumber,
131
129
  currentStep,
132
- stepCount
130
+ stepCount,
133
131
  });
134
132
  }
135
133
  this.scheduledAfterRender.push(this.resizeIframe);
@@ -137,8 +135,8 @@ const Q2Stepper = class {
137
135
  this.focusStep(stepNumber, this.scrollEnabled);
138
136
  }
139
137
  resizeIframe() {
140
- var _a;
141
- return (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe();
138
+ var _a, _b;
139
+ return (_b = (_a = window === null || window === void 0 ? void 0 : window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
142
140
  }
143
141
  showStepPane(stepNumber) {
144
142
  this.allPanes.forEach((pane, index) => {
@@ -158,7 +156,7 @@ const Q2Stepper = class {
158
156
  const left = stepListItem.offsetLeft - this.listElement.clientWidth / 2;
159
157
  this.listElement.scrollTo({
160
158
  left,
161
- behavior: 'smooth'
159
+ behavior: 'smooth',
162
160
  });
163
161
  }
164
162
  }
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-be8376c0.js';
2
- import { a as addSmoothScrollPolyfill, c as createGuid, l as loc, i as isEventFromElement, o as overrideFocus } from './index-ec6660af.js';
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-dbfb3ecc.js';
2
+ import { b as addSmoothScrollPolyfill, c as createGuid, l as loc, i as isEventFromElement, o as overrideFocus } from './index-0ff8de52.js';
3
3
 
4
4
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;position:relative}button{cursor:pointer;margin:0}.tab-container{position:relative}ul{--comp-container-padding:var(--tct-scale-1, var(--app-scale-1, 5px)) var(--tct-scale-1, var(--app-scale-1, 5px)) 0;padding:var(--tct-tab-container-padding, var(--t-tab-container-padding, var(--comp-container-padding)));display:flex;gap:var(--tct-tab-gap, var(--t-tab-gap, var(--tct-scale-1, var(--app-scale-1, 5px))));list-style:none;border-bottom:1px solid var(--tct-tab-container-border-color, var(--t-tab-container-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));overflow-x:auto;align-items:center;scrollbar-width:none;scrollbar-color:transparent}ul::-webkit-scrollbar{width:0;height:0}ul::-webkit-scrollbar-thumb{background:transparent}ul::-webkit-scrollbar-track{background:transparent}@media print{ul.no-print{display:none}}li{flex:0 0 auto}li button{background:var(--tct-tab-inactive-bg-color, var(--t-tab-inactive-bg-color, transparent));border-width:var(--tct-tab-inactive-border-width, var(--t-tab-inactive-border-width, 0 0 3px 0));border-color:var(--tct-tab-inactive-border-color, var(--t-tab-inactive-border-color, transparent));border-style:var(--tct-tab-inactive-border-style, var(--t-tab-inactive-border-style, solid));border-radius:var(--tct-tab-border-radius, var(--t-tab-border-radius, 0));width:var(--tct-tab-width, var(--t-tab-width, 100%));text-align:var(--tct-tab-text-align, var(--t-tab-text-align, center));text-decoration:var(--tct-tab-text-decoration, var(--t-tab-text-decoration, none));padding:var(--tct-tab-padding, var(--t-tab-padding, var(--tct-scale-2, var(--app-scale-2, 10px))));color:var(--tct-tab-inactive-color, var(--t-tab-inactive-color, inherit));font-size:var(--tct-tab-font-size, var(--t-tab-font-size, 17px));display:block;transition:color var(--tct-tween-2, var(--app-tween-2, 0.4s ease)), border-color var(--tct-tween-1, var(--app-tween-1, 0.2s ease))}:host([type=section]) li button{--comp-tab-section-padding:var(--tct-scale-2, var(--app-scale-2, 10px)) var(--tct-scale-1, var(--app-scale-1, 5px));font-size:inherit;padding:var(--tct-tab-section-padding, var(--t-tab-section-padding, var(--comp-tab-section-padding)))}li button:hover{color:var(--tct-tab-hover-color, var(--t-tab-hover-color, var(--tct-tab-active-color, var(--t-tab-active-color, #2e2e2e))));background-color:var(--tct-tab-hover-bg-color, var(--t-tab-hover-bg-color, inherit));width:var(--tct-tab-hover-width, var(--t-tab-hover-width, 100%))}li button[aria-selected=true]{color:var(--tct-tab-active-color, var(--t-tab-active-color, #2e2e2e));border-color:var(--tct-tab-active-border-color, var(--t-tab-active-border-color, currentColor));border-style:var(--tct-tab-active-border-style, var(--t-tab-active-border-style, solid));width:var(--tct-tab-active-width, var(--t-tab-active-width, 100%));background-color:var(--tct-tab-active-bg-color, var(--t-tab-active-bg-color, inherit))}:host([color=alt]) li button{color:var(--tct-tab-alt-inactive-color, var(--t-tab-alt-inactive-color, inherit))}:host([color=alt]) li button:hover,:host([color=alt]) li button[aria-selected=true]{color:var(--tct-tab-alt-active-color, var(--t-tab-alt-active-color, inherit))}@media screen and (max-width: 767px){li button{--comp-tab-padding:var(--tct-scale-2, var(--app-scale-2, 10px)) var(--tct-scale-1, var(--app-scale-1, 5px));font-size:inherit;padding:var(--tct-tab-padding, var(--t-tab-padding, var(--comp-tab-padding)))}}.tab-content{--comp-tab-content-padding:var(--tct-scale-2, var(--app-scale-2, 10px)) 0;padding:var(--tct-tab-content-padding, var(--t-tab-content-padding, var(--comp-tab-content-padding)))}.tab-content:focus{outline:none;box-shadow:none}.gradient-left,.gradient-right{z-index:1;position:absolute;top:0;height:100%;width:44px}.gradient-left{background-image:linear-gradient(to right, var(--t-base), var(--t-base-a0));left:0}.gradient-right{background-image:linear-gradient(to right, var(--t-base-a0), var(--t-base));right:0}.btn-left,.btn-right{--tct-icon-size:18px;--tct-btn-icon-hover-bg:transparent;--tct-btn-icon-width:22px;--tct-icon-stroke-primary:var(--tct-stepper-scroll-arrow-color, var(--t-stepper-scroll-arrow-color, var(--t-text, #4d4d4d)));position:absolute;top:calc(50% - 22px);z-index:2}.btn-left{left:0}.btn-right{right:0}";
5
5
 
@@ -33,7 +33,7 @@ const Q2TabContainer = class {
33
33
  this.setTabs = () => {
34
34
  this.tabs = this.tabPanes.map(({ label, value }) => ({
35
35
  label: (label && loc(label)) || '',
36
- value
36
+ value,
37
37
  }));
38
38
  };
39
39
  this.onTabClick = (event) => {
@@ -41,7 +41,7 @@ const Q2TabContainer = class {
41
41
  if (isAlreadySelected)
42
42
  return;
43
43
  this.change.emit({
44
- value: event.target.dataset.value
44
+ value: event.target.dataset.value,
45
45
  });
46
46
  };
47
47
  this.onTabKeyDown = (event) => {
@@ -71,7 +71,7 @@ const Q2TabContainer = class {
71
71
  }
72
72
  };
73
73
  this.moveToAdjacentTab = (value, direction) => {
74
- let index = this.tabs.map(({ value }) => value).indexOf(value);
74
+ const index = this.tabs.map(({ value }) => value).indexOf(value);
75
75
  let newIndex;
76
76
  switch (direction) {
77
77
  case 'next':
@@ -98,7 +98,7 @@ const Q2TabContainer = class {
98
98
  const left = focusedTab.offsetLeft - this.listElement.clientWidth / 2;
99
99
  this.listElement.scrollTo({
100
100
  left,
101
- behavior: 'smooth'
101
+ behavior: 'smooth',
102
102
  });
103
103
  return focusedTab;
104
104
  };
@@ -114,7 +114,7 @@ const Q2TabContainer = class {
114
114
  const scrollAmount = Math.floor(this.listElement.clientWidth / 2);
115
115
  this.listElement.scrollBy({
116
116
  left: direction === 'left' ? -scrollAmount : scrollAmount,
117
- behavior: 'smooth'
117
+ behavior: 'smooth',
118
118
  });
119
119
  };
120
120
  this.onSlotChange = () => {
@@ -172,6 +172,9 @@ const Q2TabContainer = class {
172
172
  overrideFocus(this.hostElement);
173
173
  const index = this.tabs.findIndex(el => el.value === this.value);
174
174
  this.scheduledAfterRender.push(() => {
175
+ const hasTabs = this.tabs.length > 0;
176
+ if (!hasTabs)
177
+ return;
175
178
  const tab = this.moveFocus(Math.max(index, 0));
176
179
  this.value = tab.dataset.value;
177
180
  tab.blur();
@@ -180,6 +183,7 @@ const Q2TabContainer = class {
180
183
  disconnectedCallback() {
181
184
  this.resizeObserver.disconnect();
182
185
  this.mutationObserver.disconnect();
186
+ this.resizeObserver = null;
183
187
  this.mutationObserver = null;
184
188
  }
185
189
  ///////// Observers /////////
@@ -201,7 +205,7 @@ const Q2TabContainer = class {
201
205
  generateTab(tab, index) {
202
206
  const { label, value } = tab;
203
207
  const isSelected = this.selectedTabValue === value;
204
- return (h("li", { role: "presentation" }, h("button", { id: `tab-${this.guid}-${index}`, "data-value": value, "test-id": "tabLink", tabIndex: isSelected ? 0 : -1, role: "tab", "aria-selected": isSelected ? 'true' : undefined, "aria-controls": `tab-pane-${this.guid}-${index}`, onClick: this.onTabClick, onKeyDown: this.onTabKeyDown }, label)));
208
+ return (h("li", { role: "presentation" }, h("button", { id: `tab-${this.guid}-${index}`, "data-value": value, "test-id": "tabLink", tabIndex: isSelected ? 0 : -1, role: "tab", "aria-selected": isSelected ? 'true' : 'false', "aria-controls": `tab-pane-${this.guid}-${index}`, onClick: this.onTabClick, onKeyDown: this.onTabKeyDown }, label)));
205
209
  }
206
210
  get hostElement() { return getElement(this); }
207
211
  static get watchers() { return {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-be8376c0.js';
1
+ import { r as registerInstance, h } from './index-dbfb3ecc.js';
2
2
 
3
3
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.tab-pane[aria-hidden=true]{display:none}.tab-pane:focus{outline:none;box-shadow:none}";
4
4
 
@@ -0,0 +1,90 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-dbfb3ecc.js';
2
+ import { o as overrideFocus, i as isEventFromElement, l as loc } from './index-0ff8de52.js';
3
+
4
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline-block;position:relative}:host(:not(:last-child)){margin-inline-end:var(--tct-tag-margin, var(--t-tag-margin, var(--app-scale-2x, 10px)))}.tag-wrapper{--comp-tag-btn-size:var(--tct-tag-btn-size, var(--t-tag-btn-size, var(--app-scale-6x, 30px)));--comp-tag-background:var(--tct-tag-background, var(--t-tag-background, var(--t-gray-13, #e6e6e6)));--comp-tag-color:var(--tct-tag-color, var(--t-tag-color, var(--t-gray-3, #262626)));position:relative}:host([theme=primary]) .tag-wrapper{--comp-tag-background:var(--t-primary-l5, #61c4ff);--comp-tag-color:var(--t-primary-text, #ffffff)}:host([theme=secondary]) .tag-wrapper{--comp-tag-background:var(--t-secondary-l5, #61c4ff);--comp-tag-color:var(--t-secondary-text, #000000)}:host([theme=tertiary]) .tag-wrapper{--comp-tag-background:var(--t-tertiary-l5, #61c4ff);--comp-tag-color:var(--t-tertiary-text, #000000)}.tag{height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));line-height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));padding-inline:var(--tct-tag-padding-inline, var(--t-tag-padding-inline, var(--app-scale-3x, 15px)));background:var(--comp-tag-background);color:var(--comp-tag-color);border-radius:var(--tct-tag-border-radius, var(--t-tag-border-radius, var(--app-border-radius-1, 3px)))}.has-options .tag{padding-right:var(--comp-tag-btn-size)}.btn-wrapper{--comp-tag-clickable-size:var(--tct-tag-clickable-size, var(--t-tag-clickable-size, 44px));--comp-tag-btn-offset:calc(\n calc(calc(var(--comp-tag-clickable-size) - var(--comp-tag-btn-size)) / 2) * -1\n );height:var(--comp-tag-clickable-size);width:var(--comp-tag-clickable-size);display:flex;align-items:center;justify-content:center;position:absolute;right:var(--comp-tag-btn-offset);top:var(--comp-tag-btn-offset);cursor:pointer}button{width:var(--comp-tag-btn-size);height:var(--comp-tag-btn-size);stroke:var(--comp-tag-color);--tct-icon-stroke-primary:var(--comp-tag-color);cursor:pointer;border:0;background:transparent;display:flex;align-items:center;justify-content:center;padding:0;--tct-icon-size:18px}q2-option-list{position:absolute;right:0}";
5
+
6
+ const Q2Tag = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.click = createEvent(this, "click", 7);
10
+ this.role = 'listitem';
11
+ /// Getters ///
12
+ /// Helpers
13
+ this.determineHasOptions = () => {
14
+ const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
15
+ this.hasOptions = hasOptions;
16
+ };
17
+ /// Event Handlers ///
18
+ this.handleChange = event => {
19
+ event.stopPropagation();
20
+ if (!this.hasOptions)
21
+ return;
22
+ const { value } = event.detail;
23
+ this.click.emit({ value });
24
+ };
25
+ this.handleClick = (event) => {
26
+ event.stopPropagation();
27
+ this.optionList.toggle();
28
+ };
29
+ this.handleKeydown = (event) => {
30
+ this.optionList.handleExternalKeydown(event);
31
+ };
32
+ this.handleButtonFocusout = (event) => {
33
+ var _a;
34
+ const relatedTarget = event.relatedTarget;
35
+ if ((_a = (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.tagName) === 'Q2-OPTION') !== null && _a !== void 0 ? _a : false)
36
+ return;
37
+ this.open = false;
38
+ };
39
+ this.handleOptionListFocusout = (event) => {
40
+ const relatedTarget = event.relatedTarget;
41
+ if (relatedTarget && !(event.relatedTarget instanceof HTMLElement))
42
+ return;
43
+ if (relatedTarget && relatedTarget.closest('.btn-wrapper'))
44
+ return;
45
+ this.open = false;
46
+ };
47
+ this.handleWrapperClick = () => {
48
+ this.dropdownBtn.focus();
49
+ this.dropdownBtn.click();
50
+ };
51
+ }
52
+ /// LifeCycle Hooks ///
53
+ componentWillLoad() {
54
+ const observer = new MutationObserver(this.determineHasOptions);
55
+ observer.observe(this.hostElement, { childList: true, attributes: true });
56
+ this.mutationObserver = observer;
57
+ }
58
+ componentDidLoad() {
59
+ overrideFocus(this.hostElement);
60
+ }
61
+ disconnectedCallback() {
62
+ this.mutationObserver.disconnect();
63
+ this.mutationObserver = null;
64
+ }
65
+ /// Listeners ///
66
+ delegateFocus(event) {
67
+ if (!isEventFromElement(event, this.hostElement))
68
+ return;
69
+ if (!this.hasOptions)
70
+ return;
71
+ this.dropdownBtn.focus();
72
+ }
73
+ optionListStateEvent({ detail: { open } }) {
74
+ this.open = open;
75
+ if (!open)
76
+ this.dropdownBtn.focus();
77
+ }
78
+ /// DOM ///
79
+ render() {
80
+ const { hasOptions, open } = this;
81
+ const wrapperClassNames = ['tag-wrapper'];
82
+ if (hasOptions)
83
+ wrapperClassNames.push('has-options');
84
+ return (h(Fragment, null, h("div", { class: wrapperClassNames.join(' '), onClick: e => e.stopPropagation() }, h("div", { class: "tag" }, this.label), this.hasOptions && (h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick }, h("button", { ref: el => (this.dropdownBtn = el), "test-id": "btn-control", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-haspopup": "true", "aria-expanded": open ? 'true' : 'false', "aria-label": loc('tecton.element.tag.viewOptions') }, h("q2-icon", { type: "options" }))))), this.hasOptions && (h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), open: this.open, onChange: this.handleChange, onFocusout: this.handleOptionListFocusout, align: "right", type: "menu", "no-select": true }, h("slot", null)))));
85
+ }
86
+ get hostElement() { return getElement(this); }
87
+ };
88
+ Q2Tag.style = stylesCss;
89
+
90
+ export { Q2Tag as q2_tag };