q2-tecton-elements 1.46.1 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +48 -14
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-0e15dc8d.js → index-a93362ed.js} +3 -3
  4. package/dist/cjs/index-a93362ed.js.map +1 -0
  5. package/dist/cjs/{index-59fb7c74.js → index-c385e32f.js} +1 -1
  6. package/dist/cjs/{index-59fb7c74.js.map → index-c385e32f.js.map} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-calendar.cjs.entry.js +18 -4
  11. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  12. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-chart-donut.cjs.entry.js +9 -7
  18. package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
  19. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-data-table.cjs.entry.js +9 -6
  22. package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
  23. package/dist/cjs/q2-detail.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-dropdown-item.cjs.entry.js +14 -5
  25. package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
  26. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-editable-field.cjs.entry.js +37 -28
  28. package/dist/cjs/q2-editable-field.cjs.entry.js.map +1 -1
  29. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-input.cjs.entry.js +22 -3
  31. package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
  32. package/dist/cjs/q2-item.cjs.entry.js +2 -2
  33. package/dist/cjs/q2-item.cjs.entry.js.map +1 -1
  34. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-legend.cjs.entry.js.map +1 -1
  36. package/dist/cjs/q2-list.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  38. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  40. package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
  41. package/dist/cjs/q2-option-list.cjs.entry.js +3 -4
  42. package/dist/cjs/q2-option-list.cjs.entry.js.map +1 -1
  43. package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
  44. package/dist/cjs/q2-pill.cjs.entry.js +1 -1
  45. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  47. package/dist/cjs/q2-relative-time.cjs.entry.js +35 -18
  48. package/dist/cjs/q2-relative-time.cjs.entry.js.map +1 -1
  49. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  50. package/dist/cjs/q2-section.cjs.entry.js.map +1 -1
  51. package/dist/cjs/q2-select.cjs.entry.js +11 -4
  52. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  53. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  54. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
  55. package/dist/cjs/q2-stepper.cjs.entry.js +3 -3
  56. package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
  57. package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
  58. package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
  59. package/dist/cjs/q2-tag.cjs.entry.js +1 -1
  60. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  61. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  62. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  63. package/dist/collection/components/q2-calendar/q2-calendar.js +16 -2
  64. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  65. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +8 -6
  66. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  67. package/dist/collection/components/q2-data-table/q2-data-table.css +15 -1
  68. package/dist/collection/components/q2-data-table/q2-data-table.js +34 -14
  69. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  70. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +22 -5
  71. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  72. package/dist/collection/components/q2-editable-field/q2-editable-field.js +41 -29
  73. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  74. package/dist/collection/components/q2-icon/assets/icon-file-list.json +1 -0
  75. package/dist/collection/components/q2-icon/assets/standard.symbol.svg +1 -1
  76. package/dist/collection/components/q2-input/q2-input.js +123 -5
  77. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  78. package/dist/collection/components/q2-item/q2-item.js +1 -1
  79. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  80. package/dist/collection/components/q2-legend/q2-legend.css +1 -1
  81. package/dist/collection/components/q2-option-list/q2-option-list.js +4 -5
  82. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  83. package/dist/collection/components/q2-popover/q2-popover.js +47 -13
  84. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  85. package/dist/collection/components/q2-relative-time/q2-relative-time.js +79 -25
  86. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  87. package/dist/collection/components/q2-section/q2-section.js +7 -4
  88. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  89. package/dist/collection/components/q2-select/q2-select.js +16 -3
  90. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  91. package/dist/collection/components/q2-stepper/q2-stepper.js +2 -2
  92. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  93. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +2 -2
  94. package/dist/collection/components/q2-tab-container/q2-tab-container.css +2 -1
  95. package/dist/collection/utils/index.js +2 -2
  96. package/dist/collection/utils/index.js.map +1 -1
  97. package/dist/components/index2.js +2 -2
  98. package/dist/components/index2.js.map +1 -1
  99. package/dist/components/q2-calendar.js +16 -2
  100. package/dist/components/q2-calendar.js.map +1 -1
  101. package/dist/components/q2-chart-donut.js +8 -6
  102. package/dist/components/q2-chart-donut.js.map +1 -1
  103. package/dist/components/q2-data-table.js +10 -6
  104. package/dist/components/q2-data-table.js.map +1 -1
  105. package/dist/components/q2-dropdown-item2.js +16 -6
  106. package/dist/components/q2-dropdown-item2.js.map +1 -1
  107. package/dist/components/q2-editable-field.js +37 -28
  108. package/dist/components/q2-editable-field.js.map +1 -1
  109. package/dist/components/q2-input2.js +26 -3
  110. package/dist/components/q2-input2.js.map +1 -1
  111. package/dist/components/q2-item.js +1 -1
  112. package/dist/components/q2-item.js.map +1 -1
  113. package/dist/components/q2-legend2.js +1 -1
  114. package/dist/components/q2-legend2.js.map +1 -1
  115. package/dist/components/q2-option-list2.js +2 -3
  116. package/dist/components/q2-option-list2.js.map +1 -1
  117. package/dist/components/q2-popover2.js +47 -13
  118. package/dist/components/q2-popover2.js.map +1 -1
  119. package/dist/components/q2-relative-time.js +37 -18
  120. package/dist/components/q2-relative-time.js.map +1 -1
  121. package/dist/components/q2-section.js +2 -2
  122. package/dist/components/q2-section.js.map +1 -1
  123. package/dist/components/q2-select2.js +11 -4
  124. package/dist/components/q2-select2.js.map +1 -1
  125. package/dist/components/q2-stepper.js +2 -2
  126. package/dist/components/q2-stepper.js.map +1 -1
  127. package/dist/components/q2-tab-container.js +1 -1
  128. package/dist/components/q2-tab-container.js.map +1 -1
  129. package/dist/esm/click-elsewhere_2.entry.js +48 -14
  130. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  131. package/dist/esm/{index-0a702dd6.js → index-3c5cd75e.js} +3 -3
  132. package/dist/esm/index-3c5cd75e.js.map +1 -0
  133. package/dist/esm/{index-c99c4cc6.js → index-f0dfb099.js} +1 -1
  134. package/dist/esm/{index-c99c4cc6.js.map → index-f0dfb099.js.map} +1 -1
  135. package/dist/esm/loader.js +1 -1
  136. package/dist/esm/q2-action-sheet.entry.js +1 -1
  137. package/dist/esm/q2-btn_2.entry.js +1 -1
  138. package/dist/esm/q2-calendar.entry.js +18 -4
  139. package/dist/esm/q2-calendar.entry.js.map +1 -1
  140. package/dist/esm/q2-card.entry.js +1 -1
  141. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  142. package/dist/esm/q2-carousel.entry.js +1 -1
  143. package/dist/esm/q2-chart-area.entry.js +1 -1
  144. package/dist/esm/q2-chart-bar.entry.js +1 -1
  145. package/dist/esm/q2-chart-donut.entry.js +9 -7
  146. package/dist/esm/q2-chart-donut.entry.js.map +1 -1
  147. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  148. package/dist/esm/q2-checkbox.entry.js +1 -1
  149. package/dist/esm/q2-data-table.entry.js +9 -6
  150. package/dist/esm/q2-data-table.entry.js.map +1 -1
  151. package/dist/esm/q2-detail.entry.js +1 -1
  152. package/dist/esm/q2-dropdown-item.entry.js +14 -5
  153. package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
  154. package/dist/esm/q2-dropdown.entry.js +1 -1
  155. package/dist/esm/q2-editable-field.entry.js +37 -28
  156. package/dist/esm/q2-editable-field.entry.js.map +1 -1
  157. package/dist/esm/q2-icon.entry.js +1 -1
  158. package/dist/esm/q2-input.entry.js +22 -3
  159. package/dist/esm/q2-input.entry.js.map +1 -1
  160. package/dist/esm/q2-item.entry.js +2 -2
  161. package/dist/esm/q2-item.entry.js.map +1 -1
  162. package/dist/esm/q2-legend.entry.js +1 -1
  163. package/dist/esm/q2-legend.entry.js.map +1 -1
  164. package/dist/esm/q2-list.entry.js +1 -1
  165. package/dist/esm/q2-loc.entry.js +1 -1
  166. package/dist/esm/q2-message.entry.js +1 -1
  167. package/dist/esm/q2-month-picker.entry.js +1 -1
  168. package/dist/esm/q2-optgroup.entry.js +1 -1
  169. package/dist/esm/q2-option-list.entry.js +3 -4
  170. package/dist/esm/q2-option-list.entry.js.map +1 -1
  171. package/dist/esm/q2-pagination.entry.js +1 -1
  172. package/dist/esm/q2-pill.entry.js +1 -1
  173. package/dist/esm/q2-radio-group.entry.js +1 -1
  174. package/dist/esm/q2-radio.entry.js +1 -1
  175. package/dist/esm/q2-relative-time.entry.js +35 -18
  176. package/dist/esm/q2-relative-time.entry.js.map +1 -1
  177. package/dist/esm/q2-section.entry.js +3 -3
  178. package/dist/esm/q2-section.entry.js.map +1 -1
  179. package/dist/esm/q2-select.entry.js +11 -4
  180. package/dist/esm/q2-select.entry.js.map +1 -1
  181. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  182. package/dist/esm/q2-stepper-vertical.entry.js +1 -1
  183. package/dist/esm/q2-stepper.entry.js +3 -3
  184. package/dist/esm/q2-stepper.entry.js.map +1 -1
  185. package/dist/esm/q2-tab-container.entry.js +2 -2
  186. package/dist/esm/q2-tab-container.entry.js.map +1 -1
  187. package/dist/esm/q2-tag.entry.js +1 -1
  188. package/dist/esm/q2-tecton-elements.js +1 -1
  189. package/dist/esm/q2-textarea.entry.js +1 -1
  190. package/dist/esm/q2-tooltip.entry.js +1 -1
  191. package/dist/q2-tecton-elements/assets/icon-file-list.json +1 -0
  192. package/dist/q2-tecton-elements/assets/standard.symbol.svg +1 -1
  193. package/dist/q2-tecton-elements/p-11982614.entry.js +2 -0
  194. package/dist/q2-tecton-elements/p-11982614.entry.js.map +1 -0
  195. package/dist/q2-tecton-elements/{p-57bf9342.entry.js → p-1b89b9c3.entry.js} +2 -2
  196. package/dist/q2-tecton-elements/{p-2a248a3f.entry.js → p-1d824cdf.entry.js} +2 -2
  197. package/dist/q2-tecton-elements/{p-0bc47914.entry.js → p-23183c61.entry.js} +2 -2
  198. package/dist/q2-tecton-elements/p-24719520.entry.js +2 -0
  199. package/dist/q2-tecton-elements/p-24719520.entry.js.map +1 -0
  200. package/dist/q2-tecton-elements/p-24d96969.entry.js +2 -0
  201. package/dist/q2-tecton-elements/p-24d96969.entry.js.map +1 -0
  202. package/dist/q2-tecton-elements/{p-f1265647.entry.js → p-2d6a9a94.entry.js} +2 -2
  203. package/dist/q2-tecton-elements/p-30296b0e.entry.js +2 -0
  204. package/dist/q2-tecton-elements/p-30296b0e.entry.js.map +1 -0
  205. package/dist/q2-tecton-elements/{p-4570ff06.entry.js → p-30d70f4a.entry.js} +2 -2
  206. package/dist/q2-tecton-elements/{p-d60ccf2f.entry.js → p-32b56406.entry.js} +2 -2
  207. package/dist/q2-tecton-elements/{p-d60ccf2f.entry.js.map → p-32b56406.entry.js.map} +1 -1
  208. package/dist/q2-tecton-elements/{p-79df783e.entry.js → p-33af97b0.entry.js} +2 -2
  209. package/dist/q2-tecton-elements/{p-47868d6d.entry.js → p-35cc1039.entry.js} +2 -2
  210. package/dist/q2-tecton-elements/{p-6559c942.js → p-3c42c90f.js} +1 -1
  211. package/dist/q2-tecton-elements/{p-dc057a9c.entry.js → p-3f665c56.entry.js} +2 -2
  212. package/dist/q2-tecton-elements/{p-12326313.entry.js → p-3fe532bc.entry.js} +2 -2
  213. package/dist/q2-tecton-elements/p-43236cac.entry.js +2 -0
  214. package/dist/q2-tecton-elements/p-43236cac.entry.js.map +1 -0
  215. package/dist/q2-tecton-elements/{p-ef441885.entry.js → p-4b47816d.entry.js} +2 -2
  216. package/dist/q2-tecton-elements/{p-bf32fd9c.entry.js → p-4f7e6e79.entry.js} +2 -2
  217. package/dist/q2-tecton-elements/p-4f7e6e79.entry.js.map +1 -0
  218. package/dist/q2-tecton-elements/{p-e762526f.entry.js → p-56dd051a.entry.js} +2 -2
  219. package/dist/q2-tecton-elements/p-56dd051a.entry.js.map +1 -0
  220. package/dist/q2-tecton-elements/{p-d635e39f.entry.js → p-63038a54.entry.js} +2 -2
  221. package/dist/q2-tecton-elements/{p-e27a23fc.entry.js → p-66ae329f.entry.js} +2 -2
  222. package/dist/q2-tecton-elements/p-6986a60e.entry.js +2 -0
  223. package/dist/q2-tecton-elements/p-6986a60e.entry.js.map +1 -0
  224. package/dist/q2-tecton-elements/{p-dd670d63.entry.js → p-6fdda37e.entry.js} +2 -2
  225. package/dist/q2-tecton-elements/p-6fdda37e.entry.js.map +1 -0
  226. package/dist/q2-tecton-elements/p-75bb43b2.entry.js +2 -0
  227. package/dist/q2-tecton-elements/p-75bb43b2.entry.js.map +1 -0
  228. package/dist/q2-tecton-elements/{p-4f2dfb4d.entry.js → p-76be9cad.entry.js} +2 -2
  229. package/dist/q2-tecton-elements/{p-4194d6ed.entry.js → p-7cbb989e.entry.js} +2 -2
  230. package/dist/q2-tecton-elements/{p-81b76d40.entry.js → p-7dafc5da.entry.js} +2 -2
  231. package/dist/q2-tecton-elements/{p-2132da06.entry.js → p-81bb9436.entry.js} +2 -2
  232. package/dist/q2-tecton-elements/p-84190698.js +2 -0
  233. package/dist/q2-tecton-elements/p-84190698.js.map +1 -0
  234. package/dist/q2-tecton-elements/{p-515d424b.entry.js → p-8a00552f.entry.js} +2 -2
  235. package/dist/q2-tecton-elements/{p-d8fba914.entry.js → p-8fc099f5.entry.js} +2 -2
  236. package/dist/q2-tecton-elements/p-9a71bd16.entry.js +2 -0
  237. package/dist/q2-tecton-elements/p-9a71bd16.entry.js.map +1 -0
  238. package/dist/q2-tecton-elements/{p-fe3c62e0.entry.js → p-9eafabd5.entry.js} +2 -2
  239. package/dist/q2-tecton-elements/{p-ac9414a6.entry.js → p-a03c29f3.entry.js} +2 -2
  240. package/dist/q2-tecton-elements/{p-2c57a367.entry.js → p-a891571c.entry.js} +2 -2
  241. package/dist/q2-tecton-elements/{p-f2251261.entry.js → p-abe30d0c.entry.js} +2 -2
  242. package/dist/q2-tecton-elements/{p-18ec54c0.entry.js → p-ca17f7ca.entry.js} +2 -2
  243. package/dist/q2-tecton-elements/{p-bc141c5b.entry.js → p-ca43e917.entry.js} +2 -2
  244. package/dist/q2-tecton-elements/{p-16891e51.entry.js → p-d75e4752.entry.js} +2 -2
  245. package/dist/q2-tecton-elements/p-dd18416f.entry.js +2 -0
  246. package/dist/q2-tecton-elements/p-dd18416f.entry.js.map +1 -0
  247. package/dist/q2-tecton-elements/{p-ca7ad3c3.entry.js → p-f18caa3f.entry.js} +2 -2
  248. package/dist/q2-tecton-elements/{p-85003c5b.entry.js → p-f4b28e89.entry.js} +2 -2
  249. package/dist/q2-tecton-elements/p-f4b28e89.entry.js.map +1 -0
  250. package/dist/q2-tecton-elements/{p-32e57e9f.entry.js → p-fb7dd7ab.entry.js} +2 -2
  251. package/dist/q2-tecton-elements/p-fb7dd7ab.entry.js.map +1 -0
  252. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  253. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  254. package/dist/test/elements/q2-calendar-test.e2e.js +33 -35
  255. package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
  256. package/dist/test/elements/q2-chart-donut-test.e2e.js +9 -1
  257. package/dist/test/elements/q2-chart-donut-test.e2e.js.map +1 -1
  258. package/dist/test/elements/q2-data-table-test.e2e.js +107 -11
  259. package/dist/test/elements/q2-data-table-test.e2e.js.map +1 -1
  260. package/dist/test/elements/q2-dropdown-item-test.e2e.js +183 -104
  261. package/dist/test/elements/q2-dropdown-item-test.e2e.js.map +1 -1
  262. package/dist/test/elements/q2-editable-field-test.e2e.js +436 -418
  263. package/dist/test/elements/q2-editable-field-test.e2e.js.map +1 -1
  264. package/dist/test/elements/q2-input-test.e2e.js +53 -0
  265. package/dist/test/elements/q2-input-test.e2e.js.map +1 -1
  266. package/dist/test/elements/q2-popover-test.spec.js +162 -31
  267. package/dist/test/elements/q2-popover-test.spec.js.map +1 -1
  268. package/dist/test/elements/q2-relative-time-test.e2e.js +65 -40
  269. package/dist/test/elements/q2-relative-time-test.e2e.js.map +1 -1
  270. package/dist/test/elements/q2-select-test.e2e.js +94 -29
  271. package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
  272. package/dist/test/elements/q2-stepper-test.e2e.js +23 -0
  273. package/dist/test/elements/q2-stepper-test.e2e.js.map +1 -1
  274. package/dist/types/components/q2-input/q2-input.d.ts +38 -1
  275. package/dist/types/components/q2-popover/q2-popover.d.ts +2 -0
  276. package/dist/types/components/q2-relative-time/q2-relative-time.d.ts +25 -11
  277. package/dist/types/components/q2-section/q2-section.d.ts +10 -2
  278. package/dist/types/components.d.ts +81 -24
  279. package/dist/types/workspace/workspace/{tecton-production_release_1.46.x → _Gitlab_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  280. package/package.json +3 -3
  281. package/dist/cjs/index-0e15dc8d.js.map +0 -1
  282. package/dist/esm/index-0a702dd6.js.map +0 -1
  283. package/dist/q2-tecton-elements/p-245ad08f.entry.js +0 -2
  284. package/dist/q2-tecton-elements/p-245ad08f.entry.js.map +0 -1
  285. package/dist/q2-tecton-elements/p-32e57e9f.entry.js.map +0 -1
  286. package/dist/q2-tecton-elements/p-36398b59.entry.js +0 -2
  287. package/dist/q2-tecton-elements/p-36398b59.entry.js.map +0 -1
  288. package/dist/q2-tecton-elements/p-42302f6f.js +0 -2
  289. package/dist/q2-tecton-elements/p-42302f6f.js.map +0 -1
  290. package/dist/q2-tecton-elements/p-65ed80a5.entry.js +0 -2
  291. package/dist/q2-tecton-elements/p-65ed80a5.entry.js.map +0 -1
  292. package/dist/q2-tecton-elements/p-85003c5b.entry.js.map +0 -1
  293. package/dist/q2-tecton-elements/p-97a98211.entry.js +0 -2
  294. package/dist/q2-tecton-elements/p-97a98211.entry.js.map +0 -1
  295. package/dist/q2-tecton-elements/p-aec64fcb.entry.js +0 -2
  296. package/dist/q2-tecton-elements/p-aec64fcb.entry.js.map +0 -1
  297. package/dist/q2-tecton-elements/p-be101dcf.entry.js +0 -2
  298. package/dist/q2-tecton-elements/p-be101dcf.entry.js.map +0 -1
  299. package/dist/q2-tecton-elements/p-bf32fd9c.entry.js.map +0 -1
  300. package/dist/q2-tecton-elements/p-ca0d7eb3.entry.js +0 -2
  301. package/dist/q2-tecton-elements/p-ca0d7eb3.entry.js.map +0 -1
  302. package/dist/q2-tecton-elements/p-ca7dad64.entry.js +0 -2
  303. package/dist/q2-tecton-elements/p-ca7dad64.entry.js.map +0 -1
  304. package/dist/q2-tecton-elements/p-dd670d63.entry.js.map +0 -1
  305. package/dist/q2-tecton-elements/p-e762526f.entry.js.map +0 -1
  306. package/dist/q2-tecton-elements/p-f45b3488.entry.js +0 -2
  307. package/dist/q2-tecton-elements/p-f45b3488.entry.js.map +0 -1
  308. /package/dist/q2-tecton-elements/{p-57bf9342.entry.js.map → p-1b89b9c3.entry.js.map} +0 -0
  309. /package/dist/q2-tecton-elements/{p-2a248a3f.entry.js.map → p-1d824cdf.entry.js.map} +0 -0
  310. /package/dist/q2-tecton-elements/{p-0bc47914.entry.js.map → p-23183c61.entry.js.map} +0 -0
  311. /package/dist/q2-tecton-elements/{p-f1265647.entry.js.map → p-2d6a9a94.entry.js.map} +0 -0
  312. /package/dist/q2-tecton-elements/{p-4570ff06.entry.js.map → p-30d70f4a.entry.js.map} +0 -0
  313. /package/dist/q2-tecton-elements/{p-79df783e.entry.js.map → p-33af97b0.entry.js.map} +0 -0
  314. /package/dist/q2-tecton-elements/{p-47868d6d.entry.js.map → p-35cc1039.entry.js.map} +0 -0
  315. /package/dist/q2-tecton-elements/{p-6559c942.js.map → p-3c42c90f.js.map} +0 -0
  316. /package/dist/q2-tecton-elements/{p-dc057a9c.entry.js.map → p-3f665c56.entry.js.map} +0 -0
  317. /package/dist/q2-tecton-elements/{p-12326313.entry.js.map → p-3fe532bc.entry.js.map} +0 -0
  318. /package/dist/q2-tecton-elements/{p-ef441885.entry.js.map → p-4b47816d.entry.js.map} +0 -0
  319. /package/dist/q2-tecton-elements/{p-d635e39f.entry.js.map → p-63038a54.entry.js.map} +0 -0
  320. /package/dist/q2-tecton-elements/{p-e27a23fc.entry.js.map → p-66ae329f.entry.js.map} +0 -0
  321. /package/dist/q2-tecton-elements/{p-4f2dfb4d.entry.js.map → p-76be9cad.entry.js.map} +0 -0
  322. /package/dist/q2-tecton-elements/{p-4194d6ed.entry.js.map → p-7cbb989e.entry.js.map} +0 -0
  323. /package/dist/q2-tecton-elements/{p-81b76d40.entry.js.map → p-7dafc5da.entry.js.map} +0 -0
  324. /package/dist/q2-tecton-elements/{p-2132da06.entry.js.map → p-81bb9436.entry.js.map} +0 -0
  325. /package/dist/q2-tecton-elements/{p-515d424b.entry.js.map → p-8a00552f.entry.js.map} +0 -0
  326. /package/dist/q2-tecton-elements/{p-d8fba914.entry.js.map → p-8fc099f5.entry.js.map} +0 -0
  327. /package/dist/q2-tecton-elements/{p-fe3c62e0.entry.js.map → p-9eafabd5.entry.js.map} +0 -0
  328. /package/dist/q2-tecton-elements/{p-ac9414a6.entry.js.map → p-a03c29f3.entry.js.map} +0 -0
  329. /package/dist/q2-tecton-elements/{p-2c57a367.entry.js.map → p-a891571c.entry.js.map} +0 -0
  330. /package/dist/q2-tecton-elements/{p-f2251261.entry.js.map → p-abe30d0c.entry.js.map} +0 -0
  331. /package/dist/q2-tecton-elements/{p-18ec54c0.entry.js.map → p-ca17f7ca.entry.js.map} +0 -0
  332. /package/dist/q2-tecton-elements/{p-bc141c5b.entry.js.map → p-ca43e917.entry.js.map} +0 -0
  333. /package/dist/q2-tecton-elements/{p-16891e51.entry.js.map → p-d75e4752.entry.js.map} +0 -0
  334. /package/dist/q2-tecton-elements/{p-ca7ad3c3.entry.js.map → p-f18caa3f.entry.js.map} +0 -0
  335. /package/dist/types/workspace/workspace/{tecton-production_release_1.46.x → _Gitlab_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/elements/q2-detail/slot-component.d.ts +0 -0
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-14c3693c.js');
6
- const index$1 = require('./index-59fb7c74.js');
6
+ const index$1 = require('./index-c385e32f.js');
7
+ const index$2 = require('./index-a93362ed.js');
7
8
 
8
9
  const q2RelativeTimeCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch: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}";
9
10
  const Q2RelativeTimeStyle0 = q2RelativeTimeCss;
@@ -43,21 +44,29 @@ const Q2RelativeTime = class {
43
44
  get shouldShow() {
44
45
  return !!this.displayedMessage;
45
46
  }
46
- get validDate() {
47
- const targetDate = new Date(this.date);
48
- return index$1.dateFns.isValid(targetDate);
49
- }
50
- get handleDate() {
51
- if (!this.validDate)
47
+ get isValidDate() {
48
+ const date = new Date(this.date);
49
+ const isValid = index$1.dateFns.isValid(date);
50
+ if (!isValid)
52
51
  console.warn('Error: Invalid date provided to q2-relative-time.');
52
+ return isValid;
53
+ }
54
+ get dateObject() {
53
55
  return new Date(this.date);
54
56
  }
55
- get validBaseDate() {
56
- const baseDate = new Date(this.baseDate);
57
- return index$1.dateFns.isValid(baseDate);
57
+ get isBaseDateProvided() {
58
+ return this.baseDate !== undefined;
59
+ }
60
+ get isValidBaseDate() {
61
+ const date = new Date(this.baseDate);
62
+ const isValid = index$1.dateFns.isValid(date);
63
+ if (!isValid && this.isBaseDateProvided) {
64
+ console.warn('Error: Invalid baseDate provided to q2-relative-time.');
65
+ }
66
+ return isValid;
58
67
  }
59
- get handleBaseDate() {
60
- if (this.validBaseDate) {
68
+ get baseDateObject() {
69
+ if (this.isBaseDateProvided && this.isValidBaseDate) {
61
70
  this.trimSuffix = true;
62
71
  this.sync = false;
63
72
  return new Date(this.baseDate);
@@ -74,7 +83,7 @@ const Q2RelativeTime = class {
74
83
  return false;
75
84
  }
76
85
  get handleNumeric() {
77
- if (this.validBaseDate)
86
+ if (this.isValidBaseDate)
78
87
  return 'always';
79
88
  return this.numeric;
80
89
  }
@@ -91,13 +100,13 @@ const Q2RelativeTime = class {
91
100
  }
92
101
  }
93
102
  updateMessage() {
94
- const { validDate, handleDate, handleBaseDate, locale, handleNumeric, messageFormat, isValidUnit, unit, trimSuffix, } = this;
95
- if (!validDate) {
103
+ const { isValidDate, isBaseDateProvided, isValidBaseDate, dateObject, baseDateObject, locale, handleNumeric, messageFormat, isValidUnit, unit, trimSuffix, } = this;
104
+ if (!isValidDate || (isBaseDateProvided && !isValidBaseDate)) {
96
105
  this.sync = false;
97
- this.displayedMessage = 'Invalid Date Provided';
106
+ this.displayedMessage = index$2.loc('tecton.element.relativeTime.invalidDate');
98
107
  return;
99
108
  }
100
- const message = index$1.dateFns.intlFormatDistance(new Date(handleDate), new Date(handleBaseDate), {
109
+ const message = index$1.dateFns.intlFormatDistance(new Date(dateObject), new Date(baseDateObject), {
101
110
  locale,
102
111
  localeMatcher: 'best fit',
103
112
  numeric: handleNumeric,
@@ -120,10 +129,18 @@ const Q2RelativeTime = class {
120
129
  async displayedMessageValue() {
121
130
  return this.displayedMessage;
122
131
  }
132
+ /** Checks the provided date prop is a valid date. */
133
+ async validDateProp() {
134
+ return this.isValidDate;
135
+ }
136
+ /** Checks the provided baseDate prop is a valid date. */
137
+ async validBaseDateProp() {
138
+ return this.isValidBaseDate;
139
+ }
123
140
  /// DOM ///
124
141
  render() {
125
142
  const { shouldShow, displayedMessage } = this;
126
- return index.h(index.Fragment, { key: '26e452a6b2cda738835ac8675aea30b50846920a' }, shouldShow ? index.h("time", { dateTime: displayedMessage }, displayedMessage) : null);
143
+ return index.h(index.Fragment, { key: 'bc05bc398a991b70bb5c19adde0d739768db76cd' }, shouldShow ? index.h("time", { dateTime: displayedMessage }, displayedMessage) : null);
127
144
  }
128
145
  get hostElement() { return index.getElement(this); }
129
146
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"q2-relative-time.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,8qBAA8qB,CAAC;AACzsB,6BAAe,iBAAiB;;MCGnB,cAAc;;;;;;;;QA8CvB,cAAS,GAAG,IAAI,CAAC;;QAGjB,eAAU,GAAY,KAAK,CAAC;;sBAjCc,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO;6BAGZ,OAAO;uBAGvB,MAAM;oBAOJ,IAAI;;;;;;IA4B5D,iBAAiB;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;KACxB;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;KACtB;IAED,oBAAoB;QAChB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACzB;;IAGD,IAAI,UAAU;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;KAClC;IAED,IAAI,SAAS;QACT,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,OAAOA,uBAAW,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,IAAI,UAAU;QACV,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACvF,OAAO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,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ,UAAU,GACb,GAAG,IAAI,CAAC;QAET,IAAI,CAAC,SAAS,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,gBAAgB,GAAG,uBAAuB,CAAC;YAChD,OAAO;SACV;QAED,MAAM,OAAO,GAAGC,kCAAkB,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE;YAC/E,MAAM;YACN,aAAa,EAAE,UAAU;YACzB,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;SAClC,CAAC,CAAC;QAEH,IAAI,UAAU,EAAE;YACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SACrD;aAAM;YACH,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;SACnC;KACJ;;IAGD,WAAW,CAAC,OAAe;QACvB,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;KAC9D;;;IAKD,MAAM,qBAAqB;QACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC;KAChC;;IAID,MAAM;QACF,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAE9C,OAAOC,QAACC,cAAQ,uDAAE,UAAU,GAAGD,kBAAM,QAAQ,EAAE,gBAAgB,IAAG,gBAAgB,CAAQ,GAAG,IAAI,CAAY,CAAC;KACjH;;;;;;;;;;;;;;;;","names":["isValidDate","intlFormatDistance","h","Fragment"],"sources":["src/components/q2-relative-time/q2-relative-time.scss?tag=q2-relative-time&encapsulation=shadow","src/components/q2-relative-time/q2-relative-time.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline;\n}\n","import { Component, Prop, State, Method, Watch, Element, h, ComponentInterface, Fragment } from '@stencil/core';\nimport { isValid as isValidDate, intlFormatDistance } from 'date-fns';\n\n@Component({ tag: 'q2-relative-time', shadow: true, styleUrl: 'q2-relative-time.scss' })\nexport class Q2RelativeTime implements ComponentInterface {\n /**\n * If you want to compare two specific dates, you can provide a valid `date` and `baseDate`, and the component will tell you the elapsed time between the two dates.\n * If `baseDate` is not provided, the date and time at render will be used instead and - if `sync` is true - updated every second to reflect the time between the `date` value and now.\n * @warning\n * - Requires a valid `date` value.\n * - Providing a valid `baseDate` will disable `sync` and remove the \"in\"/\"ago\" suffixes in the time message.\n * - Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) baseDate: Date | string;\n\n /**\n * The language used for the relative time message.\n * @info\n * It is recommended to use the BCP 47 Language Tags in the ['language-extlang' format](https://www.w3.org/International/articles/language-tags/).\n */\n @Prop({ reflect: true }) locale: string = document.documentElement.lang || 'en-US';\n\n /** The length of the relative time message. */\n @Prop({ reflect: true }) messageFormat: 'long' | 'short' | 'narrow' = 'short';\n\n /** Set this to `always` to force the use of numeric values (e.g. \"1 day ago\") rather than relative ones (e.g. \"yesterday\") in the time message. */\n @Prop({ reflect: true }) numeric: 'always' | 'auto' = 'auto';\n\n /**\n * Keep the displayed message updated as time passes in the webpage.\n * @warning\n * If a valid `baseDate` is provided, `sync` will be set to `false`.\n */\n @Prop({ reflect: true, mutable: true }) sync: boolean = true;\n\n /**\n * The date you want to calculate relative time from.\n * @warning\n * Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) date: Date | string;\n\n /** Force the unit of measurement. */\n @Prop({ reflect: true }) unit: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year';\n\n /**\n * @private\n * Used to manage the sync timer that updates the time since the component was connected to the DOM.\n * Will be set to null if a valid `baseDate` is provided.\n */\n syncTimer = null;\n\n /** @private Will be set to true if a valid `baseDate` is provided. */\n trimSuffix: boolean = false;\n\n @State() displayedMessage: string;\n\n @Element() hostElement: HTMLElement;\n\n /// Lifecycle Hooks ///\n\n componentWillLoad(): void | Promise<void> {\n this.updateMessage();\n }\n\n connectedCallback(): void {\n this.syncUpdated();\n }\n\n disconnectedCallback(): void {\n window.clearInterval(this.syncTimer);\n this.syncTimer = null;\n }\n\n /// Getters ///\n get shouldShow(): boolean {\n return !!this.displayedMessage;\n }\n\n get validDate(): boolean {\n const targetDate = new Date(this.date);\n return isValidDate(targetDate);\n }\n\n get handleDate(): Date {\n if (!this.validDate) console.warn('Error: Invalid date provided to q2-relative-time.');\n return new Date(this.date);\n }\n\n get validBaseDate(): boolean {\n const baseDate = new Date(this.baseDate);\n return isValidDate(baseDate);\n }\n\n get handleBaseDate(): Date {\n if (this.validBaseDate) {\n this.trimSuffix = true;\n this.sync = false;\n return new Date(this.baseDate);\n } else {\n this.trimSuffix = false;\n this.sync = true;\n return new Date();\n }\n }\n\n get isValidUnit(): boolean {\n if (['second', 'minute', 'hour', 'day', 'month', 'quarter', 'year'].includes(this.unit)) return true;\n return false;\n }\n\n get handleNumeric(): 'always' | 'auto' {\n if (this.validBaseDate) return 'always';\n return this.numeric;\n }\n\n /// Watchers ///\n @Watch('sync')\n syncUpdated() {\n if (this.sync) {\n this.syncTimer = window.setInterval(() => {\n this.updateMessage();\n }, 1000);\n } else {\n window.clearInterval(this.syncTimer);\n this.syncTimer = null;\n }\n }\n\n @Watch('messageFormat')\n @Watch('locale')\n @Watch('date')\n @Watch('baseDate')\n @Watch('numeric')\n @Watch('unit')\n updateMessage() {\n const {\n validDate,\n handleDate,\n handleBaseDate,\n locale,\n handleNumeric,\n messageFormat,\n isValidUnit,\n unit,\n trimSuffix,\n } = this;\n\n if (!validDate) {\n this.sync = false;\n this.displayedMessage = 'Invalid Date Provided';\n return;\n }\n\n const message = intlFormatDistance(new Date(handleDate), new Date(handleBaseDate), {\n locale,\n localeMatcher: 'best fit',\n numeric: handleNumeric,\n style: messageFormat,\n unit: isValidUnit ? unit : null,\n });\n\n if (trimSuffix) {\n this.displayedMessage = this.trimMessage(message);\n } else {\n this.displayedMessage = message;\n }\n }\n\n /// Helpers ///\n trimMessage(message: string): string {\n return message.replace(/^in\\s?/, '').replace(/\\sago$/, '');\n }\n\n /// Methods ///\n /** Retrieves the value of the displayed messages. */\n @Method()\n async displayedMessageValue(): Promise<string> {\n return this.displayedMessage;\n }\n\n /// DOM ///\n\n render() {\n const { shouldShow, displayedMessage } = this;\n\n return <Fragment>{shouldShow ? <time dateTime={displayedMessage}>{displayedMessage}</time> : null}</Fragment>;\n }\n}\n"],"version":3}
1
+ {"file":"q2-relative-time.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,iBAAiB,GAAG,8qBAA8qB,CAAC;AACzsB,6BAAe,iBAAiB;;MCInB,cAAc;;;;;;;;QAuDvB,cAAS,GAAG,IAAI,CAAC;;QAGjB,eAAU,GAAY,KAAK,CAAC;;sBAvCc,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO;6BAGZ,OAAO;uBAOvB,MAAM;oBAOJ,IAAI;;;;;;IA8B5D,iBAAiB;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;KACxB;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;KACtB;IAED,oBAAoB;QAChB,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACzB;;IAGD,IAAI,UAAU;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;KAClC;IAED,IAAI,WAAW;QACX,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,OAAO,GAAGA,uBAAW,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QAChF,OAAO,OAAO,CAAC;KAClB;I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,IAAI,CAAC,WAAW,CAAC;KAC3B;;IAID,MAAM,iBAAiB;QACnB,OAAO,IAAI,CAAC,eAAe,CAAC;KAC/B;;IAID,MAAM;QACF,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAE9C,OAAOC,QAACC,cAAQ,uDAAE,UAAU,GAAGD,kBAAM,QAAQ,EAAE,gBAAgB,IAAG,gBAAgB,CAAQ,GAAG,IAAI,CAAY,CAAC;KACjH;;;;;;;;;;;;;;;;","names":["isValidDate","loc","intlFormatDistance","h","Fragment"],"sources":["src/components/q2-relative-time/q2-relative-time.scss?tag=q2-relative-time&encapsulation=shadow","src/components/q2-relative-time/q2-relative-time.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline;\n}\n","import { Component, Prop, State, Method, Watch, Element, h, ComponentInterface, Fragment } from '@stencil/core';\nimport { isValid as isValidDate, intlFormatDistance } from 'date-fns';\nimport { loc } from '../../utils';\n\n@Component({ tag: 'q2-relative-time', shadow: true, styleUrl: 'q2-relative-time.scss' })\nexport class Q2RelativeTime implements ComponentInterface {\n /**\n * If you want to display the length of time between two specific dates, you can provide a valid `date` and `baseDate`, and the component will display the length of time between the two dates.\n *\n * If `baseDate` is not provided, the date and time at render will be used instead and - if `sync` is true - updated every second to reflect the time between the `date` value and the time at render.\n *\n * @warning\n * - Requires a valid `date` value.\n * - If the provided `baseDate` is invalid, the component will display \"Invalid Date\" and a warning message will be printed in the console.\n * - Providing a valid `baseDate` will disable `sync` and remove the \"in\"/\"ago\" suffixes in the time message.\n * - Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) baseDate: Date | string;\n\n /**\n * The language used for the displayed message.\n * @info\n * It is recommended to use the BCP 47 Language Tags in the [\"language-extlang\" format](https://www.w3.org/International/articles/language-tags/).\n */\n @Prop({ reflect: true }) locale: string = document.documentElement.lang || 'en-US';\n\n /** The length of the relative time message. */\n @Prop({ reflect: true }) messageFormat: 'long' | 'short' | 'narrow' = 'short';\n\n /**\n * Determines if the displayed message will use numeric or relative values.\n *@info\n * Set this property to `always` to force the use of numeric values (e.g. \"1 day ago\") rather than relative ones (e.g. \"yesterday\").\n */\n @Prop({ reflect: true }) numeric: 'always' | 'auto' = 'auto';\n\n /**\n * Keep the displayed message updated as time passes in the webpage.\n * @warning\n * If a valid `baseDate` is provided, `sync` will be set to `false`.\n */\n @Prop({ reflect: true, mutable: true }) sync: boolean = true;\n\n /**\n * The date you want to calculate relative time from.\n *\n * @warning\n * - Must be a valid ISO date string.\n * - If the provided `date` is invalid, the component will display \"Invalid Date\" and a warning message will be printed in the console.\n */\n @Prop({ reflect: true }) date: Date | string;\n\n /** Enforces the use of the provided unit of measurement in the displayed message. */\n @Prop({ reflect: true }) unit: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year';\n\n /**\n * @private\n * Used to manage the sync timer that updates the time since the component was connected to the DOM.\n * Will be set to null if a valid `baseDate` is provided.\n */\n syncTimer = null;\n\n /** @private Will be set to true if a valid `baseDate` is provided. */\n trimSuffix: boolean = false;\n\n @State() displayedMessage: string;\n\n @Element() hostElement: HTMLElement;\n\n /// Lifecycle Hooks ///\n\n componentWillLoad(): void | Promise<void> {\n this.updateMessage();\n }\n\n connectedCallback(): void {\n this.syncUpdated();\n }\n\n disconnectedCallback(): void {\n window.clearInterval(this.syncTimer);\n this.syncTimer = null;\n }\n\n /// Getters ///\n get shouldShow(): boolean {\n return !!this.displayedMessage;\n }\n\n get isValidDate(): boolean {\n const date = new Date(this.date);\n const isValid = isValidDate(date);\n if (!isValid) console.warn('Error: Invalid date provided to q2-relative-time.');\n return isValid;\n }\n\n get dateObject(): Date {\n return new Date(this.date);\n }\n\n get isBaseDateProvided(): boolean {\n return this.baseDate !== undefined;\n }\n\n get isValidBaseDate(): boolean {\n const date = new Date(this.baseDate);\n const isValid = isValidDate(date);\n if (!isValid && this.isBaseDateProvided) {\n console.warn('Error: Invalid baseDate provided to q2-relative-time.');\n }\n return isValid;\n }\n\n get baseDateObject(): Date {\n if (this.isBaseDateProvided && this.isValidBaseDate) {\n this.trimSuffix = true;\n this.sync = false;\n return new Date(this.baseDate);\n } else {\n this.trimSuffix = false;\n this.sync = true;\n return new Date();\n }\n }\n\n get isValidUnit(): boolean {\n if (['second', 'minute', 'hour', 'day', 'month', 'quarter', 'year'].includes(this.unit)) return true;\n return false;\n }\n\n get handleNumeric(): 'always' | 'auto' {\n if (this.isValidBaseDate) return 'always';\n return this.numeric;\n }\n\n /// Watchers ///\n @Watch('sync')\n syncUpdated() {\n if (this.sync) {\n this.syncTimer = window.setInterval(() => {\n this.updateMessage();\n }, 1000);\n } else {\n window.clearInterval(this.syncTimer);\n this.syncTimer = null;\n }\n }\n\n @Watch('messageFormat')\n @Watch('locale')\n @Watch('date')\n @Watch('baseDate')\n @Watch('numeric')\n @Watch('unit')\n updateMessage() {\n const {\n isValidDate,\n isBaseDateProvided,\n isValidBaseDate,\n dateObject,\n baseDateObject,\n locale,\n handleNumeric,\n messageFormat,\n isValidUnit,\n unit,\n trimSuffix,\n } = this;\n\n if (!isValidDate || (isBaseDateProvided && !isValidBaseDate)) {\n this.sync = false;\n this.displayedMessage = loc('tecton.element.relativeTime.invalidDate');\n return;\n }\n\n const message = intlFormatDistance(new Date(dateObject), new Date(baseDateObject), {\n locale,\n localeMatcher: 'best fit',\n numeric: handleNumeric,\n style: messageFormat,\n unit: isValidUnit ? unit : null,\n });\n\n if (trimSuffix) {\n this.displayedMessage = this.trimMessage(message);\n } else {\n this.displayedMessage = message;\n }\n }\n\n /// Helpers ///\n trimMessage(message: string): string {\n return message.replace(/^in\\s?/, '').replace(/\\sago$/, '');\n }\n\n /// Methods ///\n /** Retrieves the value of the displayed messages. */\n @Method()\n async displayedMessageValue(): Promise<string> {\n return this.displayedMessage;\n }\n\n /** Checks the provided date prop is a valid date. */\n @Method()\n async validDateProp(): Promise<boolean> {\n return this.isValidDate;\n }\n\n /** Checks the provided baseDate prop is a valid date. */\n @Method()\n async validBaseDateProp(): Promise<boolean> {\n return this.isValidBaseDate;\n }\n\n /// DOM ///\n\n render() {\n const { shouldShow, displayedMessage } = this;\n\n return <Fragment>{shouldShow ? <time dateTime={displayedMessage}>{displayedMessage}</time> : null}</Fragment>;\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-14c3693c.js');
6
- const index$1 = require('./index-0e15dc8d.js');
6
+ const index$1 = require('./index-a93362ed.js');
7
7
 
8
8
  const q2SectionCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch: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;background:var(--tct-section-background, var(--tct-section-background-color, var(--t-section-background-color, var(--tct-section-bg, var(--t-section-bg, var(--app-white, #ffffff))))));color:var(--tct-section-font-color, var(--t-section-font-color, var(--t-text, #4d4d4d)));border-radius:var(--tct-section-border-radius, var(--t-section-border-radius, var(--app-border-radius-1, 3px)));margin:var(--tct-section-margin, var(--t-section-margin, var(--app-scale-3x, 15px)));border-width:var(--tct-section-border-width, 0);border-style:var(--tct-section-border-style, solid);border-color:var(--tct-section-border-color, none)}@media screen and (max-width: 767px){:host{--comp-default-margin:var(--app-scale-3x, 15px) 0;margin:var(--tct-section-margin, var(--t-section-margin, var(--comp-default-margin)))}}@media print{:host{--comp-default-print-margin:var(--app-scale-3x, 15px) 0;margin:var(--tct-section-print-margin, var(--comp-default-print-margin))}}.wrapper{--comp-tween:var(--tct-section-tween, var(--t-section-tween, var(--app-tween-1, 0.2s ease)));--comp-default-wrapper-padding:var(--app-scale-1x, 5px) 0;display:block;padding:var(--tct-section-wrapper-padding, var(--t-section-wrapper-padding, var(--comp-default-wrapper-padding)))}.wrapper:hover{box-shadow:var(--tct-section-wrapper-hover-box-shadow, var(--t-section-wrapper-hover-box-shadow, inherit))}:host([collapsible]) .wrapper{--comp-tween:var(--tct-section-tween, var(--t-section-tween, var(--app-tween-2, 0.4s ease)))}header{--comp-default-header-padding:0 var(--app-scale-3x, 15px);padding:var(--tct-section-header-padding, var(--t-section-header-padding, var(--comp-default-header-padding)));display:flex}@media print{header{padding:var(--tct-section-header-print-padding, 0)}}header.has-header{min-height:var(--tct-section-header-min-height, var(--t-section-header-min-height, 44px))}.header-content{flex:1 1 100%;min-width:0;align-self:center}:host([collapsible]) .header-content{cursor:pointer}.title{margin:var(--tct-section-title-margin, 0);font-size:var(--tct-section-title-font-size, 20px);font-weight:var(--tct-section-title-font-weight, 600);text-transform:var(--tct-section-title-text-transform, uppercase);letter-spacing:var(--tct-section-title-letter-spacing, 0.5px)}q2-icon{transition:transform var(--comp-tween)}:host(:not([expanded])) q2-icon,:host([expanded=false]) q2-icon{transform:rotate(180deg)}.content-wrapper{height:auto}.content-wrapper.is-closed{display:none;overflow:hidden}.content-wrapper.is-transitioning{overflow:hidden}:host([collapsible]) .content-wrapper{transition:height var(--comp-tween)}.content{--comp-default-content-padding:var(--app-scale-2x, 10px) var(--app-scale-3x, 15px);padding:var(--tct-section-content-padding, var(--t-section-content-padding, var(--comp-default-content-padding)))}@media print{.content{padding:var(--tct-section-content-print-padding, 0)}}.content:focus{box-shadow:none}:host([collapsible]) :host(:not([expanded])) .content{visibility:hidden}";
9
9
  const Q2SectionStyle0 = q2SectionCss;
@@ -163,9 +163,9 @@ const Q2Section = class {
163
163
  wrapperClasses.push('is-transitioning');
164
164
  }
165
165
  const showDefaultHeader = !this.hasYieldedHeader && !!this.label;
166
- return (index.h("section", { key: '4cae0e6f0057c318e45274cdabe74878bad2a995', class: "wrapper" }, index.h("header", { key: 'bb4439e069cb85a3950cabfcc08d220415229082', class: hasHeader ? 'has-header' : '' }, index.h("div", { key: '036bd23de5da7bd0c45a31521fdeffa240e398b0', class: "header-content", id: this.titleId, onClick: this.collapsible && this.onHeaderClick }, showDefaultHeader && index.h("h2", { key: '2742ab3ad5654864b0951637e0b5a5a5028ea34d', class: "title" }, index$1.loc(this.label)), index.h("div", { key: 'b772b2028190079db060d28ebaab67723b030462', ref: el => (this.headerSlotWrapper = el), class: "header-slot-wrapper" }, index.h("slot", { key: '986a404b7a5297af31d4122ffe4daa4697b90203', ref: (el) => (this.headerSlot = el), name: "q2-section-header" }))), this.collapsible && !this.noCollapseIcon && (index.h("q2-btn", { key: '678f61529c25ceb257cf7d26abdd46448b0f0d96', label: index$1.loc(this.label || 'tecton.element.section.defaultToggleLabel'), ariaExpanded: `${!!this.expanded}`, ariaControls: this.contentId, "test-id": "toggleButton", "hide-label": true, onClick: this.onHeaderClick }, index.h("q2-icon", { key: '5494baf730dd97d54e1e50b6366dbaea3676ce16', type: "chevron-up" })))), index.h("div", { key: '33cdc24262ad444f8d61cd557371963e5ebf4ce0', class: wrapperClasses.join(' '), id: this.contentId, "aria-labelledby": this.titleId, role: "region", onTransitionEnd: this.onTransitionEnd, style: this.collapsible && {
166
+ return (index.h("section", { key: '245c8a2da4a8c8ae1787d91c9b35872105912e95', class: "wrapper" }, index.h("header", { key: 'bfc10eaaa837d4a8cb49bc3f4397288d546f9e67', class: hasHeader ? 'has-header' : '' }, index.h("div", { key: 'd25b05626ca123afb549ec16c1ce5bec625db4d7', class: "header-content", id: this.titleId, onClick: this.collapsible && this.onHeaderClick }, showDefaultHeader && index.h("h2", { key: 'f2f8c57e3af85b954096e2e25ebef50bd7b79cb0', class: "title" }, index$1.loc(this.label)), index.h("div", { key: 'efd8d321da74b310a48c0c7457d30c4e2386611e', ref: el => (this.headerSlotWrapper = el), class: "header-slot-wrapper" }, index.h("slot", { key: 'ceb27324426a2b7db0d91ce275fa18df588ada1d', ref: (el) => (this.headerSlot = el), name: "q2-section-header" }))), this.collapsible && !this.noCollapseIcon && (index.h("q2-btn", { key: 'a3e309075ca001daddcd645b9160837155ce7506', label: index$1.loc(this.label || 'tecton.element.section.defaultToggleLabel'), ariaExpanded: `${!!this.expanded}`, ariaControls: this.contentId, "test-id": "toggleButton", "hide-label": true, onClick: this.onHeaderClick }, index.h("q2-icon", { key: '3f349cda906286b7a346a9bc9fa6688f47a5392f', type: "chevron-up" })))), index.h("div", { key: '974f2eaa3ff5e607561154906ec4b58f44f2bd84', class: wrapperClasses.join(' '), id: this.contentId, "aria-labelledby": this.titleId, role: "region", onTransitionEnd: this.onTransitionEnd, style: this.collapsible && {
167
167
  height: this.contentHeight,
168
- } }, index.h("div", { key: 'f30463473a96a1e5fe8dc4f5951c147a1847d2f4', ref: el => (this.contentContainer = el), class: "content", tabindex: "-1" }, index.h("slot", { key: 'e41200b2ed13a0e280c223020c7b7ada8d3b6056', ref: (el) => (this.contentSlot = el) })))));
168
+ } }, index.h("div", { key: '63e20753fdfca17b6022903d38a22d0f61ea439d', ref: el => (this.contentContainer = el), class: "content", tabindex: "-1" }, index.h("slot", { key: '08150c784b5a0d2ca7af67bbc5763754c165564f', ref: (el) => (this.contentSlot = el) })))));
169
169
  }
170
170
  get hostElement() { return index.getElement(this); }
171
171
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"q2-section.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,4kHAA4kH,CAAC;AAClmH,wBAAe,YAAY;;MCcd,SAAS;;;;QAkBlB,YAAO,GAAW,OAAO,CAAC;QAC1B,cAAS,GAAW,SAAS,CAAC;;QAiF9B,kBAAa,GAAG;YACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACb,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ;aAC3B,CA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AAc,KACrCA,qEACI,KAAK,EAAEC,WAAG,CAAC,IAAI,CAAC,KAAK,IAAI,2CAA2C,CAAC,EACrE,YAAY,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,EAClC,YAAY,EAAE,IAAI,CAAC,SAAS,aACpB,cAAc,sBAEtB,OAAO,EAAE,IAAI,CAAC,aAAa,IAE3BD,sEAAS,IAAI,EAAC,YAAY,GAAG,CACxB,CACZ,CACI,EACTA,kEACI,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAC/B,EAAE,EAAE,IAAI,CAAC,SAAS,qBACD,IAAI,CAAC,OAAO,EAC7B,IAAI,EAAC,QAAQ,EACb,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,KAAK,EACD,IAAI,CAAC,WAAW,IAAI;gBAChB,MAAM,EAAE,IAAI,CAAC,aAAa;aAC7B,IAGLA,kEACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACvC,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,IAAI,IAEbA,mEAAM,GAAG,EAAE,CAAC,EAAmB,MAAM,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,GAAI,CAC7D,CACJ,CACA,EACZ;KACL;;;;;;;;;;;","names":["resizeIframe","overrideFocus","isEventFromElement","nextPaint","h","loc"],"sources":["src/components/q2-section/q2-section.scss?tag=q2-section&encapsulation=shadow","src/components/q2-section/q2-section.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions.scss';\n\n:host {\n display: block;\n background: var-list(\n --tct-section-background,\n var-prefixer(section-background-color),\n var-prefixer(section-bg),\n --app-white,\n #ffffff\n );\n color: var-list(var-prefixer(section-font-color), --t-text, #4d4d4d);\n border-radius: var-list(var-prefixer(section-border-radius), --app-border-radius-1, 3px);\n margin: var-list(var-prefixer(section-margin), --app-scale-3x, 15px);\n border-width: var-list(--tct-section-border-width, 0);\n border-style: var-list(--tct-section-border-style, solid);\n border-color: var-list(--tct-section-border-color, none);\n\n @media screen and (max-width: 767px) {\n --comp-default-margin: var(--app-scale-3x, 15px) 0;\n margin: var-list(var-prefixer(section-margin), --comp-default-margin);\n }\n\n @media print {\n --comp-default-print-margin: var(--app-scale-3x, 15px) 0;\n margin: var-list(--tct-section-print-margin, --comp-default-print-margin);\n }\n}\n\n.wrapper {\n --comp-tween: #{var-list(var-prefixer(section-tween), --app-tween-1, unquote('0.2s ease'))};\n --comp-default-wrapper-padding: var(--app-scale-1x, 5px) 0;\n display: block;\n padding: var-list(var-prefixer(section-wrapper-padding), --comp-default-wrapper-padding);\n\n &:hover {\n box-shadow: var-list(var-prefixer(section-wrapper-hover-box-shadow), inherit);\n }\n\n :host([collapsible]) & {\n --comp-tween: #{var-list(var-prefixer(section-tween), --app-tween-2, unquote('0.4s ease'))};\n }\n}\n\nheader {\n --comp-default-header-padding: 0 var(--app-scale-3x, 15px);\n padding: var-list(var-prefixer(section-header-padding), --comp-default-header-padding);\n display: flex;\n\n @media print {\n padding: var-list(--tct-section-header-print-padding, 0);\n }\n\n &.has-header {\n min-height: var-list(var-prefixer(section-header-min-height), 44px);\n }\n}\n\n.header-content {\n flex: 1 1 100%;\n min-width: 0;\n align-self: center;\n\n :host([collapsible]) & {\n cursor: pointer;\n }\n}\n\n.title {\n margin: var-list(--tct-section-title-margin, 0);\n font-size: var-list(--tct-section-title-font-size, 20px);\n font-weight: var-list(--tct-section-title-font-weight, 600);\n text-transform: var-list(--tct-section-title-text-transform, uppercase);\n letter-spacing: var-list(--tct-section-title-letter-spacing, 0.5px);\n}\n\nq2-icon {\n transition: transform var(--comp-tween);\n\n :host(:not([expanded])) &,\n :host([expanded='false']) & {\n transform: rotate(180deg);\n }\n}\n\n.content-wrapper {\n height: auto;\n\n &.is-closed {\n display: none;\n overflow: hidden;\n }\n\n &.is-transitioning {\n overflow: hidden;\n }\n\n :host([collapsible]) & {\n transition: height var(--comp-tween);\n }\n}\n\n.content {\n --comp-default-content-padding: var(--app-scale-2x, 10px) var(--app-scale-3x, 15px);\n padding: var-list(var-prefixer(section-content-padding), --comp-default-content-padding);\n\n @media print {\n padding: var-list(--tct-section-content-print-padding, 0);\n }\n\n &:focus {\n box-shadow: none;\n }\n\n :host([collapsible]) :host(:not([expanded])) & {\n visibility: hidden;\n }\n}\n","import {\n Component,\n ComponentInterface,\n Prop,\n Element,\n Listen,\n State,\n Watch,\n h,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { isEventFromElement, loc, nextPaint, overrideFocus, resizeIframe } from 'src/utils';\n\n@Component({ tag: 'q2-section', shadow: true, styleUrl: 'q2-section.scss' })\nexport class Q2Section implements ComponentInterface {\n /** Determines if the section is collapsible. */\n @Prop({ reflect: true }) collapsible: boolean;\n\n /** Indicates if the `q2-section` is in an expanded state or not. */\n @Prop({ reflect: true, mutable: true }) expanded: boolean;\n\n /** The text to display above the `q2-section`. Renders as an `<h2>` element. */\n @Prop({ reflect: true }) label: string;\n\n /** Determines if the collapse chevron icon should show in the `q2-section` header. */\n @Prop({ reflect: true }) noCollapseIcon: boolean;\n\n @Element() hostElement: HTMLElement;\n @State() contentHeight: string;\n @State() hideContent: boolean = false;\n @State() hasYieldedHeader: boolean = false;\n\n titleId: string = 'title';\n contentId: string = 'content';\n resizerFn: NodeJS.Timer | undefined;\n headerSlotMutationObserver: MutationObserver;\n contentSlotMutationObserver: MutationObserver;\n contentContainer: HTMLDivElement;\n headerSlotWrapper: HTMLDivElement;\n headerSlot: HTMLSlotElement;\n contentSlot: HTMLSlotElement;\n\n componentWillLoad() {\n this.onHeaderSlotChange();\n const { collapsible, expanded } = this;\n this.contentHeight = collapsible && expanded ? undefined : '0px';\n this.hideContent = !expanded;\n }\n\n componentDidLoad() {\n this.addHeaderSlotListener();\n this.addContentSlotListener();\n overrideFocus(this.hostElement);\n }\n\n disconnectedCallback() {\n this.removeHeaderSlotListener();\n this.removeContentSlotListener();\n }\n\n /// Listeners ///\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n if (event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {\n this.expanded = event.detail.expanded;\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.contentContainer.focus();\n }\n\n /// Watchers ///\n @Watch('expanded')\n async expandedObserver(expanded: boolean) {\n this.clearResizeInterval();\n this.resizerFn = setInterval(resizeIframe, 5);\n\n if (expanded) {\n this.expandSection();\n } else {\n this.collapseSection();\n }\n }\n\n async collapseSection() {\n this.contentHeight = this.contentContainerHeight;\n await nextPaint(() => {\n this.contentHeight = this.currentHeight;\n });\n }\n\n async expandSection() {\n this.hideContent = false;\n await nextPaint(() => {\n this.contentHeight = this.currentHeight;\n });\n }\n\n @Watch('collapsible')\n collapsibleObserver() {\n this.contentHeight = this.currentHeight;\n }\n\n /// Events ///\n /**\n * Emitted when the section is expanded or collapsed.\n * @legacyEvent\n */\n @Event() change: EventEmitter<{ expanded: boolean }>;\n\n /// Event Handlers ///\n onHeaderClick = () => {\n this.change.emit({\n expanded: !this.expanded,\n });\n };\n\n onTransitionEnd = () => {\n if (this.expanded) {\n this.contentHeight = undefined;\n } else {\n this.hideContent = true;\n }\n\n setTimeout(() => {\n // This gives enough time for all values to get passed over\n // Previously, the interval was never cleared and the fn was called indefinitely then filtered\n // Will revisit in TCT-599\n this.clearResizeInterval();\n }, 1000);\n };\n\n onHeaderSlotChange = () => {\n const hasSlotContent = !!this.hostElement.querySelector('[slot=\"q2-section-header\"]');\n\n if (this.hasYieldedHeader !== hasSlotContent) {\n this.hasYieldedHeader = !!hasSlotContent;\n }\n };\n\n /// Getters ///\n get currentHeight() {\n const { collapsible, expanded } = this;\n if (!collapsible) {\n return null;\n } else if (expanded) {\n return this.contentContainerHeight;\n } else {\n return '0';\n }\n }\n\n get contentContainerHeight() {\n return `${this.contentContainer.offsetHeight || 0}px`;\n }\n\n /// Helpers ///\n clearResizeInterval = () => {\n this.resizerFn && clearInterval(this.resizerFn);\n };\n\n addHeaderSlotListener = () => {\n if (this.headerSlot) {\n this.headerSlot.addEventListener('slotchange', this.onHeaderSlotChange);\n return;\n }\n\n const observer = new MutationObserver(this.onHeaderSlotChange);\n observer.observe(this.headerSlotWrapper, { childList: true });\n this.headerSlotMutationObserver = observer;\n };\n\n removeHeaderSlotListener = () => {\n if (this.headerSlot) {\n this.headerSlot.removeEventListener('slotchange', this.onHeaderSlotChange);\n return;\n }\n\n this.headerSlotMutationObserver.disconnect();\n };\n\n addContentSlotListener = () => {\n if (this.contentSlot) {\n this.contentSlot.addEventListener('slotchange', resizeIframe);\n return;\n }\n\n const observer = new MutationObserver(resizeIframe);\n observer.observe(this.contentContainer, { childList: true, subtree: true });\n this.contentSlotMutationObserver = observer;\n };\n\n removeContentSlotListener = () => {\n if (this.contentSlot) {\n this.contentSlot.removeEventListener('slotchange', resizeIframe);\n return;\n }\n this.contentSlotMutationObserver.disconnect();\n };\n\n render() {\n const hasHeader = this.label || this.hasYieldedHeader;\n const wrapperClasses = ['content-wrapper'];\n const { collapsible, hideContent, contentHeight } = this;\n if (collapsible) {\n if (hideContent) wrapperClasses.push('is-closed');\n else if (contentHeight) wrapperClasses.push('is-transitioning');\n }\n\n const showDefaultHeader = !this.hasYieldedHeader && !!this.label;\n\n return (\n <section class=\"wrapper\">\n <header class={hasHeader ? 'has-header' : ''}>\n <div\n class=\"header-content\"\n id={this.titleId}\n onClick={this.collapsible && this.onHeaderClick}\n >\n {showDefaultHeader && <h2 class=\"title\">{loc(this.label)}</h2>}\n <div\n ref={el => (this.headerSlotWrapper = el)}\n class=\"header-slot-wrapper\"\n >\n <slot\n ref={(el: HTMLSlotElement) => (this.headerSlot = el)}\n name=\"q2-section-header\"\n />\n </div>\n </div>\n {this.collapsible && !this.noCollapseIcon && (\n <q2-btn\n label={loc(this.label || 'tecton.element.section.defaultToggleLabel')}\n ariaExpanded={`${!!this.expanded}`}\n ariaControls={this.contentId}\n test-id=\"toggleButton\"\n hide-label\n onClick={this.onHeaderClick}\n >\n <q2-icon type=\"chevron-up\" />\n </q2-btn>\n )}\n </header>\n <div\n class={wrapperClasses.join(' ')}\n id={this.contentId}\n aria-labelledby={this.titleId}\n role=\"region\"\n onTransitionEnd={this.onTransitionEnd}\n style={\n this.collapsible && {\n height: this.contentHeight,\n }\n }\n >\n <div\n ref={el => (this.contentContainer = el)}\n class=\"content\"\n tabindex=\"-1\"\n >\n <slot ref={(el: HTMLSlotElement) => (this.contentSlot = el)} />\n </div>\n </div>\n </section>\n );\n }\n}\n"],"version":3}
1
+ {"file":"q2-section.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,YAAY,GAAG,4kHAA4kH,CAAC;AAClmH,wBAAe,YAAY;;MCcd,SAAS;;;;QA0BlB,YAAO,GAAW,OAAO,CAAC;QAC1B,cAAS,GAAW,SAAS,CAAC;;QAiF9B,kBAAa,GAAG;YACZ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACb,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ;aAC3B,CAAC,CAAC;SACN,CAAC;QAEF,oBAAe,GAAG;YACd,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;aAClC;iBAAM;gBACH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aAC3B;YAED,UAAU,CAAC;;;;gBAIP,IAAI,CAAC,mBAAmB,EAAE,CAAC;aAC9B,EAAE,IAAI,CAAC,CAAC;SACZ,CAAC;QAEF,uBAAkB,GAAG;YACjB,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;YAEtF,IAAI,IAAI,CAAC,gBAAgB,KAAK,cAAc,EAAE;gBAC1C,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,cAAc,CAAC;aAC5C;SACJ,CAAC;;QAmBF,wBAAmB,GAAG;YAClB,IAAI,CAAC,SAAS,IAAI,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EAAE,KAAK,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACvC,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,IAAI,IAEbA,mEAAM,GAAG,EAAE,CAAC,EAAmB,MAAM,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,GAAI,CAC7D,CACJ,CACA,EACZ;KACL;;;;;;;;;;;","names":["resizeIframe","overrideFocus","isEventFromElement","nextPaint","h","loc"],"sources":["src/components/q2-section/q2-section.scss?tag=q2-section&encapsulation=shadow","src/components/q2-section/q2-section.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions.scss';\n\n:host {\n display: block;\n background: var-list(\n --tct-section-background,\n var-prefixer(section-background-color),\n var-prefixer(section-bg),\n --app-white,\n #ffffff\n );\n color: var-list(var-prefixer(section-font-color), --t-text, #4d4d4d);\n border-radius: var-list(var-prefixer(section-border-radius), --app-border-radius-1, 3px);\n margin: var-list(var-prefixer(section-margin), --app-scale-3x, 15px);\n border-width: var-list(--tct-section-border-width, 0);\n border-style: var-list(--tct-section-border-style, solid);\n border-color: var-list(--tct-section-border-color, none);\n\n @media screen and (max-width: 767px) {\n --comp-default-margin: var(--app-scale-3x, 15px) 0;\n margin: var-list(var-prefixer(section-margin), --comp-default-margin);\n }\n\n @media print {\n --comp-default-print-margin: var(--app-scale-3x, 15px) 0;\n margin: var-list(--tct-section-print-margin, --comp-default-print-margin);\n }\n}\n\n.wrapper {\n --comp-tween: #{var-list(var-prefixer(section-tween), --app-tween-1, unquote('0.2s ease'))};\n --comp-default-wrapper-padding: var(--app-scale-1x, 5px) 0;\n display: block;\n padding: var-list(var-prefixer(section-wrapper-padding), --comp-default-wrapper-padding);\n\n &:hover {\n box-shadow: var-list(var-prefixer(section-wrapper-hover-box-shadow), inherit);\n }\n\n :host([collapsible]) & {\n --comp-tween: #{var-list(var-prefixer(section-tween), --app-tween-2, unquote('0.4s ease'))};\n }\n}\n\nheader {\n --comp-default-header-padding: 0 var(--app-scale-3x, 15px);\n padding: var-list(var-prefixer(section-header-padding), --comp-default-header-padding);\n display: flex;\n\n @media print {\n padding: var-list(--tct-section-header-print-padding, 0);\n }\n\n &.has-header {\n min-height: var-list(var-prefixer(section-header-min-height), 44px);\n }\n}\n\n.header-content {\n flex: 1 1 100%;\n min-width: 0;\n align-self: center;\n\n :host([collapsible]) & {\n cursor: pointer;\n }\n}\n\n.title {\n margin: var-list(--tct-section-title-margin, 0);\n font-size: var-list(--tct-section-title-font-size, 20px);\n font-weight: var-list(--tct-section-title-font-weight, 600);\n text-transform: var-list(--tct-section-title-text-transform, uppercase);\n letter-spacing: var-list(--tct-section-title-letter-spacing, 0.5px);\n}\n\nq2-icon {\n transition: transform var(--comp-tween);\n\n :host(:not([expanded])) &,\n :host([expanded='false']) & {\n transform: rotate(180deg);\n }\n}\n\n.content-wrapper {\n height: auto;\n\n &.is-closed {\n display: none;\n overflow: hidden;\n }\n\n &.is-transitioning {\n overflow: hidden;\n }\n\n :host([collapsible]) & {\n transition: height var(--comp-tween);\n }\n}\n\n.content {\n --comp-default-content-padding: var(--app-scale-2x, 10px) var(--app-scale-3x, 15px);\n padding: var-list(var-prefixer(section-content-padding), --comp-default-content-padding);\n\n @media print {\n padding: var-list(--tct-section-content-print-padding, 0);\n }\n\n &:focus {\n box-shadow: none;\n }\n\n :host([collapsible]) :host(:not([expanded])) & {\n visibility: hidden;\n }\n}\n","import {\n Component,\n ComponentInterface,\n Prop,\n Element,\n Listen,\n State,\n Watch,\n h,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { isEventFromElement, loc, nextPaint, overrideFocus, resizeIframe } from 'src/utils';\n\n@Component({ tag: 'q2-section', shadow: true, styleUrl: 'q2-section.scss' })\nexport class Q2Section implements ComponentInterface {\n /** Determines if the section is collapsible. */\n @Prop({ reflect: true }) collapsible: boolean;\n\n /** Indicates if the `q2-section` is in an expanded state or not. */\n @Prop({ reflect: true, mutable: true }) expanded: boolean;\n\n /**\n * The text to display above the `q2-section`. Renders as an `<h2>` element.\n *\n * It is also used to provided an `aria-label` for the toggle button when the component is collapsible.\n *\n * @warning\n * If you are providing a custom header, setting this property is still strongly encouraged for the purposes of\n * accessibility.\n */\n @Prop({ reflect: true }) label: string;\n\n /** Determines if the collapse chevron icon should show in the `q2-section` header. */\n @Prop({ reflect: true }) noCollapseIcon: boolean;\n\n @Element() hostElement: HTMLElement;\n @State() contentHeight: string;\n @State() hideContent: boolean = false;\n @State() hasYieldedHeader: boolean = false;\n\n titleId: string = 'title';\n contentId: string = 'content';\n resizerFn: NodeJS.Timeout | undefined;\n headerSlotMutationObserver: MutationObserver;\n contentSlotMutationObserver: MutationObserver;\n contentContainer: HTMLDivElement;\n headerSlotWrapper: HTMLDivElement;\n headerSlot: HTMLSlotElement;\n contentSlot: HTMLSlotElement;\n\n componentWillLoad() {\n this.onHeaderSlotChange();\n const { collapsible, expanded } = this;\n this.contentHeight = collapsible && expanded ? undefined : '0px';\n this.hideContent = !expanded;\n }\n\n componentDidLoad() {\n this.addHeaderSlotListener();\n this.addContentSlotListener();\n overrideFocus(this.hostElement);\n }\n\n disconnectedCallback() {\n this.removeHeaderSlotListener();\n this.removeContentSlotListener();\n }\n\n /// Listeners ///\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n if (event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {\n this.expanded = event.detail.expanded;\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.contentContainer.focus();\n }\n\n /// Watchers ///\n @Watch('expanded')\n async expandedObserver(expanded: boolean) {\n this.clearResizeInterval();\n this.resizerFn = setInterval(resizeIframe, 5);\n\n if (expanded) {\n this.expandSection();\n } else {\n this.collapseSection();\n }\n }\n\n async collapseSection() {\n this.contentHeight = this.contentContainerHeight;\n await nextPaint(() => {\n this.contentHeight = this.currentHeight;\n });\n }\n\n async expandSection() {\n this.hideContent = false;\n await nextPaint(() => {\n this.contentHeight = this.currentHeight;\n });\n }\n\n @Watch('collapsible')\n collapsibleObserver() {\n this.contentHeight = this.currentHeight;\n }\n\n /// Events ///\n /**\n * Emitted when the section is expanded or collapsed.\n * @legacyEvent\n */\n @Event() change: EventEmitter<{ expanded: boolean }>;\n\n /// Event Handlers ///\n onHeaderClick = () => {\n this.change.emit({\n expanded: !this.expanded,\n });\n };\n\n onTransitionEnd = () => {\n if (this.expanded) {\n this.contentHeight = undefined;\n } else {\n this.hideContent = true;\n }\n\n setTimeout(() => {\n // This gives enough time for all values to get passed over\n // Previously, the interval was never cleared and the fn was called indefinitely then filtered\n // Will revisit in TCT-599\n this.clearResizeInterval();\n }, 1000);\n };\n\n onHeaderSlotChange = () => {\n const hasSlotContent = !!this.hostElement.querySelector('[slot=\"q2-section-header\"]');\n\n if (this.hasYieldedHeader !== hasSlotContent) {\n this.hasYieldedHeader = !!hasSlotContent;\n }\n };\n\n /// Getters ///\n get currentHeight() {\n const { collapsible, expanded } = this;\n if (!collapsible) {\n return null;\n } else if (expanded) {\n return this.contentContainerHeight;\n } else {\n return '0';\n }\n }\n\n get contentContainerHeight() {\n return `${this.contentContainer.offsetHeight || 0}px`;\n }\n\n /// Helpers ///\n clearResizeInterval = () => {\n this.resizerFn && clearInterval(this.resizerFn);\n };\n\n addHeaderSlotListener = () => {\n if (this.headerSlot) {\n this.headerSlot.addEventListener('slotchange', this.onHeaderSlotChange);\n return;\n }\n\n const observer = new MutationObserver(this.onHeaderSlotChange);\n observer.observe(this.headerSlotWrapper, { childList: true });\n this.headerSlotMutationObserver = observer;\n };\n\n removeHeaderSlotListener = () => {\n if (this.headerSlot) {\n this.headerSlot.removeEventListener('slotchange', this.onHeaderSlotChange);\n return;\n }\n\n this.headerSlotMutationObserver.disconnect();\n };\n\n addContentSlotListener = () => {\n if (this.contentSlot) {\n this.contentSlot.addEventListener('slotchange', resizeIframe);\n return;\n }\n\n const observer = new MutationObserver(resizeIframe);\n observer.observe(this.contentContainer, { childList: true, subtree: true });\n this.contentSlotMutationObserver = observer;\n };\n\n removeContentSlotListener = () => {\n if (this.contentSlot) {\n this.contentSlot.removeEventListener('slotchange', resizeIframe);\n return;\n }\n this.contentSlotMutationObserver.disconnect();\n };\n\n render() {\n const hasHeader = this.label || this.hasYieldedHeader;\n const wrapperClasses = ['content-wrapper'];\n const { collapsible, hideContent, contentHeight } = this;\n if (collapsible) {\n if (hideContent) wrapperClasses.push('is-closed');\n else if (contentHeight) wrapperClasses.push('is-transitioning');\n }\n\n const showDefaultHeader = !this.hasYieldedHeader && !!this.label;\n\n return (\n <section class=\"wrapper\">\n <header class={hasHeader ? 'has-header' : ''}>\n <div\n class=\"header-content\"\n id={this.titleId}\n onClick={this.collapsible && this.onHeaderClick}\n >\n {showDefaultHeader && <h2 class=\"title\">{loc(this.label)}</h2>}\n <div\n ref={el => (this.headerSlotWrapper = el)}\n class=\"header-slot-wrapper\"\n >\n <slot\n ref={(el: HTMLSlotElement) => (this.headerSlot = el)}\n name=\"q2-section-header\"\n />\n </div>\n </div>\n {this.collapsible && !this.noCollapseIcon && (\n <q2-btn\n label={loc(this.label || 'tecton.element.section.defaultToggleLabel')}\n ariaExpanded={`${!!this.expanded}`}\n ariaControls={this.contentId}\n test-id=\"toggleButton\"\n hide-label\n onClick={this.onHeaderClick}\n >\n <q2-icon type=\"chevron-up\" />\n </q2-btn>\n )}\n </header>\n <div\n class={wrapperClasses.join(' ')}\n id={this.contentId}\n aria-labelledby={this.titleId}\n role=\"region\"\n onTransitionEnd={this.onTransitionEnd}\n style={\n this.collapsible && {\n height: this.contentHeight,\n }\n }\n >\n <div\n ref={el => (this.contentContainer = el)}\n class=\"content\"\n tabindex=\"-1\"\n >\n <slot ref={(el: HTMLSlotElement) => (this.contentSlot = el)} />\n </div>\n </div>\n </section>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-14c3693c.js');
6
- const index$1 = require('./index-0e15dc8d.js');
6
+ const index$1 = require('./index-a93362ed.js');
7
7
  const actionSheet = require('./action-sheet-d32c41ae.js');
8
8
 
9
9
  const q2SelectCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch: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}.q2-element-dropdown{display:none;position:absolute;background-color:var(--app-white, #ffffff);color:var(--t-text, #4d4d4d);left:0;width:100%;z-index:100;margin-top:1px;box-shadow:var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3));height:0;overflow:hidden;opacity:0;visibility:hidden;transition:opacity var(--app-tween-1, 0.2s ease);border-radius:var(--tct-dropdown-border-radius, --t-dropdown-border-radius, 0);--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}.q2-element-dropdown::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.q2-element-dropdown::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.q2-element-dropdown::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}.q2-element-dropdown.sizable{display:block;height:auto}.dropdown-open .q2-element-dropdown{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}:host([alignment=right]) .q2-element-dropdown{left:auto;right:0}:host([block]) q2-btn,:host([block]){display:block}:host{--comp-select-margin:var(--tct-select-margin, var(--tct-select-margin-top, var(--t-select-margin-top, var(--app-scale-4, 30px))) 0 var(--tct-select-margin-bottom, var(--t-select-margin-bottom, var(--app-scale-4, 30px))));display:block;margin:var(--comp-select-margin)}.q2-select-container{position:relative;display:block}.q2-select-input{margin:0;--tct-input-min-height:var(--tct-select-input-min-height, var(--t-select-input-min-height));--tct-input-max-height:var(--tct-select-input-max-height, var(--t-select-input-max-height, none))}::slotted([slot=_selected-display]){width:100%;min-height:var(--comp-selected-display-height, 44px)}.custom-display-content{position:absolute;bottom:0;left:calc(var(--tct-scale-2, var(--app-scale-2x, 10px)) + 1px);height:44px;width:calc(100% - 34px - var(--tct-scale-3, var(--app-scale-3x, 15px)));overflow:hidden;cursor:pointer;transition:left var(--tct-tween-2, var(--app-tween-1, 0.2s ease))}.custom-display-content:not([hidden]){display:flex;align-items:center}.is-searchable.is-focused .custom-display-content,.is-searchable .custom-display-content:active{left:calc(var(--tct-scale-3, var(--app-scale-3x, 15px)) + 1px)}.has-error .custom-display-content{width:calc(100% - 68px - var(--tct-scale-3, var(--app-scale-3x, 15px)))}.popover-content{display:flex;flex-direction:column-reverse}.popover-bottom-container{position:sticky;bottom:0;z-index:5}.popover-top-container{position:sticky;top:0;z-index:5}.popover-top-container .multi-select-header{padding:var(--tct-scale-2, var(--app-scale-2x, 10px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--app-white);display:flex;gap:var(--app-scale-2x, 10px);align-items:center}.popover-top-container .multi-select-header fieldset{margin:0;padding:0;border:0;display:flex;gap:var(--app-scale-2x, 10px)}.popover-top-container .multi-select-header legend{padding:0;float:left}.popover-top-container .multi-select-header label{cursor:pointer;padding:var(--tct-select-multi-select-option-padding, var(--t-select-multi-select-option-padding, var(--tct-btn-badge-padding, var(--t-btn-badge-padding, 2px 5px))));font-size:var(--tct-select-multi-select-option-font-size, var(--t-select-multi-select-option-font-size, var(--tct-btn-badge-font-size, var(--t-btn-badge-font-size, inherit))));border-radius:var(--tct-select-multi-select-option-radius, var(--t-select-multi-select-option-radius, var(--tct-btn-badge-border-radius, var(--t-btn-badge-border-radius, var(--app-border-radius-1, 3px)))));background:var(--tct-select-multi-select-option-background, var(--tct-select-multi-select-option-bg, var(--t-select-multi-select-option-bg, var(--tct-badge-background, var(--tct-btn-badge-bg, var(--t-btn-badge-bg, transparent))))));color:var(--tct-select-multi-select-option-color, var(--t-select-multi-select-option-color, var(--tct-btn-badge-font-color, var(--t-btn-badge-font-color, inherit))))}.popover-top-container .multi-select-header label:hover{background:var(--tct-select-multi-select-option-hover-background, var(--tct-select-multi-select-option-hover-background-color, var(--t-select-multi-select-option-hover-background-color, var(--tct-btn-badge-hover-bg, var(--t-btn-badge-hover-bg, var(--tct-gray-14, var(--t-gray-14, var(--app-gray-l3, #f2f2f2))))))));color:var(--tct-select-multi-select-option-hover-color, var(--tct-select-multi-select-option-color, var(--t-select-multi-select-option-color, var(--tct-btn-badge-hover-font-color, var(--t-btn-badge-hover-font-color, var(--tct-gray-5, var(--t-gray-5, var(--app-gray-d2, #404040))))))))}.popover-top-container .multi-select-header input:checked+label,.popover-top-container .multi-select-header input:checked+label:enabled:hover{background:var(--tct-select-multi-select-option-active-background, var(--tct-select-multi-select-option-active-background-color, var(--t-select-multi-select-option-active-background-color, var(--tct-btn-primary-bg, var(--t-btn-primary-bg, #2e2e2e)))));color:var(--tct-select-multi-select-option-active-color, var(--t-select-multi-select-option-active-color, var(--tct-btn-primary-font-color, var(--t-btn-primary-font-color, var(--app-white, #ffffff)))))}.popover-top-container .multi-select-header input:disabled+label{opacity:var(--tct-select-multi-select-option-disabled-opacity, var(--t-select-multi-select-option-disabled-opacity, var(--tct-btn-disabled-opacity, var(--t-btn-disabled-opacity, var(--app-disabled-opacity, 0.4)))));cursor:not-allowed}.popover-top-container .multi-select-header input:focus+label{box-shadow:var(--const-double-focus-ring)}";
@@ -84,6 +84,11 @@ const Q2Select = class {
84
84
  'Escape',
85
85
  'Tab',
86
86
  ];
87
+ if (this.searchable && (key === ' ' || key === 'Enter') && this.inputField.value == '') {
88
+ event.preventDefault();
89
+ if (!this.open)
90
+ this.openDropdownWithoutActiveElement();
91
+ }
87
92
  if (this.searchable && !keysForOptionListToHandle.includes(key))
88
93
  return;
89
94
  if (this.shouldClearSearchText(event))
@@ -386,6 +391,9 @@ const Q2Select = class {
386
391
  this.selectedOptions = [];
387
392
  }
388
393
  }
394
+ onClearHandler() {
395
+ this.clearValue();
396
+ }
389
397
  onHostElementInput(event) {
390
398
  if (!this.searchable || event.target !== this.hostElement || this.hostElement.oninput)
391
399
  return;
@@ -581,12 +589,11 @@ const Q2Select = class {
581
589
  }
582
590
  render() {
583
591
  var _a;
584
- const showAsPseudo = !this.searchable;
585
- return (index.h("click-elsewhere", { key: 'a3fbee9295ca05dbb4856eebf5e6fb53a9f9e2a3', class: this.wrapperClasses, onChange: this.clickedElsewhere }, index.h("div", { key: 'a50de81a29cca3188898f6d4b6e16cbbfb6839f4', "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), index.h("q2-input", { key: '6059e00c0d5b86920a9193b9bf3bd06d0de27d92', ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && index$1.loc(this.label)) || '', value: this.selectedDisplay, clearable: (this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) || undefined, errors: (Array.isArray(this.errors) &&
592
+ return (index.h("click-elsewhere", { key: '421fc4811bdf2f8cfb899ee9823ce20e3301032c', class: this.wrapperClasses, onChange: this.clickedElsewhere }, index.h("div", { key: '1a2b96c2e6dbacfa7dcc8918ff4acab71046dc8d', "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), index.h("q2-input", { key: 'fd678010a8f0d53a4d93c265204bedf72679221a', ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && index$1.loc(this.label)) || '', value: this.selectedDisplay, clearable: (this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) || undefined, errors: (Array.isArray(this.errors) &&
586
593
  this.errors.length > 0 &&
587
594
  this.errors.map(error => index$1.loc(error))) ||
588
595
  (this.invalid && ['tecton.element.select.invalid']) ||
589
- [], disabled: this.disabled, optional: this.optional, readonly: this.readonly, placeholder: this.placeholder || undefined, hideLabel: this.hideLabel, ariaExpanded: `${this.open}`, ariaControls: "option-list", ariaHaspopup: "listbox", role: "combobox", pseudo: showAsPseudo, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler, badgeValue: this.badgeValue, badgeTheme: this.inputFocused ? 'primary' : undefined, _role: "combobox" }, this.renderCustomDisplay()), index.h("div", { key: '3d0564757940cb634bac20ff556e540ef455f695', class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick }, index.h("slot", { key: 'dfdfcb9a0ca41f229d2b50c3b300f47cc565cace', name: "q2-select-display" })), this.optionsDropdown()));
596
+ [], disabled: this.disabled, optional: this.optional, readonly: !!this.readonly, placeholder: this.placeholder || undefined, hideLabel: this.hideLabel, ariaExpanded: `${this.open}`, ariaControls: "option-list", ariaHaspopup: "listbox", "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler, badgeValue: this.badgeValue, badgeTheme: this.inputFocused ? 'primary' : undefined, _role: "combobox", _preventEntry: !this.searchable }, this.renderCustomDisplay()), index.h("div", { key: '26f8c78fb455e7fc9451018ed2745ab53018c270', class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick }, index.h("slot", { key: '4f76ab176fbd88b99aab88ad9e9a3cb87ccb943b', name: "q2-select-display" })), this.optionsDropdown()));
590
597
  }
591
598
  optionsDropdown() {
592
599
  return (index.h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.innerInputContainer, open: this.open, minHeight: this.popoverMinHeight, direction: this.popDirection, mode: this.popoverMode || undefined, block: true }, index.h("div", { class: "popover-content" }, index.h("q2-option-list", { onPopoverState: this.onPopoverState, ref: el => (this.optionList = el), type: "listbox", id: "option-list", "show-selected": this.showSelected, label: this.listLabel, multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, onChange: this.onOptionListChange }, index.h("slot", null)), index.h("div", { class: "popover-top-container", ref: el => (this.popoverTopContainer = el), hidden: !this.multiple && !this.hasPopoverTop, tabindex: "-1" }, index.h("slot", { name: "popover-top" }), this.multiple && this.visibilityToggle())), index.h("div", { class: "popover-bottom-container", hidden: !this.hasPopoverBottom, tabindex: "-1" }, index.h("slot", { name: "popover-bottom" }))));