q2-tecton-elements 1.44.0 → 1.45.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 (474) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +2 -2
  2. package/dist/cjs/{index-1deac3ee.js → index-0e15dc8d.js} +14 -1
  3. package/dist/cjs/index-0e15dc8d.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-avatar.cjs.entry.js +1 -5
  7. package/dist/cjs/q2-avatar.cjs.entry.js.map +1 -1
  8. package/dist/cjs/q2-badge.cjs.entry.js +4 -4
  9. package/dist/cjs/q2-badge.cjs.entry.js.map +1 -1
  10. package/dist/cjs/q2-btn_2.cjs.entry.js +20 -9
  11. package/dist/cjs/q2-btn_2.cjs.entry.js.map +1 -1
  12. package/dist/cjs/q2-calendar.cjs.entry.js +50 -19
  13. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  14. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-carousel-pane.cjs.entry.js +7 -6
  16. package/dist/cjs/q2-carousel-pane.cjs.entry.js.map +1 -1
  17. package/dist/cjs/q2-carousel.cjs.entry.js +25 -11
  18. package/dist/cjs/q2-carousel.cjs.entry.js.map +1 -1
  19. package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-chart-donut.cjs.entry.js +18 -10
  22. package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
  23. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-data-table.cjs.entry.js +3 -3
  26. package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
  27. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  28. package/dist/cjs/q2-detail.cjs.entry.js.map +1 -1
  29. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
  31. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  32. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-icon.cjs.entry.js +206 -211
  34. package/dist/cjs/q2-icon.cjs.entry.js.map +1 -1
  35. package/dist/cjs/q2-input.cjs.entry.js +31 -6
  36. package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
  37. package/dist/cjs/q2-item.cjs.entry.js +120 -0
  38. package/dist/cjs/q2-item.cjs.entry.js.map +1 -0
  39. package/dist/cjs/q2-list.cjs.entry.js +84 -0
  40. package/dist/cjs/q2-list.cjs.entry.js.map +1 -0
  41. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  42. package/dist/cjs/q2-message.cjs.entry.js +3 -3
  43. package/dist/cjs/q2-message.cjs.entry.js.map +1 -1
  44. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  45. package/dist/cjs/q2-optgroup_2.cjs.entry.js +4 -4
  46. package/dist/cjs/q2-optgroup_2.cjs.entry.js.map +1 -1
  47. package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
  48. package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
  49. package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
  50. package/dist/cjs/q2-pill.cjs.entry.js +4 -3
  51. package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
  52. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  53. package/dist/cjs/q2-radio.cjs.entry.js +3 -3
  54. package/dist/cjs/q2-radio.cjs.entry.js.map +1 -1
  55. package/dist/cjs/q2-relative-time.cjs.entry.js +1 -1
  56. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  57. package/dist/cjs/q2-select.cjs.entry.js +1 -1
  58. package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
  59. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +3 -3
  60. package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
  61. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  62. package/dist/cjs/q2-tab-container.cjs.entry.js +3 -3
  63. package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
  64. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  65. package/dist/cjs/q2-tag.cjs.entry.js +3 -3
  66. package/dist/cjs/q2-tag.cjs.entry.js.map +1 -1
  67. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  68. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  69. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  70. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  71. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  72. package/dist/collection/collection-manifest.json +2 -0
  73. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -5
  74. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  75. package/dist/collection/components/q2-badge/q2-badge.js +5 -4
  76. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  77. package/dist/collection/components/q2-btn/q2-btn.css +1 -1
  78. package/dist/collection/components/q2-btn/q2-btn.js +25 -8
  79. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  80. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js +1 -1
  81. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  82. package/dist/collection/components/q2-calendar/q2-calendar.js +48 -17
  83. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  84. package/dist/collection/components/q2-carousel/q2-carousel.css +3 -1
  85. package/dist/collection/components/q2-carousel/q2-carousel.js +47 -10
  86. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  87. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.css +6 -0
  88. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +25 -4
  89. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  90. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +17 -12
  91. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  92. package/dist/collection/components/q2-data-table/q2-data-table.css +1 -1
  93. package/dist/collection/components/q2-data-table/q2-data-table.js +2 -2
  94. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  95. package/dist/collection/components/q2-detail/q2-detail.css +24 -21
  96. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +1 -1
  97. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  98. package/dist/collection/components/q2-icon/assets/cards.symbol.svg +1 -1
  99. package/dist/collection/components/q2-icon/assets/icon-list.json +1 -1
  100. package/dist/collection/components/q2-icon/assets/icon-map.json +1 -1
  101. package/dist/collection/components/q2-icon/assets/legacy.symbol.svg +1 -1
  102. package/dist/collection/components/q2-icon/assets/standard.symbol.svg +1 -1
  103. package/dist/collection/components/q2-icon/q2-icon.css +0 -2
  104. package/dist/collection/components/q2-icon/q2-icon.js +7 -35
  105. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  106. package/dist/collection/components/q2-input/q2-input.css +3 -5
  107. package/dist/collection/components/q2-input/q2-input.js +30 -5
  108. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  109. package/dist/collection/components/q2-item/q2-item.css +261 -0
  110. package/dist/collection/components/q2-item/q2-item.js +145 -0
  111. package/dist/collection/components/q2-item/q2-item.js.map +1 -0
  112. package/dist/collection/components/q2-list/q2-list.css +173 -0
  113. package/dist/collection/components/q2-list/q2-list.js +126 -0
  114. package/dist/collection/components/q2-list/q2-list.js.map +1 -0
  115. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  116. package/dist/collection/components/q2-message/q2-message.css +6 -3
  117. package/dist/collection/components/q2-message/q2-message.js +1 -1
  118. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  119. package/dist/collection/components/q2-option/q2-option.css +1 -1
  120. package/dist/collection/components/q2-option/q2-option.js +1 -1
  121. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  122. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  123. package/dist/collection/components/q2-pill/q2-pill.css +13 -9
  124. package/dist/collection/components/q2-pill/q2-pill.js +19 -1
  125. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  126. package/dist/collection/components/q2-popover/q2-popover.js +1 -1
  127. package/dist/collection/components/q2-radio/q2-radio.css +9 -6
  128. package/dist/collection/components/q2-radio/q2-radio.js +1 -1
  129. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  130. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  131. package/dist/collection/components/q2-section/q2-section.js +2 -2
  132. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  133. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
  134. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.css +6 -2
  135. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  136. package/dist/collection/components/q2-tab-container/q2-tab-container.css +2 -2
  137. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  138. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  139. package/dist/collection/components/q2-tag/q2-tag.css +6 -6
  140. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  141. package/dist/collection/components/q2-textarea/q2-textarea.css +4 -24
  142. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  143. package/dist/collection/utils/index.js +12 -0
  144. package/dist/collection/utils/index.js.map +1 -1
  145. package/dist/components/index.js +4 -0
  146. package/dist/components/index.js.map +1 -1
  147. package/dist/components/index2.js +13 -1
  148. package/dist/components/index2.js.map +1 -1
  149. package/dist/components/q2-avatar2.js +2 -5
  150. package/dist/components/q2-avatar2.js.map +1 -1
  151. package/dist/components/q2-badge2.js +4 -4
  152. package/dist/components/q2-badge2.js.map +1 -1
  153. package/dist/components/q2-btn2.js +21 -10
  154. package/dist/components/q2-btn2.js.map +1 -1
  155. package/dist/components/q2-calendar.js +49 -18
  156. package/dist/components/q2-calendar.js.map +1 -1
  157. package/dist/components/q2-carousel-pane.js +8 -6
  158. package/dist/components/q2-carousel-pane.js.map +1 -1
  159. package/dist/components/q2-carousel.js +26 -10
  160. package/dist/components/q2-carousel.js.map +1 -1
  161. package/dist/components/q2-chart-donut.js +19 -11
  162. package/dist/components/q2-chart-donut.js.map +1 -1
  163. package/dist/components/q2-checkbox-group.js +1 -1
  164. package/dist/components/q2-data-table.js +2 -2
  165. package/dist/components/q2-data-table.js.map +1 -1
  166. package/dist/components/q2-detail.js +2 -2
  167. package/dist/components/q2-detail.js.map +1 -1
  168. package/dist/components/q2-dropdown-item2.js.map +1 -1
  169. package/dist/components/q2-icon2.js +207 -3106
  170. package/dist/components/q2-icon2.js.map +1 -1
  171. package/dist/components/q2-input2.js +31 -6
  172. package/dist/components/q2-input2.js.map +1 -1
  173. package/dist/components/q2-item.d.ts +11 -0
  174. package/dist/components/q2-item.js +137 -0
  175. package/dist/components/q2-item.js.map +1 -0
  176. package/dist/components/q2-list.d.ts +11 -0
  177. package/dist/components/q2-list.js +102 -0
  178. package/dist/components/q2-list.js.map +1 -0
  179. package/dist/components/q2-loc.js +1 -1
  180. package/dist/components/q2-message2.js +3 -3
  181. package/dist/components/q2-message2.js.map +1 -1
  182. package/dist/components/q2-optgroup2.js +1 -1
  183. package/dist/components/q2-option-list2.js +1 -1
  184. package/dist/components/q2-option2.js +2 -2
  185. package/dist/components/q2-option2.js.map +1 -1
  186. package/dist/components/q2-pagination.js +2 -2
  187. package/dist/components/q2-pagination.js.map +1 -1
  188. package/dist/components/q2-pill.js +4 -2
  189. package/dist/components/q2-pill.js.map +1 -1
  190. package/dist/components/q2-popover2.js +2 -2
  191. package/dist/components/q2-radio-group.js +1 -1
  192. package/dist/components/q2-radio.js +2 -2
  193. package/dist/components/q2-radio.js.map +1 -1
  194. package/dist/components/q2-relative-time.js +1 -1
  195. package/dist/components/q2-section.js +2 -2
  196. package/dist/components/q2-select.js +1 -1
  197. package/dist/components/q2-stepper-pane.js +1 -1
  198. package/dist/components/q2-stepper-vertical.js +2 -2
  199. package/dist/components/q2-stepper-vertical.js.map +1 -1
  200. package/dist/components/q2-stepper.js +1 -1
  201. package/dist/components/q2-tab-container.js +2 -2
  202. package/dist/components/q2-tab-container.js.map +1 -1
  203. package/dist/components/q2-tab-pane.js +1 -1
  204. package/dist/components/q2-tag.js +2 -2
  205. package/dist/components/q2-tag.js.map +1 -1
  206. package/dist/components/q2-textarea.js +2 -2
  207. package/dist/components/q2-textarea.js.map +1 -1
  208. package/dist/components/tecton-tab-pane.js +2 -2
  209. package/dist/esm/click-elsewhere_2.entry.js +2 -2
  210. package/dist/esm/{index-12c2a320.js → index-0a702dd6.js} +14 -2
  211. package/dist/esm/index-0a702dd6.js.map +1 -0
  212. package/dist/esm/loader.js +1 -1
  213. package/dist/esm/q2-action-sheet.entry.js +1 -1
  214. package/dist/esm/q2-avatar.entry.js +1 -5
  215. package/dist/esm/q2-avatar.entry.js.map +1 -1
  216. package/dist/esm/q2-badge.entry.js +4 -4
  217. package/dist/esm/q2-badge.entry.js.map +1 -1
  218. package/dist/esm/q2-btn_2.entry.js +20 -9
  219. package/dist/esm/q2-btn_2.entry.js.map +1 -1
  220. package/dist/esm/q2-calendar.entry.js +50 -19
  221. package/dist/esm/q2-calendar.entry.js.map +1 -1
  222. package/dist/esm/q2-card.entry.js +1 -1
  223. package/dist/esm/q2-carousel-pane.entry.js +7 -6
  224. package/dist/esm/q2-carousel-pane.entry.js.map +1 -1
  225. package/dist/esm/q2-carousel.entry.js +25 -11
  226. package/dist/esm/q2-carousel.entry.js.map +1 -1
  227. package/dist/esm/q2-chart-area.entry.js +1 -1
  228. package/dist/esm/q2-chart-bar.entry.js +1 -1
  229. package/dist/esm/q2-chart-donut.entry.js +18 -10
  230. package/dist/esm/q2-chart-donut.entry.js.map +1 -1
  231. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  232. package/dist/esm/q2-checkbox.entry.js +1 -1
  233. package/dist/esm/q2-data-table.entry.js +3 -3
  234. package/dist/esm/q2-data-table.entry.js.map +1 -1
  235. package/dist/esm/q2-detail.entry.js +2 -2
  236. package/dist/esm/q2-detail.entry.js.map +1 -1
  237. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  238. package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
  239. package/dist/esm/q2-dropdown.entry.js +1 -1
  240. package/dist/esm/q2-editable-field.entry.js +1 -1
  241. package/dist/esm/q2-icon.entry.js +206 -211
  242. package/dist/esm/q2-icon.entry.js.map +1 -1
  243. package/dist/esm/q2-input.entry.js +31 -6
  244. package/dist/esm/q2-input.entry.js.map +1 -1
  245. package/dist/esm/q2-item.entry.js +116 -0
  246. package/dist/esm/q2-item.entry.js.map +1 -0
  247. package/dist/esm/q2-list.entry.js +80 -0
  248. package/dist/esm/q2-list.entry.js.map +1 -0
  249. package/dist/esm/q2-loc.entry.js +2 -2
  250. package/dist/esm/q2-message.entry.js +3 -3
  251. package/dist/esm/q2-message.entry.js.map +1 -1
  252. package/dist/esm/q2-month-picker.entry.js +1 -1
  253. package/dist/esm/q2-optgroup_2.entry.js +4 -4
  254. package/dist/esm/q2-optgroup_2.entry.js.map +1 -1
  255. package/dist/esm/q2-option-list.entry.js +1 -1
  256. package/dist/esm/q2-pagination.entry.js +3 -3
  257. package/dist/esm/q2-pagination.entry.js.map +1 -1
  258. package/dist/esm/q2-pill.entry.js +4 -3
  259. package/dist/esm/q2-pill.entry.js.map +1 -1
  260. package/dist/esm/q2-radio-group.entry.js +1 -1
  261. package/dist/esm/q2-radio.entry.js +3 -3
  262. package/dist/esm/q2-radio.entry.js.map +1 -1
  263. package/dist/esm/q2-relative-time.entry.js +1 -1
  264. package/dist/esm/q2-section.entry.js +3 -3
  265. package/dist/esm/q2-select.entry.js +1 -1
  266. package/dist/esm/q2-stepper-pane.entry.js +2 -2
  267. package/dist/esm/q2-stepper-vertical.entry.js +3 -3
  268. package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
  269. package/dist/esm/q2-stepper.entry.js +2 -2
  270. package/dist/esm/q2-tab-container.entry.js +3 -3
  271. package/dist/esm/q2-tab-container.entry.js.map +1 -1
  272. package/dist/esm/q2-tab-pane.entry.js +1 -1
  273. package/dist/esm/q2-tag.entry.js +3 -3
  274. package/dist/esm/q2-tag.entry.js.map +1 -1
  275. package/dist/esm/q2-tecton-elements.js +1 -1
  276. package/dist/esm/q2-textarea.entry.js +2 -2
  277. package/dist/esm/q2-textarea.entry.js.map +1 -1
  278. package/dist/esm/q2-tooltip.entry.js +1 -1
  279. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  280. package/dist/q2-tecton-elements/assets/cards.symbol.svg +1 -1
  281. package/dist/q2-tecton-elements/assets/icon-list.json +1 -1
  282. package/dist/q2-tecton-elements/assets/icon-map.json +1 -1
  283. package/dist/q2-tecton-elements/assets/legacy.symbol.svg +1 -1
  284. package/dist/q2-tecton-elements/assets/standard.symbol.svg +1 -1
  285. package/dist/q2-tecton-elements/p-05b015a8.entry.js +2 -0
  286. package/dist/q2-tecton-elements/p-05b015a8.entry.js.map +1 -0
  287. package/dist/q2-tecton-elements/p-0d548810.entry.js +2 -0
  288. package/dist/q2-tecton-elements/p-0d548810.entry.js.map +1 -0
  289. package/dist/q2-tecton-elements/{p-cbbc7659.entry.js → p-1c17d118.entry.js} +2 -2
  290. package/dist/q2-tecton-elements/p-1c17d118.entry.js.map +1 -0
  291. package/dist/q2-tecton-elements/{p-86cf292d.entry.js → p-2132da06.entry.js} +2 -2
  292. package/dist/q2-tecton-elements/{p-1fac9c85.entry.js → p-22661533.entry.js} +2 -2
  293. package/dist/q2-tecton-elements/p-2436c843.entry.js +2 -0
  294. package/dist/q2-tecton-elements/p-2436c843.entry.js.map +1 -0
  295. package/dist/q2-tecton-elements/{p-5ebb80b6.entry.js → p-391acc00.entry.js} +2 -2
  296. package/dist/q2-tecton-elements/{p-5ebb80b6.entry.js.map → p-391acc00.entry.js.map} +1 -1
  297. package/dist/q2-tecton-elements/p-3b1ea100.entry.js +2 -0
  298. package/dist/q2-tecton-elements/p-3b1ea100.entry.js.map +1 -0
  299. package/dist/q2-tecton-elements/p-42302f6f.js +2 -0
  300. package/dist/q2-tecton-elements/p-42302f6f.js.map +1 -0
  301. package/dist/q2-tecton-elements/{p-92955258.entry.js → p-4570ff06.entry.js} +2 -2
  302. package/dist/q2-tecton-elements/p-47868d6d.entry.js +2 -0
  303. package/dist/q2-tecton-elements/p-47868d6d.entry.js.map +1 -0
  304. package/dist/q2-tecton-elements/{p-c1e03092.entry.js → p-4a332c2a.entry.js} +2 -2
  305. package/dist/q2-tecton-elements/{p-0a705412.entry.js → p-4b81a121.entry.js} +2 -2
  306. package/dist/q2-tecton-elements/p-4bbe563f.entry.js +2 -0
  307. package/dist/q2-tecton-elements/p-4bbe563f.entry.js.map +1 -0
  308. package/dist/q2-tecton-elements/p-4f7e2c8a.entry.js +2 -0
  309. package/dist/q2-tecton-elements/p-4f7e2c8a.entry.js.map +1 -0
  310. package/dist/q2-tecton-elements/p-50bd4437.entry.js +2 -0
  311. package/dist/q2-tecton-elements/p-50bd4437.entry.js.map +1 -0
  312. package/dist/q2-tecton-elements/p-515d424b.entry.js +2 -0
  313. package/dist/q2-tecton-elements/{p-913a23f5.entry.js.map → p-515d424b.entry.js.map} +1 -1
  314. package/dist/q2-tecton-elements/{p-bb6e6290.entry.js → p-57bf9342.entry.js} +2 -2
  315. package/dist/q2-tecton-elements/{p-0fccdca2.entry.js → p-5dc5c4e2.entry.js} +2 -2
  316. package/dist/q2-tecton-elements/p-5dc5c4e2.entry.js.map +1 -0
  317. package/dist/q2-tecton-elements/{p-5b9ee831.entry.js → p-63192fac.entry.js} +2 -2
  318. package/dist/q2-tecton-elements/{p-281e7ce7.entry.js → p-685b821c.entry.js} +2 -2
  319. package/dist/q2-tecton-elements/{p-bd5e5864.entry.js → p-71180fcd.entry.js} +2 -2
  320. package/dist/q2-tecton-elements/{p-db615608.entry.js → p-7523305d.entry.js} +2 -2
  321. package/dist/q2-tecton-elements/{p-ca8dd86f.entry.js → p-7f663376.entry.js} +2 -2
  322. package/dist/q2-tecton-elements/{p-b52eb7ce.entry.js → p-8dc489e1.entry.js} +2 -2
  323. package/dist/q2-tecton-elements/p-a214077c.entry.js +2 -0
  324. package/dist/q2-tecton-elements/p-a214077c.entry.js.map +1 -0
  325. package/dist/q2-tecton-elements/{p-3bc27513.entry.js → p-aec64fcb.entry.js} +2 -2
  326. package/dist/q2-tecton-elements/p-aed969d4.entry.js +2 -0
  327. package/dist/q2-tecton-elements/p-aed969d4.entry.js.map +1 -0
  328. package/dist/q2-tecton-elements/p-b21ed2d9.entry.js +2 -0
  329. package/dist/q2-tecton-elements/p-b21ed2d9.entry.js.map +1 -0
  330. package/dist/q2-tecton-elements/{p-1954ab7d.entry.js → p-b3322f94.entry.js} +2 -2
  331. package/dist/q2-tecton-elements/p-b3322f94.entry.js.map +1 -0
  332. package/dist/q2-tecton-elements/{p-25eccf38.entry.js → p-b3d10d52.entry.js} +2 -2
  333. package/dist/q2-tecton-elements/{p-25eccf38.entry.js.map → p-b3d10d52.entry.js.map} +1 -1
  334. package/dist/q2-tecton-elements/{p-5b3f885f.entry.js → p-b7d5fd12.entry.js} +2 -2
  335. package/dist/q2-tecton-elements/p-b7d5fd12.entry.js.map +1 -0
  336. package/dist/q2-tecton-elements/{p-cb30f949.entry.js → p-bf125cdf.entry.js} +2 -2
  337. package/dist/q2-tecton-elements/p-d1a9ed3d.entry.js +2 -0
  338. package/dist/q2-tecton-elements/p-d1a9ed3d.entry.js.map +1 -0
  339. package/dist/q2-tecton-elements/{p-73a3c437.entry.js → p-d635e39f.entry.js} +2 -2
  340. package/dist/q2-tecton-elements/{p-a5b16c01.entry.js → p-d9e19f70.entry.js} +2 -2
  341. package/dist/q2-tecton-elements/p-d9e19f70.entry.js.map +1 -0
  342. package/dist/q2-tecton-elements/{p-a89814b8.entry.js → p-dc057a9c.entry.js} +2 -2
  343. package/dist/q2-tecton-elements/p-debd5249.entry.js +2 -0
  344. package/dist/q2-tecton-elements/p-debd5249.entry.js.map +1 -0
  345. package/dist/q2-tecton-elements/p-df297a77.entry.js +2 -0
  346. package/dist/q2-tecton-elements/p-df297a77.entry.js.map +1 -0
  347. package/dist/q2-tecton-elements/{p-6afb4d46.entry.js → p-e762526f.entry.js} +2 -2
  348. package/dist/q2-tecton-elements/{p-698f82c5.entry.js → p-f1265647.entry.js} +2 -2
  349. package/dist/q2-tecton-elements/{p-954d49de.entry.js → p-f162c670.entry.js} +2 -2
  350. package/dist/q2-tecton-elements/p-f418967b.entry.js +2 -0
  351. package/dist/q2-tecton-elements/p-f418967b.entry.js.map +1 -0
  352. package/dist/q2-tecton-elements/{p-fddebc47.entry.js → p-f4d77672.entry.js} +2 -2
  353. package/dist/q2-tecton-elements/p-fcc84527.entry.js +2 -0
  354. package/dist/q2-tecton-elements/p-fcc84527.entry.js.map +1 -0
  355. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  356. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  357. package/dist/test/elements/q2-badge-test.e2e.js +11 -3
  358. package/dist/test/elements/q2-badge-test.e2e.js.map +1 -1
  359. package/dist/test/elements/q2-btn-test.e2e.js +25 -25
  360. package/dist/test/elements/q2-btn-test.e2e.js.map +1 -1
  361. package/dist/test/elements/q2-calendar-test.e2e.js +3 -3
  362. package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
  363. package/dist/test/elements/q2-carousel-pane-test.e2e.js +16 -86
  364. package/dist/test/elements/q2-carousel-pane-test.e2e.js.map +1 -1
  365. package/dist/test/elements/q2-carousel-pane-test.spec.js +113 -0
  366. package/dist/test/elements/q2-carousel-pane-test.spec.js.map +1 -0
  367. package/dist/test/elements/q2-carousel-test.e2e.js +27 -1
  368. package/dist/test/elements/q2-carousel-test.e2e.js.map +1 -1
  369. package/dist/test/elements/q2-chart-donut-test.e2e.js +64 -30
  370. package/dist/test/elements/q2-chart-donut-test.e2e.js.map +1 -1
  371. package/dist/test/elements/q2-currency-test.e2e.js +7 -7
  372. package/dist/test/elements/q2-currency-test.e2e.js.map +1 -1
  373. package/dist/test/elements/q2-detail/q2-detail-test.e2e.js +1 -1
  374. package/dist/test/elements/q2-detail/q2-detail-test.e2e.js.map +1 -1
  375. package/dist/test/elements/q2-detail/q2-item-test.e2e.js +223 -0
  376. package/dist/test/elements/q2-detail/q2-item-test.e2e.js.map +1 -0
  377. package/dist/test/elements/q2-detail/q2-list-test.e2e.js +92 -0
  378. package/dist/test/elements/q2-detail/q2-list-test.e2e.js.map +1 -0
  379. package/dist/test/elements/q2-icon-test.e2e.js +20 -98
  380. package/dist/test/elements/q2-icon-test.e2e.js.map +1 -1
  381. package/dist/test/elements/q2-input-test.e2e.js +140 -7
  382. package/dist/test/elements/q2-input-test.e2e.js.map +1 -1
  383. package/dist/test/elements/q2-pill-test.e2e.js +23 -0
  384. package/dist/test/elements/q2-pill-test.e2e.js.map +1 -1
  385. package/dist/test/elements/q2-relative-time-test.e2e.js +50 -48
  386. package/dist/test/elements/q2-relative-time-test.e2e.js.map +1 -1
  387. package/dist/test/elements/q2-textarea-test.e2e.js +4 -8
  388. package/dist/test/elements/q2-textarea-test.e2e.js.map +1 -1
  389. package/dist/test/helpers.js +18 -16
  390. package/dist/test/helpers.js.map +1 -1
  391. package/dist/test/utils/index.spec.js +18 -0
  392. package/dist/test/utils/index.spec.js.map +1 -0
  393. package/dist/types/components/q2-avatar/q2-avatar.d.ts +0 -1
  394. package/dist/types/components/q2-badge/q2-badge.d.ts +1 -0
  395. package/dist/types/components/q2-btn/q2-btn.d.ts +1 -0
  396. package/dist/types/components/q2-carousel/q2-carousel.d.ts +3 -0
  397. package/dist/types/components/q2-carousel-pane/q2-carousel-pane.d.ts +5 -0
  398. package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +13 -12
  399. package/dist/types/components/q2-icon/q2-icon.d.ts +1 -5
  400. package/dist/types/components/q2-input/q2-input.d.ts +8 -0
  401. package/dist/types/components/q2-item/q2-item.d.ts +21 -0
  402. package/dist/types/components/q2-list/q2-list.d.ts +20 -0
  403. package/dist/types/components.d.ts +82 -14
  404. package/dist/types/global.d.ts +1 -1
  405. package/dist/types/utils/index.d.ts +6 -0
  406. package/dist/types/workspace/workspace/_Gitlab_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  407. package/package.json +3 -3
  408. package/dist/cjs/icons-04e4f595.js +0 -2900
  409. package/dist/cjs/icons-04e4f595.js.map +0 -1
  410. package/dist/cjs/index-1deac3ee.js.map +0 -1
  411. package/dist/collection/components/q2-icon/icons.js +0 -1184
  412. package/dist/collection/components/q2-icon/icons.js.map +0 -1
  413. package/dist/esm/icons-8f4c3b69.js +0 -2898
  414. package/dist/esm/icons-8f4c3b69.js.map +0 -1
  415. package/dist/esm/index-12c2a320.js.map +0 -1
  416. package/dist/q2-tecton-elements/p-043bb5c0.entry.js +0 -2
  417. package/dist/q2-tecton-elements/p-043bb5c0.entry.js.map +0 -1
  418. package/dist/q2-tecton-elements/p-0e2e7b2d.entry.js +0 -2
  419. package/dist/q2-tecton-elements/p-0e2e7b2d.entry.js.map +0 -1
  420. package/dist/q2-tecton-elements/p-0fccdca2.entry.js.map +0 -1
  421. package/dist/q2-tecton-elements/p-1954ab7d.entry.js.map +0 -1
  422. package/dist/q2-tecton-elements/p-55bc5c9b.entry.js +0 -2
  423. package/dist/q2-tecton-elements/p-55bc5c9b.entry.js.map +0 -1
  424. package/dist/q2-tecton-elements/p-562d598b.entry.js +0 -2
  425. package/dist/q2-tecton-elements/p-562d598b.entry.js.map +0 -1
  426. package/dist/q2-tecton-elements/p-5b3f885f.entry.js.map +0 -1
  427. package/dist/q2-tecton-elements/p-5c46acb8.js +0 -2
  428. package/dist/q2-tecton-elements/p-5c46acb8.js.map +0 -1
  429. package/dist/q2-tecton-elements/p-5dd0eede.entry.js +0 -2
  430. package/dist/q2-tecton-elements/p-5dd0eede.entry.js.map +0 -1
  431. package/dist/q2-tecton-elements/p-6479c450.entry.js +0 -2
  432. package/dist/q2-tecton-elements/p-6479c450.entry.js.map +0 -1
  433. package/dist/q2-tecton-elements/p-7c5d43cf.entry.js +0 -2
  434. package/dist/q2-tecton-elements/p-7c5d43cf.entry.js.map +0 -1
  435. package/dist/q2-tecton-elements/p-7ff4c446.entry.js +0 -2
  436. package/dist/q2-tecton-elements/p-7ff4c446.entry.js.map +0 -1
  437. package/dist/q2-tecton-elements/p-87d72e3e.entry.js +0 -2
  438. package/dist/q2-tecton-elements/p-87d72e3e.entry.js.map +0 -1
  439. package/dist/q2-tecton-elements/p-913a23f5.entry.js +0 -2
  440. package/dist/q2-tecton-elements/p-a5b16c01.entry.js.map +0 -1
  441. package/dist/q2-tecton-elements/p-c13ce2d3.entry.js +0 -2
  442. package/dist/q2-tecton-elements/p-c13ce2d3.entry.js.map +0 -1
  443. package/dist/q2-tecton-elements/p-cbbc7659.entry.js.map +0 -1
  444. package/dist/q2-tecton-elements/p-d7e608f7.entry.js +0 -2
  445. package/dist/q2-tecton-elements/p-d7e608f7.entry.js.map +0 -1
  446. package/dist/q2-tecton-elements/p-dce084f9.entry.js +0 -2
  447. package/dist/q2-tecton-elements/p-dce084f9.entry.js.map +0 -1
  448. package/dist/q2-tecton-elements/p-ecce27a0.entry.js +0 -2
  449. package/dist/q2-tecton-elements/p-ecce27a0.entry.js.map +0 -1
  450. package/dist/q2-tecton-elements/p-f6c1f69b.js +0 -2
  451. package/dist/q2-tecton-elements/p-f6c1f69b.js.map +0 -1
  452. package/dist/q2-tecton-elements/p-f8c7cad7.entry.js +0 -2
  453. package/dist/q2-tecton-elements/p-f8c7cad7.entry.js.map +0 -1
  454. package/dist/types/components/q2-icon/icons.d.ts +0 -3
  455. /package/dist/q2-tecton-elements/{p-86cf292d.entry.js.map → p-2132da06.entry.js.map} +0 -0
  456. /package/dist/q2-tecton-elements/{p-1fac9c85.entry.js.map → p-22661533.entry.js.map} +0 -0
  457. /package/dist/q2-tecton-elements/{p-92955258.entry.js.map → p-4570ff06.entry.js.map} +0 -0
  458. /package/dist/q2-tecton-elements/{p-c1e03092.entry.js.map → p-4a332c2a.entry.js.map} +0 -0
  459. /package/dist/q2-tecton-elements/{p-0a705412.entry.js.map → p-4b81a121.entry.js.map} +0 -0
  460. /package/dist/q2-tecton-elements/{p-bb6e6290.entry.js.map → p-57bf9342.entry.js.map} +0 -0
  461. /package/dist/q2-tecton-elements/{p-5b9ee831.entry.js.map → p-63192fac.entry.js.map} +0 -0
  462. /package/dist/q2-tecton-elements/{p-281e7ce7.entry.js.map → p-685b821c.entry.js.map} +0 -0
  463. /package/dist/q2-tecton-elements/{p-bd5e5864.entry.js.map → p-71180fcd.entry.js.map} +0 -0
  464. /package/dist/q2-tecton-elements/{p-db615608.entry.js.map → p-7523305d.entry.js.map} +0 -0
  465. /package/dist/q2-tecton-elements/{p-ca8dd86f.entry.js.map → p-7f663376.entry.js.map} +0 -0
  466. /package/dist/q2-tecton-elements/{p-b52eb7ce.entry.js.map → p-8dc489e1.entry.js.map} +0 -0
  467. /package/dist/q2-tecton-elements/{p-3bc27513.entry.js.map → p-aec64fcb.entry.js.map} +0 -0
  468. /package/dist/q2-tecton-elements/{p-cb30f949.entry.js.map → p-bf125cdf.entry.js.map} +0 -0
  469. /package/dist/q2-tecton-elements/{p-73a3c437.entry.js.map → p-d635e39f.entry.js.map} +0 -0
  470. /package/dist/q2-tecton-elements/{p-a89814b8.entry.js.map → p-dc057a9c.entry.js.map} +0 -0
  471. /package/dist/q2-tecton-elements/{p-6afb4d46.entry.js.map → p-e762526f.entry.js.map} +0 -0
  472. /package/dist/q2-tecton-elements/{p-698f82c5.entry.js.map → p-f1265647.entry.js.map} +0 -0
  473. /package/dist/q2-tecton-elements/{p-954d49de.entry.js.map → p-f162c670.entry.js.map} +0 -0
  474. /package/dist/q2-tecton-elements/{p-fddebc47.entry.js.map → p-f4d77672.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["formatDateISO","value","date","Date","isValidDate","formatISO","representation","memoizedFormatDateShort","formatDateShort","isoDate","toISOString","Intl","DateTimeFormat","month","day","year","timeZone","resolvedOptions","format","memoizedFormatDateLong","formatDateLong","memoizedFormatDateFull","formatDateFull","weekday","convertMomentFormat","stringFormat","replace","stringToDate","isString","undefined","result","dateParts","split","map","part","padStart","isIsoString","length","isCompleteDate","isPartialDate","isStandardSlashDate","includes","unshift","pop","UTC","parseInt","now","yearNumber","monthNumber","dayNumber","getFullYear","removeTimezoneOffset","timeZoneOffset","getTimezoneOffset","setMinutes","Math","abs","stringArrayToDate","dateArray","Array","isArray","setupMonthYear","monthIndex","getMonth","selectedYear","validateInput","input","validDays","validDates","invalidDates","startDate","endDate","formatString","assume","isValid","isAvailable","messageType","message","loc","inputDate","buildInputDate","getDate","calendarPosition","monthName","getMonths","getDay","isoString","isNotValidDate","isInvalidDate","isBeforeStartDate","isAfterEndDate","isInvalid","Number","twoDigitDay","fourDigitYear","assumeYear","monthDay","mm","dd","nowLocal","assumedYear","slice","toString","handleMissingZeros","match","sp","reorderDateString","firstDayOfWeekInMonth","getDays","getDaysOfWeek","generateDatesFromMonthYear","daysInMonth","getDaysInMonth","keys","reduce","acc","stepIndex","push","getValidDaysOfWeek","checksum","sunValid","monValid","tuesValid","wedsValid","thursValid","friValid","satValid","ret","validateAgainstChecksum","validDaysOfWeek","newDate","validateAgainstBlacklist","validateAgainstWhitelist","some","validDate","isSameDay","buildDates","selectedMonthYear","currentSelection","dateValidators","typedValue","validationFns","baseValidation","bind","generateDateList","isIncompleteDate","datesInMonth","dayInMonth","dateIndex","fn","dayState","getDayState","classList","generateClassesForCalDay","Object","assign","integer","isEmpty","isActivity","startOfMonthEmpties","addEmptiesMonthStart","endOfMonthEmpties","addEmptiesMonthEnd","isNewDateBeforeStartDate","isAfter","isNewDateAfterEndDate","isBefore","isNowAfterCutoffTime","cutOffTime","currentDate","isSelected","isToday","isStartDate","isEndDate","classes","join","monthStartDayOfWeek","addEmptyDates","monthEndDayOfWeek","emptyDate","from","to","q2CalendarCss","Q2CalendarStyle0","Q2Calendar","this","formatModifier","defaultFormatString","scheduledAfterRender","internalError","dayAbbrStrings","dayStrings","monthStrings","closeCalendar","open","focusInput","openCalendar","readonly","dateValue","dateList","buildDateList","toggleCalendar","onClickElsewhere","event","target","localName","stopPropagation","onPopupKeyup","key","onInputBlur","onInputInput","detail","onInputKeydown","preventDefault","activateDay","onInputKeyup","disabled","isTypeable","daysOfWeekChecksum","yyyy","validateDate","setCompleteInput","change","emit","keyboardSelection","setHints","onInputChange","defaultHintMessage","valueOnBlur","onInputFocus","controlElement","tmpTypedValue","onInputClick","onRefocus","_a","btnPrevMonth","dispatchEvent","FocusEvent","goToMonthYear","checkActiveCellForBlankness","selectDate","find","invalid","onDateSelection","dateCell","closest","clickedDate","dataset","onHeaderControlKeydown","generateDateFromDay","hasSelectedCell","calendarBody","querySelector","onDateKeydown","currentDay","addDays","shiftKey","connectedCallback","componentWillLoad","popDirectionHandler","handleAriaLabel","componentDidRender","setTimeout","forEach","componentDidLoad","overrideFocus","hostElement","selectedDate","selectedCell","innerInputField","_b","shadowRoot","innerInputContainer","typeable","canClear","clearable","currentWeeks","weeks","accum","item","index","chunkIndex","floor","formattedValue","displayFormat","computedPlaceholder","disabledMsg","buttonLabel","placeholder","isMoment","toDate","isMomentString","test","ct","cutoffTime","errorList","errors","list","filter","error","concat","hintList","hints","hintMessageType","hintMessage","hint","defaultChangeHandler","onchange","defaultErrorHandler","onerror","defaultSuccessHandler","onsuccess","delegateFocus","isEventFromElement","focus","handleClear","popoverStateHandler","_togglePopover","toggleElement","btnCalendarToggle","click","openPopover","closePopover","setValue","waitForNextPaint","tableCell","calendarTable","typeValue","formattedDate","InputEvent","KeyboardEvent","handleRenamedProp","ariaLabelObserver","typeableChanged","valueObserver","newValue","shortFormattedValue","daysOfWeekChecksumObserver","validDatesObserver","invalidDatesObserver","startDateObserver","endDateObserver","cutoffTimeObserver","monthYear","isSelectedMonthAndYear","calculationDateList","dateValueDayOfMonth","_c","isDateValueInvalid","errorCode","success","console","warn","activeElement","tagName","hasAttribute","calendarCells","querySelectorAll","indexOfCell","indexOf","dayToFocus","cell","focusDay","render","h","class","onChange","inputField","ref","el","popoverElement","direction","popoverDirection","minHeight","popoverMinHeight","align","popoverAlignment","block","hintField","calendarPopover","hintMessageElement","type","present","label","hideLabel","optional","ariaExpanded","onClick","onInput","onKeyDown","onKeyUp","onBlur","onFocus","pseudo","slot","calendarLabel","elm","btnNextMonth","btnPrevYear","btnNextYear","id","calendarDays","disclaimer","role","scope","week","ariaLabel","tabindex"],"sources":["src/components/q2-calendar/q2-calendar-helpers.ts","src/components/q2-calendar/q2-calendar-validation.ts","src/components/q2-calendar/q2-calendar.scss?tag=q2-calendar&encapsulation=shadow","src/components/q2-calendar/q2-calendar.tsx"],"sourcesContent":["import { isValid as isValidDate, formatISO, setMinutes } from 'date-fns';\nimport { loc } from '../../utils';\nimport { ISelectedMonthYear, InputValidation } from './q2-calendar-types';\n\nexport interface IMomentLikeObject {\n toDate(): Date;\n}\n\nexport function formatDateISO(value: string | Date) {\n const date = new Date(value);\n if (!isValidDate(date)) return;\n\n return formatISO(date, { representation: 'date' });\n}\n\nlet memoizedFormatDateShort: Intl.DateTimeFormat;\nexport function formatDateShort(value: string | Date) {\n const date = new Date(value);\n if (!isValidDate(date)) return;\n\n const isoDate = date.toISOString();\n if (!memoizedFormatDateShort) {\n memoizedFormatDateShort = new Intl.DateTimeFormat('en-US', {\n month: '2-digit',\n day: '2-digit',\n year: 'numeric',\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n });\n }\n\n return memoizedFormatDateShort.format(new Date(isoDate));\n}\n\nlet memoizedFormatDateLong: Intl.DateTimeFormat;\nexport function formatDateLong(value: string | Date) {\n const date = new Date(value);\n if (!isValidDate(date)) return;\n if (!memoizedFormatDateLong) {\n memoizedFormatDateLong = new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n }\n\n return memoizedFormatDateLong.format(date);\n}\n\nlet memoizedFormatDateFull: Intl.DateTimeFormat;\nexport function formatDateFull(value: string | Date) {\n if (!value) return;\n const date = new Date(value);\n if (!isValidDate(date)) return;\n if (!memoizedFormatDateFull) {\n memoizedFormatDateFull = new Intl.DateTimeFormat('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n weekday: 'long',\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n });\n }\n\n return memoizedFormatDateFull.format(date);\n}\n\nexport function convertMomentFormat(stringFormat: string) {\n return stringFormat\n .replace(/[d]/g, 'E')\n .replace(/[D]/g, 'd')\n .replace(/[Y]/g, 'y')\n .replace(/[l]/g, 'P')\n .replace(/[W]/g, 'I');\n}\n\nexport function stringToDate(date: string | null | void): Date | undefined {\n const isString = typeof date === 'string';\n if (!isString && date && isValidDate(new Date(date || undefined))) {\n date = formatDateISO(date);\n } else if (!date || !isValidDate(new Date(date))) {\n return undefined;\n }\n\n let result: Date;\n const dateParts = date.split(/[\\/\\-]/).map(part => part.padStart(2, '0'));\n const isIsoString = isString && date.length >= 24 && date[10] === 'T';\n const isCompleteDate = dateParts.length === 3;\n const isPartialDate = dateParts.length < 3;\n if (isIsoString) {\n date = date.split('T')[0];\n result = new Date(date);\n } else if (isCompleteDate) {\n const isStandardSlashDate = date.includes('/') && dateParts[2].length === 4;\n\n // Reorder mm/dd/yyyy dates for ISO formatting\n // [mm, dd, yyyy] -> [yyyy, mm, dd]\n if (isStandardSlashDate) dateParts.unshift(dateParts.pop());\n\n result = new Date(Date.UTC(parseInt(dateParts[0]), parseInt(dateParts[1]) - 1, parseInt(dateParts[2])));\n } else if (isPartialDate) {\n const now = new Date();\n\n let yearNumber: number;\n let monthNumber: string;\n let dayNumber: string;\n switch (dateParts.length) {\n case 1:\n yearNumber = now.getFullYear();\n monthNumber = dateParts[0];\n dayNumber = '01';\n break;\n\n case 2:\n yearNumber = now.getFullYear();\n monthNumber = dateParts[0];\n dayNumber = dateParts[1];\n break;\n }\n\n result = new Date(`${yearNumber}-${monthNumber}-${dayNumber}`);\n }\n\n if (!isValidDate(result)) return undefined;\n\n // result = setHours(result, 0);\n result = removeTimezoneOffset(result);\n\n return isValidDate(result) ? result : undefined;\n}\n\nexport function removeTimezoneOffset(date: Date) {\n const timeZoneOffset = date.getTimezoneOffset();\n // Minutes compensation for some timezones like India, Central Australia and etc use GMT+5:30, GMT+9:30\n return setMinutes(date, timeZoneOffset + Math.abs(timeZoneOffset % 60));\n}\n\nexport function stringArrayToDate(dateArray: string[]): Date[] {\n if (!Array.isArray(dateArray) || dateArray.length === 0) {\n return [];\n }\n return dateArray.map(date => stringToDate(date));\n}\n\nexport function setupMonthYear(value: Date | undefined = new Date()): ISelectedMonthYear {\n return {\n monthIndex: value.getMonth(),\n selectedYear: value.getFullYear(),\n };\n}\n\nexport function validateInput(\n input: string = '',\n validDays: number[] = [],\n validDates: string[] = [], // white list\n invalidDates: string[] = [], // black list\n startDate: string,\n endDate: string,\n formatString: string = 'mm/dd/yyyy',\n assume: string\n): InputValidation {\n let isValid: boolean = true;\n let isAvailable: boolean = false;\n let messageType: string = 'info';\n let message: string = `${loc('tecton.element.calendar.hint.format')}: ${formatString}`;\n if (!input) {\n return { isValid, inputDate: new Date(''), isAvailable, messageType, message };\n }\n\n const inputDate = buildInputDate(input, assume);\n const month = inputDate.getMonth() + 1;\n const date = inputDate.getDate();\n const year = inputDate.getFullYear();\n const calendarPosition = [month, date, year];\n\n if (isValidDate(inputDate)) {\n const monthName = getMonths()[inputDate.getMonth()];\n\n if (input.length === 10) {\n isValid = true;\n messageType = null;\n message = null;\n }\n\n isAvailable = validDays.includes(inputDate.getDay());\n const isoString = formatDateISO(inputDate);\n\n if (isAvailable) {\n const isNotValidDate = validDates.length && !validDates.includes(isoString);\n const isInvalidDate = invalidDates.length && invalidDates.includes(isoString);\n const isBeforeStartDate = startDate && startDate > isoString;\n const isAfterEndDate = endDate && endDate < isoString;\n\n if (isNotValidDate || isInvalidDate || isBeforeStartDate || isAfterEndDate) {\n isAvailable = false;\n }\n }\n\n if (input.length >= 5 && !isAvailable) {\n isValid = false;\n messageType = 'error';\n const isInvalid = !monthName || !date || !year;\n message = isInvalid\n ? `${loc('tecton.element.calendar.hint.invalidDate')}: ${formatString}`\n : loc('tecton.element.calendar.hint.notAvailableDate', [formatDateLong(inputDate)]);\n }\n } else {\n isValid = false;\n messageType = 'error';\n message = `${loc('tecton.element.calendar.hint.invalidDate')}: ${formatString}`;\n }\n\n return {\n isValid,\n messageType,\n message,\n inputDate,\n isAvailable,\n calendarPosition,\n };\n}\n\nexport function buildInputDate(input: string, assume: string) {\n const now = new Date();\n // eslint-disable-next-line prefer-const\n let [month, day, year] = input.split('/');\n if (month === '0') month = '01';\n if (day === '0') day = '01';\n if (input.length === 10) {\n return new Date(input);\n } else if (month && day && Number(day) > 0) {\n const twoDigitDay = Number(day) < 10 ? `0${Number(day)}` : day;\n const fourDigitYear = !year || year.length < 4 ? assumeYear(month, day, assume) : year;\n return new Date(`${month}/${twoDigitDay}/${fourDigitYear}`);\n } else if (month) {\n return new Date(`${month}/01/${now.getFullYear()}`);\n }\n}\n\nfunction assumeYear(month: string, day: string, assume: string): string {\n const monthDay = `${month}/${day}`;\n const now = new Date();\n const mm: string = now.getMonth() < 9 ? `0${now.getMonth() + 1}` : `${now.getMonth() + 1}`;\n const dd: string = now.getDate() < 10 ? `0${now.getDate()}` : `${now.getDate()}`;\n const nowLocal = `${mm}/${dd}/${now.getFullYear()}`;\n let assumedYear = now.getFullYear();\n if (assume === 'future' && nowLocal.slice(0, 5) > monthDay) {\n assumedYear = now.getFullYear() + 1;\n } else if (assume === 'past' && nowLocal.slice(0, 5) < monthDay) {\n assumedYear = now.getFullYear() - 1;\n }\n return assumedYear.toString();\n}\n\nexport function handleMissingZeros(input): string {\n if (!input) {\n return '';\n }\n if (input.match(/^[1-9]\\/$/)) {\n return `0${input}/`;\n } else if (input.match(/^[0-9]{2}\\/[1-9]{1}\\/$/)) {\n const sp = input.split('/');\n return `${sp[0]}/0${sp[1]}/`;\n }\n return input;\n}\n\nexport function reorderDateString(input: string): string {\n const dateParts = (input || '').split('-');\n if (dateParts.length !== 3) return '';\n return `${dateParts[1]}/${dateParts[2]}/${dateParts[0]}`;\n}\n\nexport function firstDayOfWeekInMonth(month: number, year: number): number {\n return new Date(year, month, 1, 1, 1, 1, 1).getDay();\n}\n\nexport function getDays(): string[] {\n return [\n loc('tecton.element.calendar.days.short.Sunday'),\n loc('tecton.element.calendar.days.short.Monday'),\n loc('tecton.element.calendar.days.short.Tuesday'),\n loc('tecton.element.calendar.days.short.Wednesday'),\n loc('tecton.element.calendar.days.short.Thursday'),\n loc('tecton.element.calendar.days.short.Friday'),\n loc('tecton.element.calendar.days.short.Saturday'),\n ];\n}\n\nexport function getDaysOfWeek(): string[] {\n return [\n loc('tecton.element.calendar.days.Sunday'),\n loc('tecton.element.calendar.days.Monday'),\n loc('tecton.element.calendar.days.Tuesday'),\n loc('tecton.element.calendar.days.Wednesday'),\n loc('tecton.element.calendar.days.Thursday'),\n loc('tecton.element.calendar.days.Friday'),\n loc('tecton.element.calendar.days.Saturday'),\n ];\n}\n\nexport function getMonths(): string[] {\n return [\n loc('tecton.element.calendar.months.January'),\n loc('tecton.element.calendar.months.February'),\n loc('tecton.element.calendar.months.March'),\n loc('tecton.element.calendar.months.April'),\n loc('tecton.element.calendar.months.May'),\n loc('tecton.element.calendar.months.June'),\n loc('tecton.element.calendar.months.July'),\n loc('tecton.element.calendar.months.August'),\n loc('tecton.element.calendar.months.September'),\n loc('tecton.element.calendar.months.October'),\n loc('tecton.element.calendar.months.November'),\n loc('tecton.element.calendar.months.December'),\n ];\n}\n","import { firstDayOfWeekInMonth } from './q2-calendar-helpers';\nimport { getDaysInMonth, isSameDay, isBefore, isAfter, isValid as isValidDate } from 'date-fns';\nimport { CalendarDay, DateEmpty, Year, IDateValidators, ISelectedMonthYear } from './q2-calendar-types';\n\n// Validation Helpers\nexport type DateList = CalendarDay[];\nexport type IsValid = boolean;\nexport type IsActivityDate = boolean;\nexport type DateValidation = (date: Date) => IsValid;\n\nexport function generateDatesFromMonthYear(month: number, year: Year): Date[] {\n const daysInMonth = getDaysInMonth(new Date(year, month));\n\n return [...Array(daysInMonth).keys()].reduce((acc, stepIndex) => {\n acc.push(new Date(year, month, stepIndex + 1));\n return acc;\n }, []);\n}\n\nexport function getValidDaysOfWeek(checksum: number = 127): number[] {\n /* tslint:disable:no-bitwise */\n const sunValid = checksum & 1;\n const monValid = checksum & 2;\n const tuesValid = checksum & 4;\n const wedsValid = checksum & 8;\n const thursValid = checksum & 16;\n const friValid = checksum & 32;\n const satValid = checksum & 64;\n /* tslint:enable:no-bitwise */\n const ret = [];\n\n if (checksum <= 0) return ret;\n if (sunValid) ret.push(0);\n if (monValid) ret.push(1);\n if (tuesValid) ret.push(2);\n if (wedsValid) ret.push(3);\n if (thursValid) ret.push(4);\n if (friValid) ret.push(5);\n if (satValid) ret.push(6);\n\n return ret;\n}\n\nexport function validateAgainstChecksum(validDaysOfWeek: number[], newDate: Date): IsValid {\n return validDaysOfWeek.includes(newDate.getDay());\n}\n\nexport function validateAgainstBlacklist(invalidDates: Date[], newDate: Date): IsValid {\n return !validateAgainstWhitelist(invalidDates, newDate);\n}\n\nexport function validateAgainstWhitelist(validDates: Date[], newDate: Date): IsValid {\n return validDates.some(validDate => isSameDay(validDate, newDate));\n}\n\nexport function buildDates(\n validDaysOfWeek: number[],\n validDates: Date[],\n invalidDates: Date[],\n selectedMonthYear: ISelectedMonthYear,\n currentSelection: Date | undefined,\n dateValidators: IDateValidators,\n typedValue: string\n): DateList {\n const validationFns = [baseValidation.bind(null, dateValidators, new Date())];\n if (validDates?.length) {\n validationFns.push(validateAgainstWhitelist.bind(null, validDates));\n } else {\n validationFns.push(validateAgainstChecksum.bind(null, validDaysOfWeek));\n }\n validationFns.push(validateAgainstBlacklist.bind(null, invalidDates));\n\n return generateDateList(selectedMonthYear, currentSelection, dateValidators, validationFns, typedValue);\n}\n\nexport function generateDateList(\n { monthIndex, selectedYear }: ISelectedMonthYear,\n currentSelection: Date | undefined,\n dateValidators: IDateValidators,\n validationFns: DateValidation[],\n typedValue: string\n): DateList {\n const isIncompleteDate = !isValidDate(new Date(typedValue));\n const datesInMonth = generateDatesFromMonthYear(monthIndex, selectedYear).map((dayInMonth, dateIndex) => {\n const isInvalid = validationFns.some(fn => !fn(dayInMonth));\n const dayState = getDayState(dayInMonth, dateValidators, currentSelection);\n const classList = generateClassesForCalDay({\n ...dayState,\n isInvalid,\n isIncompleteDate,\n });\n\n return {\n ...dayState,\n isValid: !isInvalid,\n date: dayInMonth,\n integer: dateIndex + 1,\n isEmpty: false,\n isActivity: false,\n classList,\n };\n });\n\n const startOfMonthEmpties = addEmptiesMonthStart(firstDayOfWeekInMonth(monthIndex, selectedYear));\n const endOfMonthEmpties = addEmptiesMonthEnd((startOfMonthEmpties.length + datesInMonth.length) % 7);\n\n return [...startOfMonthEmpties, ...datesInMonth, ...endOfMonthEmpties] as CalendarDay[];\n}\n\nexport function baseValidation(dateValidators: IDateValidators, now: Date, newDate: Date): boolean {\n const isNewDateBeforeStartDate = isAfter(dateValidators?.startDate, newDate);\n const isNewDateAfterEndDate = isBefore(dateValidators?.endDate, newDate);\n const isNowAfterCutoffTime = isSameDay(now, newDate) && isAfter(now, dateValidators?.cutOffTime);\n\n return !(isNewDateBeforeStartDate || isNowAfterCutoffTime || isNewDateAfterEndDate);\n}\n\nexport function getDayState(dayInMonth: Date, dateValidators: IDateValidators, currentDate: Date | undefined) {\n if (!currentDate) currentDate = new Date();\n const isSelected = currentDate && isSameDay(currentDate, dayInMonth);\n const isToday = isSameDay(dayInMonth, new Date());\n const isStartDate = isSameDay(dayInMonth, dateValidators?.startDate);\n const isEndDate = isSameDay(dayInMonth, dateValidators?.endDate);\n\n return { isSelected, isToday, isStartDate, isEndDate };\n}\n\nexport function generateClassesForCalDay({\n isInvalid,\n isSelected,\n isEndDate,\n isStartDate,\n isToday,\n isIncompleteDate,\n}: {\n isInvalid: boolean;\n isSelected: boolean;\n isEndDate: boolean;\n isStartDate: boolean;\n isToday: boolean;\n isIncompleteDate: boolean;\n}): string {\n const classes = [];\n if (!isInvalid) classes.push('is-valid');\n if (isSelected) classes.push('is-selected');\n if (isEndDate) classes.push('is-end-date');\n if (isStartDate) classes.push('is-start-date');\n if (isToday) classes.push('is-today');\n if (isSelected && isInvalid && !isIncompleteDate) classes.push('is-unavailable');\n\n return classes.join(' ');\n}\n\nexport function addEmptiesMonthStart(monthStartDayOfWeek: number): DateEmpty[] {\n return addEmptyDates(0, monthStartDayOfWeek);\n}\n\nexport function addEmptiesMonthEnd(monthEndDayOfWeek: number): DateEmpty[] {\n if (monthEndDayOfWeek === 0) return [];\n return addEmptyDates(monthEndDayOfWeek, 7);\n}\n\nexport const emptyDate: DateEmpty = {\n date: null,\n integer: null,\n isActivity: false,\n isEmpty: true,\n isValid: false,\n isToday: false,\n isSelected: false,\n isStartDate: false,\n isEndDate: false,\n classList: '',\n};\n\nexport function addEmptyDates(from: number, to: number): DateEmpty[] {\n if (from === 7) from = 0;\n return [...Array(to - from).keys()].map(() => ({ ...emptyDate }) as DateEmpty);\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: block;\n}\n\n:host[hidden] {\n display: none;\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n\nq2-input {\n margin: 0;\n cursor: pointer;\n}\n\nq2-popover {\n --comp-min-tappable-size: 44px;\n --comp-table-border-spacing: 2px;\n --comp-min-tappable-size-and-spacing: calc(var(--comp-min-tappable-size) + var(--comp-table-border-spacing));\n --comp-popover-padding: #{var-list(var-prefixer(calendar-popover-padding), --app-scale-1x, 5px)};\n --comp-min-table-width: calc(var(--comp-min-tappable-size-and-spacing) * 7);\n --comp-table-container-border-spacing: calc(var(--comp-table-border-spacing) * 2);\n --comp-popover-total-padding: calc(var(--comp-popover-padding) * 2);\n\n --tct-popover-min-width: calc(\n var(--comp-min-table-width) + var(--comp-table-container-border-spacing) + var(--comp-popover-total-padding)\n );\n}\n\n.calendar-field-popup {\n padding: var(--comp-popover-padding);\n}\n\n.calendar-label {\n --comp-label-padding: #{var-list(\n --tct-calendar-label-padding,\n unquote('#{var-list(var-prefixer(calendar-label-vertical-padding), --tct-scale-2, --app-scale-2x, 10px)} 0')\n )};\n font-size: var-list(var-prefixer(calendar-label-font-size), 16px);\n flex: 1 1;\n flex-basis: calc(100% - var-list(--tct-btn-icon-width, 44px));\n margin: 0;\n padding: var(--comp-label-padding);\n}\n\n.cal-month-heading {\n padding: 0 0 0.75rem;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var-list(var-prefixer(calendar-month-font-size), 16px);\n font-weight: var-list(var-prefixer(calendar-month-font-weight), 600);\n text-align: center;\n}\n\n.cal-month-text {\n min-width: 82px;\n display: inline-block;\n}\n\n.cal-year-text {\n min-width: 50px;\n display: inline-block;\n}\n\ntable {\n width: 100%;\n margin-bottom: 2px;\n text-align: center;\n border-spacing: var(--comp-table-border-spacing);\n}\n\nth {\n font-size: var-list(var-prefixer(calendar-day-heading-font-size), inherit);\n font-weight: var-list(var-prefixer(calendar-day-heading-font-weight), 600);\n width: 14.285714%;\n}\n\ntd {\n height: var(--comp-min-tappable-size);\n cursor: pointer;\n border: var-list(var-prefixer(calendar-day-border), 0);\n border-radius: var-list(var-prefixer(calendar-day-border-radius));\n\n &.is-unavailable {\n border: 1px solid var-list(--tct-input-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n\n &.is-valid:hover {\n border: var-list(var-prefixer(calendar-day-hover-border), var-prefixer(calendar-day-border) 0);\n border-radius: var-list(\n var-prefixer(calendar-day-hover-border-radius),\n var-prefixer(calendar-day-border-radius)\n );\n\n background: var-list(\n --tct-calendar-day-hover-background,\n var-prefixer(calendar-day-hover-bg),\n --tct-gray-14,\n --app-gray14,\n --tct-gray-l4,\n --app-gray-l4,\n #f2f2f2\n );\n color: var-list(var-prefixer(calendar-day-hover-font-color), inherit);\n }\n\n &[aria-hidden],\n &[aria-disabled] {\n pointer-events: none;\n cursor: not-allowed;\n }\n\n &[aria-disabled] {\n opacity: var-list(var-prefixer(calendar-day-disabled-opacity), --app-disabled-opacity, 0.4);\n }\n\n &[aria-selected] {\n border: var-list(var-prefixer(calendar-day-selected-border), var-prefixer(calendar-day-border) 0);\n border-radius: var-list(\n var-prefixer(calendar-day-selected-border-radius),\n var-prefixer(calendar-day-border-radius)\n );\n background: var-list(\n --tct-calendar-day-selected-background,\n var-prefixer(calendar-day-selected-bg),\n --tct-calendar-day-hover-background,\n var-prefixer(calendar-day-hover-bg),\n var-prefixer(gray-14),\n --tct-gray-l4,\n --app-gray-l4,\n #f2f2f2\n );\n color: var-list(\n var-prefixer(calendar-day-selected-font-color),\n var-prefixer(calendar-day-hover-font-color),\n inherit\n );\n box-shadow: 0 0 0 2px\n var-list(\n var-prefixer(calendar-day-selected-outline-color),\n --tct-stoplight-info,\n --const-stoplight-info,\n #0079c1\n );\n }\n}\n\n.today-decorator {\n text-transform: uppercase;\n font-weight: 700;\n font-size: 10px;\n height: 12px;\n}\n\n.calendar-disclaimer {\n font-size: var-list(\n var-prefixer(calendar-disclaimer-font-size),\n --tct-font-size-small,\n --app-font-size-small,\n 12px\n );\n border-style: solid;\n border-width: var-list(var-prefixer(calendar-disclaimer-border-width), unquote('1px 0 0 0'));\n border-color: var-list(\n var-prefixer(calendar-disclaimer-border-color),\n var-prefixer(gray-13),\n --tct-gray-l3,\n --app-gray-l3,\n #e6e6e6\n );\n padding: var-list(--tct-calendar-disclaimer-padding, --tct-scale-2, --app-scale-2x, 10px);\n text-align: left;\n}\n","import {\n Component,\n ComponentInterface,\n Prop,\n Element,\n State,\n Event,\n EventEmitter,\n Listen,\n Watch,\n Method,\n h,\n} from '@stencil/core';\nimport { ISelectedMonthYear, CalendarDay, IDateValidators } from './q2-calendar-types';\nimport { addDays, isSameDay, format, isValid as isValidDate } from 'date-fns';\nimport {\n stringToDate,\n setupMonthYear,\n getMonths,\n getDays,\n getDaysOfWeek,\n stringArrayToDate,\n convertMomentFormat,\n validateInput,\n handleMissingZeros,\n formatDateISO,\n formatDateShort,\n IMomentLikeObject,\n removeTimezoneOffset,\n reorderDateString,\n formatDateFull,\n} from './q2-calendar-helpers';\nimport { buildDates, getValidDaysOfWeek, DateList } from './q2-calendar-validation';\nimport {\n handleAriaLabel,\n loc,\n overrideFocus,\n isEventFromElement,\n handleRenamedProp,\n waitForNextPaint,\n} from '../../utils';\nimport { IEventDetail } from '../q2-input/q2-input-types';\nimport { Q2InputCustomEvent } from 'src/components';\n\n@Component({ tag: 'q2-calendar', shadow: true, styleUrl: 'q2-calendar.scss' })\nexport class Q2Calendar implements ComponentInterface {\n /**\n * Detects the year automatically based on today's date when the user presses the `Escape` key or the `Blur` mouse event occurs.\n * Setting `future` or `past` as the value will increase or decrease the year by one, respectively.\n */\n @Prop({ reflect: true }) assume: 'current' | 'future' | 'past' = 'current';\n\n /** A label shown at the top of the popover date picker. */\n @Prop({ reflect: true }) calendarLabel: string;\n\n /** Display a button in the input field allowing the user to clear their selection. */\n @Prop({ reflect: true }) clearable: boolean;\n\n /**\n * Specifies a time of day after which a date is no longer valid.\n *\n * @warning\n * Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) cutoffTime: string;\n\n /**\n * The most concise way to define valid days of the week for calendar. Each day of the week has a checksum value:\n *\n * - Sunday = 1\n * - Monday = 2\n * - Tuesday = 4\n * - Wednesday = 8\n * - Thursday = 16\n * - Friday = 32\n * - Saturday = 64\n *\n * Add the checksum values of your desired valid days together, and set `daysOfWeekChecksum` to that summed value.\n *\n * **Example:**\n * @snippet\n * element.daysOfWeekChecksum = 127 // All days of the week are valid\n * element.daysOfWeekChecksum = 62; // Only weekdays are valid\n * element.daysOfWeekChecksum = 65; // Only Saturday and Sunday are valid\n *\n */\n @Prop({ reflect: true }) daysOfWeekChecksum: number;\n\n /** Disable the input field. */\n @Prop({ reflect: true }) disabled: boolean;\n\n /**\n * Text that displays as the placeholder when the field is marked `disabled`.\n * @localizable\n */\n @Prop({ reflect: true }) disabledMsg: string;\n\n /** Text that appears at the bottom of the popover date picker. */\n @Prop({ reflect: true }) disclaimer: string;\n\n /**\n * Determines the display format of the date field value.\n *\n * Must follow the [date-fns](https://date-fns.org/v2.28.0/docs/format) token specification.\n */\n @Prop({ reflect: true }) displayFormat: string;\n\n /**\n * Defines the last selectable date in the date picker popover.\n *\n * @warning\n * Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) endDate: string;\n\n /**\n * Each item in the `errors` array will appear below the input field when the field is focused and `typeable` is `true`.\n * @localizable\n */\n @Prop({ mutable: true }) errors: string[];\n\n /** Hide the input field's ` <label> ` element from view. */\n @Prop({ reflect: true, mutable: true }) hideLabel: boolean;\n\n /**\n * Each item in the `hints` array will appear below the input field when the field is focused and `typeable` is true.\n * @localizable\n */\n @Prop({ mutable: true }) hints: string[];\n\n /** Show error styles when the calendar is in an errant state. */\n @Prop({ reflect: true, mutable: true }) invalid: boolean;\n\n /**\n * Defines an explicit date blacklist.\n *\n * @warning\n * Must be a valid ISO date string.\n *\n * @info\n * When explicit date definitions like `invalidDates` is used, other date validity methods like `daysOfWeekChecksum` are overriden.\n */\n @Prop() invalidDates: string[];\n\n /** The visible label for the `q2-calendar` input field. */\n @Prop({ reflect: true, mutable: true }) label: string;\n\n /** Determine whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** Appends \"(optional)\" to the label and sets `aria-required=\"false\"`. */\n @Prop({ reflect: true }) optional: boolean;\n\n /**\n * Text that appears within the input field when it is blurred and empty.\n * Placeholder text disappears when the user focuses on the field and provides input.\n */\n @Prop({ reflect: true }) placeholder: string;\n\n /** Aligns the popover date picker to the left or right side of the input field. */\n @Prop() popoverAlignment: 'left' | 'right';\n\n /**\n * Force the direction of the popover date picker when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ mutable: true }) popoverDirection: 'up' | 'down';\n\n /** @deprecated */\n @Prop() popoverMinHeight: number = 355;\n\n /**\n * The field's content is not editable, but the field remains focusable.\n *\n * Appends \"(readonly)\" to the field label. Supersedes `optional` if both are `true`.\n */\n @Prop({ reflect: true }) readonly: boolean;\n\n /**\n * Defines the first selectabe date in the date picker popover.\n *\n * @warning\n * Must be a valid ISO date string.\n */\n @Prop({ reflect: true }) startDate: string;\n\n /** The user can type in the field. Only available in desktop browsers. */\n @Prop({ reflect: true }) typeable: boolean;\n\n /**\n * Defines an explicit date whitelist.\n *\n * @warning\n * Must be a valid ISO date string.\n *\n * @info\n * When explicit date definitions like `validDates` is used, other date validity methods like `daysOfWeekChecksum` are overriden.\n */\n @Prop() validDates: string[];\n\n /**\n * The value of the `q2-calendar` element, e.g. the selected date.\n *\n * **How to change or clear the value with javascript:**\n * @snippet\n * // change date\n * element.value = '2022-12-21';\n * // clear date\n * element.value = null;\n */\n @Prop({ mutable: true, reflect: true }) value: string | { toDate(): Date };\n\n /** @deprecated */\n @Prop({ reflect: true }) popDirection: 'up' | 'down';\n /** @deprecated */\n @Prop() onsuccess: (e: CustomEvent) => void;\n /** @deprecated */\n @Prop({ reflect: true }) buttonLabel: string;\n /** @deprecated */\n @Prop({ reflect: true, mutable: true }) ariaLabel: string;\n\n @Element() hostElement: HTMLElement;\n\n @State() keyboardSelection: boolean = false;\n @State() typedValue: string = '';\n @State() dateList: CalendarDay[];\n @State() hintMessage: string = this.defaultHintMessage;\n @State() hintMessageType: 'info' | 'error' = 'info';\n formatModifier: string = 'M/D/YYYY'; // To allow missing leading zero, 4/3/2021 => converts into 04/03/2021\n hintMessageElement: HTMLQ2MessageElement;\n controlElement: HTMLQ2InputElement;\n btnCalendarToggle: HTMLQ2BtnElement;\n calendarTable: HTMLTableElement;\n btnPrevMonth: HTMLQ2BtnElement;\n btnNextMonth: HTMLQ2BtnElement;\n btnPrevYear: HTMLQ2BtnElement;\n btnNextYear: HTMLQ2BtnElement;\n calendarBody: HTMLDivElement;\n defaultFormatString = 'mm/dd/yyyy';\n selectedMonthYear: ISelectedMonthYear;\n scheduledAfterRender: (() => void)[] = [];\n privatePopDirection: 'up' | 'down';\n popoverElement?: HTMLQ2PopoverElement;\n internalError: string = '';\n valueOnBlur: string | { toDate(): Date };\n\n connectedCallback() {\n this.selectedMonthYear = setupMonthYear(this.dateValue);\n this.dateList = this.buildDateList(this.selectedMonthYear);\n if (this.value && this.isTypeable && !this.typedValue) {\n this.typedValue = reorderDateString(this.value as string);\n }\n this.validateDate();\n }\n\n componentWillLoad() {\n this.popDirectionHandler();\n handleAriaLabel(this);\n }\n\n componentDidRender() {\n setTimeout(() => {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }, 25);\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n }\n\n dayAbbrStrings = getDays();\n dayStrings = getDaysOfWeek();\n monthStrings = getMonths();\n\n get selectedDate() {\n const selectedCell = this.calendarBody?.querySelector<HTMLTableCellElement>('[aria-selected=\"true\"]');\n return selectedCell ? removeTimezoneOffset(new Date(selectedCell.dataset.date)) : null;\n }\n\n get innerInputField(): HTMLInputElement | HTMLButtonElement {\n return this.controlElement?.shadowRoot?.querySelector('.input-field');\n }\n\n get innerInputContainer(): HTMLElement {\n return this.controlElement?.shadowRoot?.querySelector('.input-container');\n }\n\n get defaultHintMessage() {\n return this.typeable\n ? loc('tecton.element.calendar.hint.format') + ': ' + this.defaultFormatString\n : loc('tecton.element.calendar.hint.select');\n }\n\n get canClear() {\n if (this.isTypeable) {\n return this.clearable && !!this.typedValue;\n } else {\n return this.clearable && !!this.value;\n }\n }\n\n get currentWeeks() {\n const weeks = this.dateList.reduce<CalendarDay[][]>((accum, item, index) => {\n const chunkIndex = Math.floor(index / 7);\n\n if (!accum[chunkIndex]) {\n accum[chunkIndex] = [];\n }\n\n accum[chunkIndex].push(item);\n\n return accum;\n }, []);\n\n return weeks;\n }\n\n get formattedValue() {\n const { typedValue, dateValue, displayFormat, isTypeable } = this;\n if (isTypeable) return typedValue;\n\n if (dateValue === undefined) return '';\n if (displayFormat) return format(dateValue, convertMomentFormat(displayFormat));\n\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n }).format(dateValue);\n }\n\n get computedPlaceholder(): string {\n if (this.disabled && this.disabledMsg) {\n return loc(this.disabledMsg);\n }\n\n if (this.buttonLabel && (this.disabled || this.placeholder)) {\n return loc(this.buttonLabel);\n }\n\n return (this.placeholder && loc(this.placeholder)) || '';\n }\n\n get dateValue(): Date | undefined {\n if (this.isTypeable) {\n return stringToDate(this.typedValue);\n } else {\n let { value } = this;\n const isMoment = value && typeof value !== 'string' && 'toDate' in value;\n if (isMoment) return (value as IMomentLikeObject).toDate();\n\n // stringified moment value assigned in html template e.g.) handlebar\n const isMomentString =\n typeof value === 'string' && value.split(' ').length === 6 && /GMT-\\d{4}/g.test(value);\n if (isMomentString) {\n value = formatDateISO(value as string);\n }\n\n return stringToDate(value as string);\n }\n }\n\n get dateValidators(): IDateValidators {\n const ct = new Date(this.cutoffTime || ''); // should fallback to InvalidDate\n return {\n startDate: stringToDate(this.startDate),\n endDate: stringToDate(this.endDate),\n cutOffTime: isValidDate(ct) ? ct : undefined,\n };\n }\n\n get isTypeable(): boolean {\n return this.typeable;\n }\n\n get errorList() {\n const { errors, internalError, invalid } = this;\n let list = [];\n if (internalError) {\n list = [internalError];\n }\n if (Array.isArray(errors) && errors.length) {\n list = errors\n .filter(error => !!error)\n .map(error => loc(error))\n .concat(list);\n } else if (!internalError && invalid) {\n return ['tecton.element.calendar.invalid'];\n }\n return list;\n }\n\n get hintList() {\n const { hints, hintMessageType, hintMessage } = this;\n if (Array.isArray(hints) && hints.length) return hints.filter(hint => !!hint).map(hint => loc(hint));\n if (hintMessageType === 'info' && hintMessage) return [hintMessage];\n return [];\n }\n\n //////// Host Element Events ////////\n @Listen('change')\n defaultChangeHandler(event: CustomEvent) {\n if (event.target === this.hostElement && !this.hostElement.onchange && !!event.detail) {\n this.value = event.detail.value;\n }\n }\n\n @Listen('error')\n defaultErrorHandler(event: CustomEvent) {\n if (event.target === this.hostElement && !this.hostElement.onerror) {\n if (this.hintMessageType === 'error' && this.hintMessage) {\n this.internalError = this.hintMessage;\n } else {\n this.internalError = loc('tecton.element.calendar.hint.invalidDate');\n }\n }\n }\n\n @Listen('success')\n defaultSuccessHandler(event: CustomEvent) {\n if (event.target !== this.hostElement) {\n return;\n }\n\n if (typeof this.onsuccess === 'function') {\n this.onsuccess(event);\n } else {\n this.internalError = '';\n if (this.hintMessageType === 'error' && this.hintMessage) {\n this.hintMessage = null;\n this.hintMessageType = null;\n this.invalid = false;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.controlElement.shadowRoot.querySelector<HTMLElement>('.input-field').focus();\n }\n\n @Listen('clear')\n handleClear() {\n this.change.emit({ value: null });\n this.value = null;\n this.typedValue = '';\n }\n\n @Listen('popoverStateChanged')\n popoverStateHandler({ detail: { open } }: CustomEvent<{ open: boolean }>) {\n if (this.open !== open) this.open = open;\n }\n\n /// Methods ///\n _togglePopover() {\n const toggleElement = this.typeable ? this.btnCalendarToggle : this.innerInputField;\n toggleElement?.click();\n toggleElement?.focus();\n toggleElement.dispatchEvent(new FocusEvent('focus'));\n }\n\n /**\n * Emulates clicking the `<input>` to display the popover if it is hidden.\n *\n * @testOnly\n */\n @Method()\n async openPopover() {\n if (this.open) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<input>` to hide the popover if it is visible.\n *\n * @testOnly\n */\n @Method()\n async closePopover() {\n if (!this.open) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<input>` to display the popover, moving to the correct month and year, and clicking the\n * provided date.\n *\n * While a `string` value can be passed, we recommended passing a `Date` object. If the value is invalid, the method\n * will not select the date.\n *\n * @testOnly\n */\n @Method()\n async setValue(value: string | Date) {\n const date = typeof value === 'string' ? stringToDate(value) : value;\n if (!isValidDate(date)) return;\n\n await this.openPopover();\n await waitForNextPaint();\n\n this.goToMonthYear(date.getMonth(), date.getFullYear());\n await waitForNextPaint();\n const tableCell = this.calendarTable?.querySelector<HTMLTableCellElement>(\n `td[data-date=\"${formatDateISO(date)}\"]`\n );\n tableCell?.click();\n }\n\n /**\n * Emulates focusing the `<input>`, entering the provided value, and emitting an `input` event.\n *\n * While a `string` value can be passed, we recommended passing a `Date` object. If the value is invalid, the method\n * will not select the date.\n *\n * @warning\n * Only applicable when the input is typeable.\n *\n * @testOnly\n */\n @Method()\n async typeValue(value: string | Date) {\n if (!this.typeable) return;\n\n const date = typeof value === 'string' ? stringToDate(value) : value;\n const formattedDate = formatDateShort(date);\n if (!isValidDate(date)) return;\n\n const { innerInputField, controlElement } = this;\n innerInputField.focus();\n innerInputField.dispatchEvent(new FocusEvent('focus'));\n innerInputField.value = formattedDate;\n innerInputField.dispatchEvent(new InputEvent('input'));\n controlElement.dispatchEvent(new KeyboardEvent('keyup'));\n }\n\n //////// Observers //////////\n @Watch('popDirection')\n popDirectionHandler() {\n handleRenamedProp(this, 'popDirection', 'popoverDirection');\n }\n\n @Watch('ariaLabel')\n ariaLabelObserver() {\n handleAriaLabel(this);\n }\n\n @Watch('typeable')\n typeableChanged() {\n this.valueObserver(this.value);\n }\n\n @Watch('value')\n valueObserver(newValue: string | IMomentLikeObject) {\n // resetting by empty string\n if (newValue === '') {\n this.value = undefined;\n this.setHints({ isValid: true, message: this.defaultHintMessage, messageType: 'info' });\n return;\n }\n const isMoment = newValue && typeof newValue !== 'string' && 'toDate' in newValue;\n const newDate = isMoment ? (newValue as IMomentLikeObject).toDate() : stringToDate(newValue as string);\n const shortFormattedValue = formatDateShort(newDate);\n if (this.isTypeable) {\n this.typedValue = shortFormattedValue;\n } else {\n this.controlElement.value = shortFormattedValue;\n this.selectedMonthYear = setupMonthYear(newDate);\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n // reset hint when value is cleared\n if (this.invalid) return;\n\n if (shortFormattedValue) {\n this.setHints({\n isValid: true,\n message: null,\n messageType: null,\n });\n } else {\n this.setHints({ isValid: true, message: this.defaultHintMessage, messageType: 'info' });\n }\n }\n\n @Watch('daysOfWeekChecksum')\n daysOfWeekChecksumObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n @Watch('validDates')\n validDatesObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n @Watch('invalidDates')\n invalidDatesObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n @Watch('startDate')\n startDateObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n @Watch('endDate')\n endDateObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n @Watch('cutoffTime')\n cutoffTimeObserver() {\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n\n ///////// Event /////////\n /**\n * Emitted when a date is selected or typed in the input field.\n * @legacyEvent\n */\n @Event() change: EventEmitter<{\n // ISO formatted date\n value: string | null;\n }>;\n\n /**\n * Emitted when an invalid date is entered into the field.\n */\n @Event() error: EventEmitter<{ errors: { message: string; errorCode: string }[] }>;\n\n /**\n * Emitted when a valid date is entered or selected.\n */\n @Event() success: EventEmitter<{\n // ISO formatted date\n value: string;\n }>;\n\n ///// Actions ////////\n\n buildDateList(monthYear: ISelectedMonthYear): DateList {\n const invalidDates = stringArrayToDate(this.invalidDates);\n const validDaysOfWeek = getValidDaysOfWeek(this.daysOfWeekChecksum);\n const validDates = stringArrayToDate(this.validDates);\n return buildDates(\n validDaysOfWeek,\n validDates,\n invalidDates,\n monthYear,\n this.dateValue,\n this.dateValidators,\n this.typedValue\n );\n }\n\n validateDate() {\n try {\n if (!!this.value) {\n const { dateValue } = this;\n const month = dateValue?.getMonth() ?? undefined;\n const year = dateValue?.getFullYear() ?? undefined;\n const { monthIndex, selectedYear } = this.selectedMonthYear;\n\n const isSelectedMonthAndYear = month === monthIndex && year === selectedYear;\n let calculationDateList = [];\n\n if (!dateValue) {\n calculationDateList = [];\n } else if (isSelectedMonthAndYear) {\n calculationDateList = this.dateList;\n } else {\n calculationDateList = this.buildDateList({\n monthIndex: month,\n selectedYear: year,\n });\n }\n\n const dateValueDayOfMonth = dateValue?.getDate() ?? undefined;\n const isDateValueInvalid = dateValueDayOfMonth\n ? !calculationDateList.find(({ integer }) => integer === dateValueDayOfMonth).isValid\n : true;\n if (isDateValueInvalid) {\n this.error.emit({\n errors: [\n {\n message: `Value passed is invalid: The date ${this.value} is not valid`,\n errorCode: 'generalInvalid',\n },\n ],\n });\n } else {\n this.success.emit({ value: formatDateISO(dateValue) });\n }\n }\n } catch (error) {\n console.warn('Invalid moment value ', this.dateValue);\n }\n }\n\n focusInput() {\n this.controlElement?.focus();\n }\n\n closeCalendar = () => {\n if (!this.open) return;\n this.open = false;\n this.focusInput();\n };\n\n openCalendar = () => {\n if (this.readonly || this.open) return;\n this.selectedMonthYear = setupMonthYear(this.dateValue);\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.open = true;\n };\n\n toggleCalendar = () => {\n if (this.readonly) return;\n if (this.open) {\n this.closeCalendar();\n } else {\n this.openCalendar();\n }\n };\n\n onClickElsewhere = (event: CustomEvent) => {\n const target = event.target as HTMLClickElsewhereElement;\n if (target.localName === 'click-elsewhere') {\n event.stopPropagation();\n this.closeCalendar();\n }\n };\n\n onPopupKeyup = (event: KeyboardEvent) => {\n if (event.key === 'Escape' || event.key === 'Esc') {\n this.onInputBlur();\n this.closeCalendar();\n }\n };\n\n onInputInput = ({ detail: { value } }: Q2InputCustomEvent<IEventDetail> & InputEvent) => {\n this.typedValue = value;\n };\n\n onInputKeydown = (event: KeyboardEvent) => {\n const { dateValue } = this;\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.openCalendar();\n this.activateDay(dateValue || new Date());\n break;\n }\n };\n\n onInputKeyup = (event: KeyboardEvent) => {\n if (this.disabled) {\n return;\n }\n\n switch (event.key) {\n case 'Escape':\n this.onInputBlur();\n this.closeCalendar();\n break;\n }\n\n if (!this.isTypeable) return;\n\n // handle missing zero in month and date\n this.typedValue = handleMissingZeros(this.typedValue);\n const { typedValue } = this;\n const validDays = getValidDaysOfWeek(this.daysOfWeekChecksum);\n const { isValid, message, messageType, inputDate, isAvailable, calendarPosition } = validateInput(\n typedValue,\n validDays,\n this.validDates,\n this.invalidDates,\n this.startDate,\n this.endDate,\n this.defaultFormatString,\n this.assume\n );\n\n if (calendarPosition) {\n const [mm, dd, yyyy] = calendarPosition;\n const date = new Date(yyyy, mm - 1, dd);\n if (isValidDate(date)) {\n this.selectedMonthYear = setupMonthYear(date);\n this.dateList = this.buildDateList(this.selectedMonthYear);\n this.validateDate();\n }\n }\n\n if (event.key === 'Enter') {\n if (\n isValid ||\n (typedValue &&\n typedValue.length > 4 && // at least mm/dd provided\n inputDate &&\n isValidDate(inputDate) &&\n isAvailable)\n ) {\n this.setCompleteInput(inputDate);\n } else if (this.value) {\n this.value = null;\n this.change.emit({ value: null });\n this.typedValue = typedValue;\n }\n\n if (this.keyboardSelection) {\n this.keyboardSelection = false;\n this.closeCalendar();\n } else {\n this.toggleCalendar();\n }\n } else {\n this.setHints({ isValid, message, messageType });\n }\n };\n\n onInputChange = (event: Event) => {\n event.stopPropagation();\n };\n\n onInputBlur = () => {\n if (!this.isTypeable) return;\n\n const validDays = getValidDaysOfWeek(this.daysOfWeekChecksum);\n const { typedValue } = this;\n const { isValid, inputDate, isAvailable } = validateInput(\n this.typedValue,\n validDays,\n this.validDates,\n this.invalidDates,\n this.startDate,\n this.endDate,\n this.defaultFormatString,\n this.assume\n );\n\n if (!typedValue && inputDate?.toString() === 'Invalid Date') {\n // initial/clear state\n this.setHints({ isValid: true, message: this.defaultHintMessage, messageType: 'info' });\n } else if (\n isValid ||\n (typedValue &&\n typedValue.length > 4 && // at least mm/dd provided\n inputDate &&\n isValidDate(inputDate) &&\n isAvailable)\n ) {\n this.setCompleteInput(inputDate);\n } else if (this.value) {\n this.valueOnBlur = this.value;\n this.value = null;\n this.change.emit({ value: null });\n this.typedValue = typedValue;\n }\n };\n\n onInputFocus = (event: FocusEvent) => {\n if (!this.isTypeable) return;\n if (event.target === this.controlElement) {\n if (this.valueOnBlur && !this.value) {\n const tmpTypedValue = this.typedValue;\n this.value = this.valueOnBlur;\n this.typedValue = tmpTypedValue;\n this.valueOnBlur = null;\n }\n this.closeCalendar();\n }\n };\n\n onInputClick = () => {\n if (this.disabled) return;\n this.toggleCalendar();\n };\n\n onRefocus = () => {\n this.btnPrevMonth?.dispatchEvent(new FocusEvent('focus'));\n };\n\n goToMonthYear = (monthIndex: number, year: number) => {\n if (monthIndex < 0) {\n monthIndex = 11;\n year--;\n } else if (monthIndex > 11) {\n monthIndex = 0;\n year++;\n }\n this.selectedMonthYear = {\n monthIndex,\n selectedYear: year,\n };\n this.dateList = this.buildDateList(this.selectedMonthYear);\n\n this.scheduledAfterRender.push(() => this.checkActiveCellForBlankness());\n };\n\n checkActiveCellForBlankness() {\n const activeElement = this.hostElement.shadowRoot.activeElement;\n if (!activeElement || activeElement.tagName !== 'TD' || !activeElement.hasAttribute('aria-hidden')) return;\n\n const { calendarBody } = this;\n const calendarCells = Array.from(calendarBody.querySelectorAll<Element>('td'));\n const indexOfCell = Array.from(calendarCells).indexOf(activeElement);\n\n const dayToFocus =\n indexOfCell < 15 ? 1 : calendarCells.filter(cell => !cell.hasAttribute('aria-hidden')).length;\n\n this.focusDay(this.generateDateFromDay(dayToFocus));\n }\n\n selectDate = (newDate: Date) => {\n const { isValid } = this.dateList.find(({ date }) => isSameDay(date, newDate));\n if (!isValid) return;\n this.change.emit({ value: formatDateISO(newDate) });\n this.typedValue = formatDateShort(newDate);\n this.invalid = false;\n };\n\n onDateSelection = (event: MouseEvent) => {\n const dateCell = (event.target as HTMLElement).closest<HTMLElement>('td:not([aria-hidden])');\n if (!dateCell) return;\n const clickedDate = removeTimezoneOffset(new Date(dateCell.dataset.date));\n this.selectDate(clickedDate);\n this.closeCalendar();\n };\n\n generateDateFromDay(day: number) {\n const { monthIndex, selectedYear } = this.selectedMonthYear;\n return new Date(selectedYear, monthIndex, day);\n }\n\n onHeaderControlKeydown = (event: KeyboardEvent) => {\n const currentDate = this.generateDateFromDay(1);\n const hasSelectedCell = this.calendarBody?.querySelector<HTMLTableCellElement>('[aria-selected=\"true\"]');\n\n if (event.key === 'Tab' && !hasSelectedCell) {\n event.preventDefault();\n this.activateDay(currentDate);\n }\n };\n\n onDateKeydown = (event: KeyboardEvent) => {\n const { monthIndex, selectedYear } = this.selectedMonthYear;\n const currentDay = parseInt((event.target as HTMLElement).dataset.day);\n const currentDate = this.generateDateFromDay(currentDay);\n\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n this.activateDay(addDays(currentDate, -7));\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n this.activateDay(addDays(currentDate, 7));\n break;\n\n case 'ArrowRight':\n event.preventDefault();\n this.activateDay(addDays(currentDate, 1));\n break;\n\n case 'ArrowLeft':\n event.preventDefault();\n this.activateDay(addDays(currentDate, -1));\n break;\n\n case 'PageUp':\n event.preventDefault();\n if (event.shiftKey) this.goToMonthYear(monthIndex, selectedYear - 1);\n else this.goToMonthYear(monthIndex - 1, selectedYear);\n break;\n\n case 'PageDown':\n event.preventDefault();\n if (event.shiftKey) this.goToMonthYear(monthIndex, selectedYear + 1);\n else this.goToMonthYear(monthIndex + 1, selectedYear);\n break;\n\n case 'Home':\n event.preventDefault();\n this.activateDay(addDays(currentDate, -currentDate.getDay()));\n break;\n\n case 'End':\n event.preventDefault();\n this.activateDay(addDays(currentDate, 6 - currentDate.getDay()));\n break;\n\n case 'Escape':\n event.preventDefault();\n this.closeCalendar();\n this.focusInput();\n break;\n\n case 'Enter':\n event.preventDefault();\n if (!this.dateList.find(({ date }) => isSameDay(date, currentDate)).isValid) return;\n this.selectDate(currentDate);\n this.closeCalendar();\n this.focusInput();\n break;\n\n case ' ':\n event.preventDefault();\n if (!this.dateList.find(({ date }) => isSameDay(date, currentDate)).isValid) return;\n this.selectDate(currentDate);\n this.focusInput();\n break;\n }\n };\n\n activateDay(date: Date) {\n this.goToMonthYear(date.getMonth(), date.getFullYear());\n this.scheduledAfterRender.push(() => this.focusDay(date));\n }\n\n async focusDay(date: Date) {\n if (!date) return;\n await waitForNextPaint();\n this.calendarBody.querySelector<HTMLElement>(`td[data-day=\"${date.getDate()}\"]`)?.focus();\n }\n\n render() {\n return (\n <click-elsewhere\n class={this.open ? 'dropdown-open' : undefined}\n onChange={this.onClickElsewhere}\n >\n {this.inputField()}\n <q2-popover\n ref={el => (this.popoverElement = el)}\n controlElement={this.innerInputContainer}\n open={this.open}\n direction={this.popoverDirection}\n minHeight={this.popoverMinHeight}\n align={this.popoverAlignment}\n block\n >\n {this.hintField()}\n {this.calendarPopover()}\n </q2-popover>\n </click-elsewhere>\n );\n }\n\n hintField() {\n if (!this.hintMessage) return;\n\n return (\n <q2-message\n class=\"calendar-hint sr\"\n ref={el => (this.hintMessageElement = el)}\n type={this.hintMessageType}\n >\n {this.hintMessage}\n </q2-message>\n );\n }\n\n setHints({ isValid, message, messageType }) {\n if (message === this.hintMessage) return this.hintMessageElement?.present();\n this.invalid = !isValid;\n this.hintMessage = message;\n this.hintMessageType = messageType;\n if (messageType === 'error' && message) {\n this.internalError = message;\n this.error.emit({\n errors: [\n {\n message,\n errorCode: 'generalInvalid',\n },\n ],\n });\n }\n }\n\n setCompleteInput(inputDate: Date) {\n const formattedDate = formatDateShort(inputDate);\n this.change.emit({ value: formatDateISO(inputDate) });\n this.typedValue = formattedDate;\n this.internalError = null;\n this.setHints({\n isValid: true,\n message: null,\n messageType: null,\n });\n }\n\n inputField() {\n const { isTypeable } = this;\n return (\n <q2-input\n ref={el => (this.controlElement = el)}\n class=\"calendar-input-field\"\n value={this.formattedValue}\n label={loc(this.label)}\n hideLabel={this.hideLabel}\n disabled={!!this.disabled}\n readonly={!!this.readonly}\n clearable={this.canClear}\n placeholder={this.computedPlaceholder}\n optional={!!this.optional}\n ariaExpanded={`${!!this.open}`}\n hints={this.hintList}\n errors={this.errorList}\n onClick={isTypeable ? undefined : this.onInputClick}\n onChange={this.onInputChange}\n onInput={this.onInputInput}\n onKeyDown={this.onInputKeydown}\n onKeyUp={this.onInputKeyup}\n onBlur={this.onInputBlur}\n onFocus={this.onInputFocus}\n icon-right={isTypeable ? undefined : 'calendar'}\n format-modifier={isTypeable ? this.formatModifier : this.displayFormat || this.formatModifier}\n pseudo={!isTypeable}\n type=\"date\"\n hide-messages={!isTypeable}\n test-id=\"inputAndCalendarToggle\"\n >\n {isTypeable && (\n <q2-btn\n ref={el => (this.btnCalendarToggle = el)}\n slot=\"input-right\"\n onClick={this.onInputClick}\n test-id=\"calendarToggle\"\n label=\"tecton.element.calendar.toggleAriaLabel\"\n hide-label\n >\n <q2-icon type=\"calendar\" />\n </q2-btn>\n )}\n </q2-input>\n );\n }\n\n calendarPopover() {\n const { monthIndex, selectedYear } = this.selectedMonthYear;\n return (\n <div\n class=\"calendar-field-popup\"\n onKeyUp={this.onPopupKeyup}\n >\n {this.calendarLabel && <p class=\"calendar-label\">{loc(this.calendarLabel)}</p>}\n <div class=\"cal-month-heading\">\n <q2-btn\n label={loc('tecton.element.calendar.previousMonth')}\n hide-label\n ref={elm => (this.btnPrevMonth = elm)}\n class=\"cal-nav-btn prev-month\"\n test-id=\"previousMonthButton\"\n onClick={() => this.goToMonthYear(monthIndex - 1, selectedYear)}\n >\n <q2-icon type=\"chevron-left\" />\n </q2-btn>\n <span class=\"cal-month-text\">{this.monthStrings[monthIndex]}</span>\n <q2-btn\n label={loc('tecton.element.calendar.nextMonth')}\n hide-label\n class=\"cal-nav-btn next-month\"\n ref={elm => (this.btnNextMonth = elm)}\n test-id=\"nextMonthButton\"\n onClick={() => this.goToMonthYear(monthIndex + 1, selectedYear)}\n >\n <q2-icon type=\"chevron-right\" />\n </q2-btn>\n <q2-btn\n label={loc('tecton.element.calendar.previousYear')}\n hide-label\n class=\"cal-nav-btn prev-year\"\n ref={elm => (this.btnPrevYear = elm)}\n test-id=\"previousYearButton\"\n onClick={() => this.goToMonthYear(monthIndex, selectedYear - 1)}\n >\n <q2-icon type=\"chevron-left\" />\n </q2-btn>\n <span class=\"cal-year-text\">{this.selectedMonthYear.selectedYear}</span>\n <q2-btn\n label={loc('tecton.element.calendar.nextYear')}\n hide-label\n class=\"cal-nav-btn next-year\"\n ref={elm => (this.btnNextYear = elm)}\n test-id=\"nextYearButton\"\n onClick={() => this.goToMonthYear(monthIndex, selectedYear + 1)}\n onKeyDown={this.onHeaderControlKeydown}\n >\n <q2-icon type=\"chevron-right\" />\n </q2-btn>\n </div>\n <div\n class=\"sr\"\n aria-live=\"polite\"\n id=\"table-label\"\n >\n {`${this.monthStrings[monthIndex]} ${selectedYear}`}\n </div>\n {this.calendarDays()}\n {this.disclaimer && <div class=\"calendar-disclaimer\">{loc(this.disclaimer)}</div>}\n <q2-btn\n class=\"sr refocus-popup\"\n onFocus={this.onRefocus}\n />\n </div>\n );\n }\n\n calendarDays() {\n return (\n <table\n role=\"grid\"\n aria-labelledby=\"table-label\"\n ref={ref => (this.calendarTable = ref)}\n >\n <thead>\n <tr>\n {[...Array(7).keys()].map(index => (\n <th\n scope=\"col\"\n aria-label={this.dayStrings[index]}\n >\n {this.dayAbbrStrings[index]}\n </th>\n ))}\n </tr>\n </thead>\n <tbody\n onClick={this.onDateSelection}\n onKeyDown={this.onDateKeydown}\n ref={elm => (this.calendarBody = elm)}\n test-id=\"calendarTableBody\"\n >\n {this.currentWeeks.map(week => (\n <tr>\n {week.map(day => {\n let ariaLabel = '';\n if (day.isToday) ariaLabel = `${loc('tecton.element.calendar.today')}, `;\n ariaLabel += formatDateFull(day.date);\n if (day.isSelected) ariaLabel += ` (${loc('tecton.element.calendar.selected')})`;\n return (\n <td\n class={day.classList}\n aria-hidden={day.isEmpty ? 'true' : undefined}\n tabindex={day.isSelected ? 0 : -1}\n role={day.isSelected ? 'gridcell' : undefined}\n aria-selected={day.isSelected ? 'true' : undefined}\n aria-disabled={day.isValid ? undefined : 'true'}\n data-day={day.integer || undefined}\n data-date={day.date ? formatDateISO(day.date) : undefined}\n >\n {day?.isToday && (\n <div\n class=\"today-decorator\"\n aria-hidden=\"true\"\n >\n {loc('tecton.element.calendar.today')}\n </div>\n )}\n <div aria-label={ariaLabel}>{day?.integer ?? ''}</div>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n}\n"],"mappings":"6KAQgBA,EAAcC,GAC1B,MAAMC,EAAO,IAAIC,KAAKF,GACtB,IAAKG,UAAYF,GAAO,OAExB,OAAOG,YAAUH,EAAM,CAAEI,eAAgB,QAC7C,CAEA,IAAIC,E,SACYC,EAAgBP,GAC5B,MAAMC,EAAO,IAAIC,KAAKF,GACtB,IAAKG,UAAYF,GAAO,OAExB,MAAMO,EAAUP,EAAKQ,cACrB,IAAKH,EAAyB,CAC1BA,EAA0B,IAAII,KAAKC,eAAe,QAAS,CACvDC,MAAO,UACPC,IAAK,UACLC,KAAM,UACNC,SAAUL,KAAKC,iBAAiBK,kBAAkBD,U,CAI1D,OAAOT,EAAwBW,OAAO,IAAIf,KAAKM,GACnD,CAEA,IAAIU,E,SACYC,EAAenB,GAC3B,MAAMC,EAAO,IAAIC,KAAKF,GACtB,IAAKG,UAAYF,GAAO,OACxB,IAAKiB,EAAwB,CACzBA,EAAyB,IAAIR,KAAKC,eAAe,QAAS,CACtDC,MAAO,QACPC,IAAK,UACLC,KAAM,W,CAId,OAAOI,EAAuBD,O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SACIuB,QAAS1M,KAAK0D,gBACdkJ,UAAW5M,KAAKoE,cAChBmH,IAAK4B,GAAQnN,KAAKkE,aAAeiJ,EAAI,UAC7B,qBAEPnN,KAAK2F,aAAanP,KAAIoX,GACnBzC,EAAA,UACKyC,EAAKpX,KAAInB,I,MACN,IAAIwY,EAAY,GAChB,GAAIxY,EAAI6J,QAAS2O,EAAY,GAAGxU,EAAI,qCACpCwU,GAAahY,EAAeR,EAAIZ,MAChC,GAAIY,EAAI4J,WAAY4O,GAAa,KAAKxU,EAAI,uCAC1C,OACI8R,EAAA,MACIC,MAAO/V,EAAI0I,UAAS,cACP1I,EAAI+I,QAAU,OAAShI,UACpC0X,SAAUzY,EAAI4J,WAAa,GAAK,EAChCyO,KAAMrY,EAAI4J,WAAa,WAAa7I,UAAS,gBAC9Bf,EAAI4J,WAAa,OAAS7I,UAAS,gBACnCf,EAAI4D,QAAU7C,UAAY,OAAM,WACrCf,EAAI8I,SAAW/H,UAAS,YACvBf,EAAIZ,KAAOF,EAAcc,EAAIZ,MAAQ2B,YAE/Cf,IAAG,MAAHA,SAAG,SAAHA,EAAK6J,UACFiM,EAAA,OACIC,MAAM,kBAAiB,cACX,QAEX/R,EAAI,kCAGb8R,EAAA,oBAAiB0C,IAAY5K,EAAA5N,IAAG,MAAHA,SAAG,SAAHA,EAAK8I,WAAO,MAAA8E,SAAA,EAAAA,EAAI,IAC5C,Q"}
@@ -1,2 +1,2 @@
1
- import{r,h as t,g as a,F as e}from"./p-a5f18e27.js";const o="*{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-block}.badge-wrapper{--comp-badge-background:var(--tct-badge-background, var(--t-gray8, #61c4ff));--comp-badge-color:var(--tct-badge-color, var(--t-base, #ffffff));--comp-badge-border-style:var(--tct-badge-border-style, solid);--comp-badge-border-color:var(--tct-badge-border-color, var(--t-secondary-l1, #9a9898))}:host([status=info]) .badge-wrapper{--comp-badge-background:var(--tct-badge-info-background, var(--const-stoplight-info, #0079c1));--comp-badge-color:var(--tct-badge-info-color, var(--const-stoplight-info-text, #ffffff));--comp-badge-border-color:var(--tct-badge-info-border-color, var(--const-stoplight-info-l1, #3a9bd6))}:host([status=alert]) .badge-wrapper{--comp-badge-background:var(--tct-badge-alert-background, var(--const-stoplight-alert, #d20a0a));--comp-badge-color:var(--tct-badge-alert-color, var(--const-stoplight-alert-text, #ffffff));--comp-badge-border-color:var(--tct-badge-alert-border-color, var(--const-stoplight-alert-l1, #e42929))}:host([status=warning]) .badge-wrapper{--comp-badge-background:var(--tct-badge-warning-background, var(--const-stoplight-warning, #c35500));--comp-badge-color:var(--tct-badge-warning-color, var(--const-stoplight-warning-text, #423535));--comp-badge-border-color:var(--tct-badge-warning-border-color, var(--const-stoplight-warning-l1, #f9ce4c))}:host([status=success]) .badge-wrapper{--comp-badge-background:var(--tct-badge-success-background, var(--const-stoplight-success, #57fc45));--comp-badge-color:var(--tct-badge-success-color, var(--const-stoplight-success-text, #ffffff));--comp-badge-border-color:var(--tct-badge-success-border-color, var(--const-stoplight-success-l1, #2eaa21))}:host([theme=primary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-primary-background, var(--t-primary, #0079c2));--comp-badge-color:var(--tct-badge-primary-color, var(--t-primary-text, #ffffff));--comp-badge-border-color:var(--tct-badge-primary-border-color, var(--t-primary-l1, #3a9bd6))}:host([theme=secondary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-secondary-background, var(--t-secondary, #b4c2cd));--comp-badge-color:var(--tct-badge-secondary-color, var(--t-secondary-text, #ffffff));--comp-badge-border-color:var(--tct-badge-secondary-border-color, var(--t-secondary-l1, #c6d1db))}:host([theme=tertiary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-tertiary-background, var(--t-tertiary, #e9f5fc));--comp-badge-color:var(--tct-badge-tertiary-color, var(--t-tertiary-text, #000000));--comp-badge-border-color:var(--tct-badge-tertiary-border-color, var(--t-tertiary-l1, #f3f4f5))}.badge{font-size:var(--tct-badge-font-size, 10px);line-height:var(--tct-badge-line-height, 14px);height:var(--tct-badge-height, 16px);min-width:var(--tct-badge-min-width, 16px);text-align:center;padding:var(--tct-badge-padding, 0 4px);color:var(--comp-badge-color);background:var(--comp-badge-background);border-style:var(--comp-badge-border-style);border-color:var(--comp-badge-border-color);border-width:var(--tct-badge-border-width, var(--t-badge-border-width, 1px));border-radius:var(--tct-badge-border-radius, var(--t-badge-border-radius, 8px))}.badge.size-large{font-size:var(--tct-badge-large-font-size, 14px);line-height:var(--tct-badge-large-line-height, 20px);height:var(--tct-badge-large-height, 22px);min-width:var(--tct-badge-large-min-width, 22px);border-radius:var(--tct-badge-large-border-radius, 11px);padding:var(--tct-badge-large-padding, 0 6px)}.badge-wrapper{display:flex;align-items:center;justify-content:center}";const d=o;const c=class{constructor(t){r(this,t);this.maxLength=undefined;this.size=undefined;this.status=undefined;this.theme=undefined;this.value=0}get badgeText(){if(this.hostElement.textContent.trim())return this.hostElement.textContent.trim();const r=Math.pow(10,this.maxLength||2)-1;let t=this.value||0;if(isNaN(t)||t<=0){t=""}else if(t<=r){t=Number(t).toLocaleString()}else{t=Number(r).toLocaleString()+"+"}return t}render(){const r=["badge"];if(this.size==="large")r.push("size-large");return!this.badgeText?t(e,null):t("div",{class:"badge-wrapper"},t("div",{class:r.join(" ")},t("span",{class:"badge-text"},t("slot",null,this.badgeText))))}get hostElement(){return a(this)}};c.style=d;export{c as q2_badge};
2
- //# sourceMappingURL=p-1954ab7d.entry.js.map
1
+ import{r,h as t,g as a,F as e}from"./p-a5f18e27.js";const o="*{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-block}.badge-wrapper{--comp-badge-background:var(--tct-badge-background, var(--t-gray8, #61c4ff));--comp-badge-color:var(--tct-badge-color, var(--t-base, #ffffff));--comp-badge-border-style:var(--tct-badge-border-style, solid);--comp-badge-border-color:var(--tct-badge-border-color, var(--t-secondary-l1, #9a9898))}:host([status=info]) .badge-wrapper{--comp-badge-background:var(--tct-badge-info-background, var(--const-stoplight-info, #0079c1));--comp-badge-color:var(--tct-badge-info-color, var(--const-stoplight-info-text, #ffffff));--comp-badge-border-color:var(--tct-badge-info-border-color, var(--const-stoplight-info-l1, #3a9bd6))}:host([status=alert]) .badge-wrapper{--comp-badge-background:var(--tct-badge-alert-background, var(--const-stoplight-alert, #d20a0a));--comp-badge-color:var(--tct-badge-alert-color, var(--const-stoplight-alert-text, #ffffff));--comp-badge-border-color:var(--tct-badge-alert-border-color, var(--const-stoplight-alert-l1, #e42929))}:host([status=warning]) .badge-wrapper{--comp-badge-background:var(--tct-badge-warning-background, var(--const-stoplight-warning, #c35500));--comp-badge-color:var(--tct-badge-warning-color, var(--const-stoplight-warning-text, #423535));--comp-badge-border-color:var(--tct-badge-warning-border-color, var(--const-stoplight-warning-l1, #f9ce4c))}:host([status=success]) .badge-wrapper{--comp-badge-background:var(--tct-badge-success-background, var(--const-stoplight-success, #57fc45));--comp-badge-color:var(--tct-badge-success-color, var(--const-stoplight-success-text, #ffffff));--comp-badge-border-color:var(--tct-badge-success-border-color, var(--const-stoplight-success-l1, #2eaa21))}:host([theme=primary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-primary-background, var(--t-primary, #0079c2));--comp-badge-color:var(--tct-badge-primary-color, var(--t-primary-text, #ffffff));--comp-badge-border-color:var(--tct-badge-primary-border-color, var(--t-primary-l1, #3a9bd6))}:host([theme=secondary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-secondary-background, var(--t-secondary, #b4c2cd));--comp-badge-color:var(--tct-badge-secondary-color, var(--t-secondary-text, #ffffff));--comp-badge-border-color:var(--tct-badge-secondary-border-color, var(--t-secondary-l1, #c6d1db))}:host([theme=tertiary]) .badge-wrapper{--comp-badge-background:var(--tct-badge-tertiary-background, var(--t-tertiary, #e9f5fc));--comp-badge-color:var(--tct-badge-tertiary-color, var(--t-tertiary-text, #000000));--comp-badge-border-color:var(--tct-badge-tertiary-border-color, var(--t-tertiary-l1, #f3f4f5))}.badge{font-size:var(--tct-badge-font-size, 10px);line-height:var(--tct-badge-line-height, 14px);height:var(--tct-badge-height, 16px);min-width:var(--tct-badge-min-width, 16px);text-align:center;padding:var(--tct-badge-padding, 0 4px);color:var(--comp-badge-color);background:var(--comp-badge-background);border-style:var(--comp-badge-border-style);border-color:var(--comp-badge-border-color);border-width:var(--tct-badge-border-width, var(--t-badge-border-width, 1px));border-radius:var(--tct-badge-border-radius, var(--t-badge-border-radius, 8px))}.badge.size-large{font-size:var(--tct-badge-large-font-size, 14px);line-height:var(--tct-badge-large-line-height, 20px);height:var(--tct-badge-large-height, 22px);min-width:var(--tct-badge-large-min-width, 22px);border-radius:var(--tct-badge-large-border-radius, 11px);padding:var(--tct-badge-large-padding, 0 6px)}.badge-wrapper{display:flex;align-items:center;justify-content:center}";const d=o;const c=class{constructor(t){r(this,t);this.maxLength=undefined;this.size=undefined;this.status=undefined;this.theme=undefined;this.value=0}get badgeText(){const r=Math.pow(10,this.maxLength||2)-1;let t=this.value||0;if(isNaN(t)||t<=0){t=""}else if(t<=r){t=Number(t).toLocaleString()}else{t=Number(r).toLocaleString()+"+"}return t}get hasSlot(){return!!this.hostElement.innerHTML.trim()}render(){const r=["badge"];if(this.size==="large")r.push("size-large");return!this.badgeText&&!this.hasSlot?t(e,null):t("div",{class:"badge-wrapper"},t("div",{class:r.join(" ")},t("span",{class:"badge-text"},this.hasSlot?t("slot",null):this.badgeText)))}get hostElement(){return a(this)}};c.style=d;export{c as q2_badge};
2
+ //# sourceMappingURL=p-b3322f94.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["q2BadgeCss","Q2BadgeStyle0","Q2Badge","badgeText","maxValue","Math","pow","this","maxLength","value","isNaN","Number","toLocaleString","hasSlot","hostElement","innerHTML","trim","render","badgeClass","size","push","h","Fragment","class","join"],"sources":["src/components/q2-badge/q2-badge.scss?tag=q2-badge&encapsulation=shadow","src/components/q2-badge/q2-badge.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n}\n\n.badge-wrapper {\n --comp-badge-background: #{var-list(--tct-badge-background, --t-gray8, #61c4ff)};\n --comp-badge-color: #{var-list(--tct-badge-color, --t-base, #ffffff)};\n --comp-badge-border-style: #{var-list(--tct-badge-border-style, solid)};\n --comp-badge-border-color: #{var-list(--tct-badge-border-color, --t-secondary-l1, #9a9898)};\n\n :host([status='info']) & {\n --comp-badge-background: #{var-list(--tct-badge-info-background, --const-stoplight-info, #0079c1)};\n --comp-badge-color: #{var-list(--tct-badge-info-color, --const-stoplight-info-text, #ffffff)};\n --comp-badge-border-color: #{var-list(--tct-badge-info-border-color, --const-stoplight-info-l1, #3a9bd6)};\n }\n\n :host([status='alert']) & {\n --comp-badge-background: #{var-list(--tct-badge-alert-background, --const-stoplight-alert, #d20a0a)};\n --comp-badge-color: #{var-list(--tct-badge-alert-color, --const-stoplight-alert-text, #ffffff)};\n --comp-badge-border-color: #{var-list(--tct-badge-alert-border-color, --const-stoplight-alert-l1, #e42929)};\n }\n\n :host([status='warning']) & {\n --comp-badge-background: #{var-list(--tct-badge-warning-background, --const-stoplight-warning, #c35500)};\n --comp-badge-color: #{var-list(--tct-badge-warning-color, --const-stoplight-warning-text, #423535)};\n --comp-badge-border-color: #{var-list(--tct-badge-warning-border-color, --const-stoplight-warning-l1, #f9ce4c)};\n }\n\n :host([status='success']) & {\n --comp-badge-background: #{var-list(--tct-badge-success-background, --const-stoplight-success, #57fc45)};\n --comp-badge-color: #{var-list(--tct-badge-success-color, --const-stoplight-success-text, #ffffff)};\n --comp-badge-border-color: #{var-list(--tct-badge-success-border-color, --const-stoplight-success-l1, #2eaa21)};\n }\n\n :host([theme='primary']) & {\n --comp-badge-background: #{var-list(--tct-badge-primary-background, --t-primary, #0079c2)};\n --comp-badge-color: #{var-list(--tct-badge-primary-color, --t-primary-text, #ffffff)};\n --comp-badge-border-color: #{var-list(--tct-badge-primary-border-color, --t-primary-l1, #3a9bd6)};\n }\n\n :host([theme='secondary']) & {\n --comp-badge-background: #{var-list(--tct-badge-secondary-background, --t-secondary, #b4c2cd)};\n --comp-badge-color: #{var-list(--tct-badge-secondary-color, --t-secondary-text, #ffffff)};\n --comp-badge-border-color: #{var-list(--tct-badge-secondary-border-color, --t-secondary-l1, #c6d1db)};\n }\n\n :host([theme='tertiary']) & {\n --comp-badge-background: #{var-list(--tct-badge-tertiary-background, --t-tertiary, #e9f5fc)};\n --comp-badge-color: #{var-list(--tct-badge-tertiary-color, --t-tertiary-text, #000000)};\n --comp-badge-border-color: #{var-list(--tct-badge-tertiary-border-color, --t-tertiary-l1, #f3f4f5)};\n }\n}\n\n.badge {\n font-size: var-list(--tct-badge-font-size, 10px);\n line-height: var-list(--tct-badge-line-height, 14px);\n height: var-list(--tct-badge-height, 16px);\n min-width: var-list(--tct-badge-min-width, 16px);\n text-align: center;\n padding: var-list(--tct-badge-padding, unquote('0 4px'));\n color: var(--comp-badge-color);\n background: var(--comp-badge-background);\n border-style: var(--comp-badge-border-style);\n border-color: var(--comp-badge-border-color);\n border-width: var-list(var-prefixer(badge-border-width), 1px);\n border-radius: var-list(var-prefixer(badge-border-radius), 8px);\n}\n\n.badge.size-large {\n font-size: var-list(--tct-badge-large-font-size, 14px);\n line-height: var-list(--tct-badge-large-line-height, 20px);\n height: var-list(--tct-badge-large-height, 22px);\n min-width: var-list(--tct-badge-large-min-width, 22px);\n border-radius: var-list(--tct-badge-large-border-radius, 11px);\n padding: var-list(--tct-badge-large-padding, unquote('0 6px'));\n}\n\n.badge-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n","// import { hasSlotContent } from 'src/utils';\nimport { Component, Prop, h, ComponentInterface, Element, Fragment } from '@stencil/core';\n\n@Component({ tag: 'q2-badge', shadow: true, styleUrl: 'q2-badge.scss' })\nexport class Q2Badge implements ComponentInterface {\n /** The number of digits to show. */\n @Prop({ reflect: true }) maxLength: number | undefined;\n\n /** The size of the badge. */\n @Prop({ reflect: true }) size: 'default' | 'large' | undefined;\n\n /** The stoplight color of the element when `theme` is not present. */\n @Prop({ reflect: true }) status: 'info' | 'alert' | 'warning' | 'success' | undefined;\n\n /**\n * The color of the badge when in the active state.\n * The `theme` has higher priority than `status`.\n */\n @Prop({ reflect: true }) theme: 'primary' | 'secondary' | 'tertiary' | undefined;\n\n /** The number to display in the badge. `q2-badge` also allows slot HTML elements which can be any string. */\n @Prop({ reflect: true }) value: number = 0;\n\n @Element() hostElement: HTMLElement;\n\n get badgeText(): string {\n const maxValue = Math.pow(10, this.maxLength || 2) - 1;\n let value: string | number = this.value || 0;\n if (isNaN(value) || value <= 0) {\n value = '';\n } else if (value <= maxValue) {\n value = Number(value).toLocaleString();\n } else {\n value = Number(maxValue).toLocaleString() + '+';\n }\n return value;\n }\n\n get hasSlot(): boolean {\n return !!this.hostElement.innerHTML.trim();\n }\n\n render() {\n const badgeClass = ['badge'];\n if (this.size === 'large') badgeClass.push('size-large');\n return !this.badgeText && !this.hasSlot ? (\n <Fragment />\n ) : (\n <div class=\"badge-wrapper\">\n <div class={badgeClass.join(' ')}>\n <span class=\"badge-text\">{this.hasSlot ? <slot></slot> : this.badgeText}</span>\n </div>\n </div>\n );\n }\n}\n"],"mappings":"oDAAA,MAAMA,EAAa,0mIACnB,MAAAC,EAAeD,E,MCGFE,EAAO,M,4HAiByB,C,CAIzC,aAAIC,GACA,MAAMC,EAAWC,KAAKC,IAAI,GAAIC,KAAKC,WAAa,GAAK,EACrD,IAAIC,EAAyBF,KAAKE,OAAS,EAC3C,GAAIC,MAAMD,IAAUA,GAAS,EAAG,CAC5BA,EAAQ,E,MACL,GAAIA,GAASL,EAAU,CAC1BK,EAAQE,OAAOF,GAAOG,gB,KACnB,CACHH,EAAQE,OAAOP,GAAUQ,iBAAmB,G,CAEhD,OAAOH,C,CAGX,WAAII,GACA,QAASN,KAAKO,YAAYC,UAAUC,M,CAGxC,MAAAC,GACI,MAAMC,EAAa,CAAC,SACpB,GAAIX,KAAKY,OAAS,QAASD,EAAWE,KAAK,cAC3C,OAAQb,KAAKJ,YAAcI,KAAKM,QAC5BQ,EAACC,EAAQ,MAETD,EAAA,OAAKE,MAAM,iBACPF,EAAA,OAAKE,MAAOL,EAAWM,KAAK,MACxBH,EAAA,QAAME,MAAM,cAAchB,KAAKM,QAAUQ,EAAA,aAAgBd,KAAKJ,Y"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as i,g as n}from"./p-a5f18e27.js";import{n as a,o,i as s,l as r}from"./p-5c46acb8.js";const c="*{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{text-align:right;display:block;width:100%}:host([hidden]){display:none}.container{display:inline-flex;column-gap:var(--tct-pagination-column-gap, var(--t-pagination-column-gap, var(--app-scale-2x, 10px)));align-items:center;height:var(--tct-pagination-height, var(--t-pagination-height, 44px))}.btn-group{display:flex;gap:var(--tct-pagination-btn-gap, var(--t-pagination-btn-gap, 0))}.description,.controls{white-space:nowrap}.controls{display:grid;grid-template-columns:auto 50px auto;align-items:center;gap:var(--tct-pagination-controls-gap, var(--t-pagination-controls-gap, var(--app-scale-1x, 5px)))}.controls[hidden]{display:none}.input-wrapper{height:var(--tct-pagination-height, var(--t-pagination-height, 44px));display:flex;align-items:center}q2-btn{--tct-btn-border-radius:var(--tct-pagination-btn-border-radius, var(--t-pagination-btn-border-radius));--tct-btn-border:var(--tct-pagination-btn-border, var(--t-pagination-btn-border))}q2-icon{--tct-icon-size:var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));color:var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)))}q2-input{--tct-input-margin-top:0;--tct-input-margin-bottom:0;--tct-input-height:var(--tct-pagination-input-height, var(--t-pagination-input-height, 30px));--tct-input-min-height:var(--tct-input-height);--tct-input-align:center}";const d=c;const l=class{constructor(i){t(this,i);this.change=e(this,"change",7);this.handlePageChange=t=>{const{totalPages:e,inputField:i}=this;if(t<1){t=1}else if(t>e){t=e}if(i.value!==`${t}`)i.value=`${t}`;if(!this.hostElement.onchange){this.page=t}this.change.emit({page:t})};this.checkSize=()=>{const{hostElement:t,containerElement:e}=this;const i=this.containerWidth>t.clientWidth;this.isSmall=i;if(i)return;a((()=>{const t=this.containerWidth===e.clientWidth;if(t)return;this.containerWidth=e.clientWidth;this.checkSize()}))};this.autoSize=true;this.total=undefined;this.page=undefined;this.pages=undefined;this.pagesOnly=undefined;this.perPage=undefined;this.recordsOnly=undefined;this.recordType=undefined;this.isSmall=undefined}componentWillLoad(){this.manageResizeObserver()}componentDidLoad(){this.containerWidth=this.containerElement.clientWidth;o(this.hostElement)}disconnectedCallback(){this.removeResizeObserver()}manageResizeObserver(){if(this.autoSize&&!this.recordsOnly&&!this.pagesOnly){if(this.resizeObserver)return;this.resizeObserver=new ResizeObserver((()=>this.checkSize()));this.resizeObserver.observe(this.hostElement);window.addEventListener("resize",this.checkSize)}else{this.isSmall=false;this.removeResizeObserver()}}onHostElementFocus(t){var e;if(!s(t,this.hostElement))return;const{isFullViewHidden:i,containerElement:n,inputField:a}=this;if(i){(e=n.querySelector("q2-btn:not([disabled])"))===null||e===void 0?void 0:e.focus()}else{a.focus()}}get isFullViewHidden(){return this.isSmall||this.recordsOnly||this.pagesOnly}get pageWithDefault(){return this.page||1}get perPageWithDefault(){return this.perPage||10}get totalWithDefault(){return this.total||0}get recordTypeWithDefault(){return this.recordType||r("tecton.element.pagination.defaultRecordType")}get currentRange(){const{perPageWithDefault:t,totalWithDefault:e,pageWithDefault:i}=this;const n=(i-1)*t+1;const a=Math.min(i*t,e);return`${n} - ${a}`}get nextRange(){const{perPageWithDefault:t,totalWithDefault:e,pageWithDefault:i}=this;const n=i*t+1;const a=Math.min((i+1)*t,e);return`${n} - ${a}`}get prevRange(){const{perPageWithDefault:t,pageWithDefault:e}=this;const i=Math.max(1,(e-2)*t+1);const n=(e-1)*t;return`${i} - ${n}`}get totalPages(){const{pagesOnly:t,totalWithDefault:e,perPageWithDefault:i,pages:n}=this;if(t&&n&&!isNaN(parseInt(`${n}`)))return n;return Math.ceil(e/i)}removeResizeObserver(){var t;if(this.resizeObserver){(t=this.resizeObserver)===null||t===void 0?void 0:t.unobserve(this.hostElement);this.resizeObserver=null;window.removeEventListener("resize",this.checkSize)}}render(){const{pagesOnly:t,recordsOnly:e,isFullViewHidden:n,recordTypeWithDefault:a,totalPages:o,totalWithDefault:s,pageWithDefault:c,currentRange:d,nextRange:l,prevRange:h}=this;const p=c===1;const g=c===o;let b="";let f="";if(t){f=r("tecton.element.pagination.goToPages",{next:c-1,total:o});b=r("tecton.element.pagination.goToPages",{next:c+1,total:o})}else if(e){f=r("tecton.element.pagination.goToRecords",{range:h,recordType:a.toLowerCase(),total:s});b=r("tecton.element.pagination.goToRecords",{range:l,recordType:a.toLowerCase(),total:s})}return i("nav",{key:"96bcb9c4a977162f1a3cf086ad71052a040fbc02",class:"container",ref:t=>this.containerElement=t,"aria-label":r("tecton.element.pagination.title")},i("div",{key:"885ec8867dcfe56fcec401e3af167dcecc33b70f",class:"description","test-id":"description"},t?r("tecton.element.pagination.pages",{current:c,total:o}):r("tecton.element.pagination.description",{range:d,recordType:a.toLowerCase(),total:s.toLocaleString()})),i("div",{key:"aaaffc1971d83c47f71dc7f576043bb269589dd6",class:"btn-group"},i("q2-btn",{key:"dbc5c9cdcc90be091cbdc24fef330b4e83f84723",label:r("tecton.element.pagination.goToFirstPage"),disabled:p,hidden:n,onClick:()=>this.handlePageChange(1),"test-id":"firstPageBtn","hide-label":true},i("q2-icon",{key:"6b61c526965bac728905b20081d1b3fc2ee10d13",type:"chevron-double-left"})),i("q2-btn",{key:"4156c64395f16f7c4c6ca7928f5dc50ba20007dc",label:f,disabled:p,onClick:()=>this.handlePageChange(c-1),"test-id":"prevPageBtn","hide-label":true},i("q2-icon",{key:"bdb78a15f9852087531947b93e96e1b3c5518ff2",type:"chevron-left"}))),i("div",{key:"f655f178bbbd3b41c43ca4f68442c59c8f3f0674",class:"controls",hidden:n,"test-id":"controls"},i("span",{key:"60afc8c8bd8805bf38813b73c75fb260abe8deb4","aria-hidden":"true"},r("tecton.element.pagination.page")),i("div",{key:"7ab2d59e80533d82739fc53d98416305cbe365c9",class:"input-wrapper",onClick:()=>this.inputField.dispatchEvent(new FocusEvent("focus"))},i("q2-input",{key:"943e3b3a74853ec57b4939e897ad2d2296d875be",type:"number",value:`${c}`,min:1,max:this.totalPages,hideLabel:true,optional:true,label:`${r("tecton.element.pagination.page")} (${r("tecton.element.pagination.ofPages",[o.toLocaleString()])})`,onChange:t=>this.handlePageChange(t.detail.value),"test-id":"pageInput",current:"page",ref:t=>this.inputField=t})),i("span",{key:"e5da3d0850ec40c8123ec39bb3992260bf6001fc","aria-hidden":"true"},r("tecton.element.pagination.ofPages",[o.toLocaleString()]))),i("div",{key:"7ecaaedfdb80f3fb45c5ae74da0811f88797ab2c",class:"btn-group"},i("q2-btn",{key:"76aaadc41047bda4ff909eaa7269c6b00826cef9",label:b,disabled:g,onClick:()=>this.handlePageChange(c+1),"test-id":"nextPageBtn","hide-label":true},i("q2-icon",{key:"3c2a3ecd6d8f75391a2200c6e4ee69be1fbaa6ad",type:"chevron-right"})),i("q2-btn",{key:"433de5183eb6c4350a886c691c813ab8e709a64d",label:"tecton.element.pagination.goToLastPage",disabled:g,hidden:n,onClick:()=>this.handlePageChange(o),"test-id":"lastPageBtn","hide-label":true},i("q2-icon",{key:"48bf23391120c809d793b8a48c6de128b12ac75d",type:"chevron-double-right"}))))}get hostElement(){return n(this)}static get watchers(){return{recordsOnly:["manageResizeObserver"],pagesOnly:["manageResizeObserver"],autoSize:["manageResizeObserver"]}}};l.style=d;export{l as q2_pagination};
2
- //# sourceMappingURL=p-25eccf38.entry.js.map
1
+ import{r as t,c as e,h as i,g as n}from"./p-a5f18e27.js";import{n as a,o,i as s,l as r}from"./p-42302f6f.js";const c="*{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{text-align:right;display:block;width:100%}:host([hidden]){display:none}.container{display:inline-flex;column-gap:var(--tct-pagination-column-gap, var(--t-pagination-column-gap, var(--app-scale-2x, 10px)));align-items:center;height:var(--tct-pagination-height, var(--t-pagination-height, 44px))}.btn-group{display:flex;gap:var(--tct-pagination-btn-gap, var(--t-pagination-btn-gap, 0))}.description,.controls{white-space:nowrap}.controls{display:grid;grid-template-columns:auto 50px auto;align-items:center;gap:var(--tct-pagination-controls-gap, var(--t-pagination-controls-gap, var(--app-scale-1x, 5px)))}.controls[hidden]{display:none}.input-wrapper{height:var(--tct-pagination-height, var(--t-pagination-height, 44px));display:flex;align-items:center}q2-btn{--tct-btn-border-radius:var(--tct-pagination-btn-border-radius, var(--t-pagination-btn-border-radius));--tct-btn-border:var(--tct-pagination-btn-border, var(--t-pagination-btn-border))}q2-icon{--tct-icon-size:var(--tct-pagination-icon-size, var(--t-pagination-icon-size, 12px));color:var(--tct-pagination-icon-color, var(--t-pagination-icon-color, var(--t-text, #4d4d4d)))}q2-input{--tct-input-margin-top:0;--tct-input-margin-bottom:0;--tct-input-height:var(--tct-pagination-input-height, var(--t-pagination-input-height, 30px));--tct-input-min-height:var(--tct-input-height);--tct-input-align:center}";const d=c;const l=class{constructor(i){t(this,i);this.change=e(this,"change",7);this.handlePageChange=t=>{const{totalPages:e,inputField:i}=this;if(t<1){t=1}else if(t>e){t=e}if(i.value!==`${t}`)i.value=`${t}`;if(!this.hostElement.onchange){this.page=t}this.change.emit({page:t})};this.checkSize=()=>{const{hostElement:t,containerElement:e}=this;const i=this.containerWidth>t.clientWidth;this.isSmall=i;if(i)return;a((()=>{const t=this.containerWidth===e.clientWidth;if(t)return;this.containerWidth=e.clientWidth;this.checkSize()}))};this.autoSize=true;this.total=undefined;this.page=undefined;this.pages=undefined;this.pagesOnly=undefined;this.perPage=undefined;this.recordsOnly=undefined;this.recordType=undefined;this.isSmall=undefined}componentWillLoad(){this.manageResizeObserver()}componentDidLoad(){this.containerWidth=this.containerElement.clientWidth;o(this.hostElement)}disconnectedCallback(){this.removeResizeObserver()}manageResizeObserver(){if(this.autoSize&&!this.recordsOnly&&!this.pagesOnly){if(this.resizeObserver)return;this.resizeObserver=new ResizeObserver((()=>this.checkSize()));this.resizeObserver.observe(this.hostElement);window.addEventListener("resize",this.checkSize)}else{this.isSmall=false;this.removeResizeObserver()}}onHostElementFocus(t){var e;if(!s(t,this.hostElement))return;const{isFullViewHidden:i,containerElement:n,inputField:a}=this;if(i){(e=n.querySelector("q2-btn:not([disabled])"))===null||e===void 0?void 0:e.focus()}else{a.focus()}}get isFullViewHidden(){return this.isSmall||this.recordsOnly||this.pagesOnly}get pageWithDefault(){return this.page||1}get perPageWithDefault(){return this.perPage||10}get totalWithDefault(){return this.total||0}get recordTypeWithDefault(){return this.recordType||r("tecton.element.pagination.defaultRecordType")}get currentRange(){const{perPageWithDefault:t,totalWithDefault:e,pageWithDefault:i}=this;const n=(i-1)*t+1;const a=Math.min(i*t,e);return`${n} - ${a}`}get nextRange(){const{perPageWithDefault:t,totalWithDefault:e,pageWithDefault:i}=this;const n=i*t+1;const a=Math.min((i+1)*t,e);return`${n} - ${a}`}get prevRange(){const{perPageWithDefault:t,pageWithDefault:e}=this;const i=Math.max(1,(e-2)*t+1);const n=(e-1)*t;return`${i} - ${n}`}get totalPages(){const{pagesOnly:t,totalWithDefault:e,perPageWithDefault:i,pages:n}=this;if(t&&n&&!isNaN(parseInt(`${n}`)))return n;return Math.ceil(e/i)}removeResizeObserver(){var t;if(this.resizeObserver){(t=this.resizeObserver)===null||t===void 0?void 0:t.unobserve(this.hostElement);this.resizeObserver=null;window.removeEventListener("resize",this.checkSize)}}render(){const{pagesOnly:t,recordsOnly:e,isFullViewHidden:n,recordTypeWithDefault:a,totalPages:o,totalWithDefault:s,pageWithDefault:c,currentRange:d,nextRange:l,prevRange:h}=this;const p=c===1;const g=c===o;let u="";let f="";if(t){f=r("tecton.element.pagination.goToPages",{next:c-1,total:o});u=r("tecton.element.pagination.goToPages",{next:c+1,total:o})}else if(e){f=r("tecton.element.pagination.goToRecords",{range:h,recordType:a.toLowerCase(),total:s});u=r("tecton.element.pagination.goToRecords",{range:l,recordType:a.toLowerCase(),total:s})}return i("nav",{key:"74561394c7bdb496d306e959ad5b1e5361e42ec7",class:"container",ref:t=>this.containerElement=t,"aria-label":r("tecton.element.pagination.title")},i("div",{key:"2500a292e1823d4d24136be40a4fa4f9346bc9c8",class:"description","test-id":"description"},t?r("tecton.element.pagination.pages",{current:c,total:o}):r("tecton.element.pagination.description",{range:d,recordType:a.toLowerCase(),total:s.toLocaleString()})),i("div",{key:"653ee492dfd5b7e80d8d1e1eb680364cbdb13f17",class:"btn-group"},i("q2-btn",{key:"512e60ac934efaa54a87862ab81677956d80c7dc",label:r("tecton.element.pagination.goToFirstPage"),disabled:p,hidden:n,onClick:()=>this.handlePageChange(1),"test-id":"firstPageBtn","hide-label":true},i("q2-icon",{key:"7c0c57fbb28c7221467457ced6e2f196f5c0c41a",type:"chevron-double-left"})),i("q2-btn",{key:"5a3ad7135ac650be29b2dcbd0f4e2dd1e0303a14",label:f,disabled:p,onClick:()=>this.handlePageChange(c-1),"test-id":"prevPageBtn","hide-label":true},i("q2-icon",{key:"9955d71cb14f809d7794022aff67c4403dd59e0c",type:"chevron-left"}))),i("div",{key:"b7bbe334d869c527093f50b61419cd680dad7205",class:"controls",hidden:n,"test-id":"controls"},i("span",{key:"778f9842501854d5427f481e02924b2f967f8ec7","aria-hidden":"true"},r("tecton.element.pagination.page")),i("div",{key:"2761c3e8acd7150aba435d86c545e0903482163d",class:"input-wrapper",onClick:()=>this.inputField.dispatchEvent(new FocusEvent("focus"))},i("q2-input",{key:"00e1cfc6c391311920928694844875715ed2fd97",type:"number",value:`${c}`,min:1,max:this.totalPages,hideLabel:true,optional:true,label:`${r("tecton.element.pagination.page")} (${r("tecton.element.pagination.ofPages",[o.toLocaleString()])})`,onChange:t=>this.handlePageChange(t.detail.value),"test-id":"pageInput",current:"page",ref:t=>this.inputField=t})),i("span",{key:"f14e720d12dcf4deb0b1ccf1b290f8ef1b3f9dab","aria-hidden":"true"},r("tecton.element.pagination.ofPages",[o.toLocaleString()]))),i("div",{key:"6acb2c32ca833bdd68fe0e09cee75df7c8abaae3",class:"btn-group"},i("q2-btn",{key:"0ac42aecaf056348a8c2e2729d1e35e7db44750b",label:u,disabled:g,onClick:()=>this.handlePageChange(c+1),"test-id":"nextPageBtn","hide-label":true},i("q2-icon",{key:"f1c87ff1bc99dc529a2e5efdaad614f1b1c4b520",type:"chevron-right"})),i("q2-btn",{key:"2f6d47cc2805f3e9e3215448e5c6ca0909b7ad80",label:"tecton.element.pagination.goToLastPage",disabled:g,hidden:n,onClick:()=>this.handlePageChange(o),"test-id":"lastPageBtn","hide-label":true},i("q2-icon",{key:"88a16778a20430935b7cc5d23393897f426d4548",type:"chevron-double-right"}))))}get hostElement(){return n(this)}static get watchers(){return{recordsOnly:["manageResizeObserver"],pagesOnly:["manageResizeObserver"],autoSize:["manageResizeObserver"]}}};l.style=d;export{l as q2_pagination};
2
+ //# sourceMappingURL=p-b3d10d52.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["q2PaginationCss","Q2PaginationStyle0","Q2Pagination","this","handlePageChange","page","totalPages","inputField","value","hostElement","onchange","change","emit","checkSize","containerElement","isOverflowing","containerWidth","clientWidth","isSmall","nextPaint","containerWidthHasNotChanged","componentWillLoad","manageResizeObserver","componentDidLoad","overrideFocus","disconnectedCallback","removeResizeObserver","autoSize","recordsOnly","pagesOnly","resizeObserver","ResizeObserver","observe","window","addEventListener","onHostElementFocus","event","isEventFromElement","isFullViewHidden","_a","querySelector","focus","pageWithDefault","perPageWithDefault","perPage","totalWithDefault","total","recordTypeWithDefault","recordType","loc","currentRange","start","end","Math","min","nextRange","prevRange","max","pages","isNaN","parseInt","ceil","unobserve","removeEventListener","render","onFirstPage","onLastPage","nextButtonLabel","prevButtonLabel","next","range","toLowerCase","h","key","class","ref","el","current","toLocaleString","label","disabled","hidden","onClick","type","dispatchEvent","FocusEvent","hideLabel","optional","onChange","detail"],"sources":["src/components/q2-pagination/q2-pagination.scss?tag=q2-pagination&encapsulation=shadow","src/components/q2-pagination/q2-pagination.tsx"],"sourcesContent":["@import '../../styles/host';\n@import '../../styles/functions';\n\n:host {\n text-align: right;\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.container {\n display: inline-flex;\n column-gap: var-list(var-prefixer(pagination-column-gap), --app-scale-2x, 10px);\n align-items: center;\n height: var-list(var-prefixer(pagination-height), 44px);\n}\n\n.btn-group {\n display: flex;\n gap: var-list(var-prefixer(pagination-btn-gap), 0);\n}\n\n.description,\n.controls {\n white-space: nowrap;\n}\n\n.controls {\n display: grid;\n grid-template-columns: auto 50px auto;\n align-items: center;\n gap: var-list(var-prefixer(pagination-controls-gap), --app-scale-1x, 5px);\n\n &[hidden] {\n display: none;\n }\n}\n\n.input-wrapper {\n height: var-list(var-prefixer(pagination-height), 44px);\n display: flex;\n align-items: center;\n}\n\nq2-btn {\n --tct-btn-border-radius: #{var-list(var-prefixer(pagination-btn-border-radius))};\n --tct-btn-border: #{var-list(var-prefixer(pagination-btn-border))};\n}\n\nq2-icon {\n --tct-icon-size: #{var-list(var-prefixer(pagination-icon-size), 12px)};\n color: var-list(var-prefixer(pagination-icon-color), --t-text, #4d4d4d);\n}\n\nq2-input {\n --tct-input-margin-top: 0;\n --tct-input-margin-bottom: 0;\n --tct-input-height: #{var-list(var-prefixer(pagination-input-height), 30px)};\n --tct-input-min-height: var(--tct-input-height);\n --tct-input-align: center;\n}\n","import {\n Component,\n State,\n Prop,\n h,\n ComponentInterface,\n Watch,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { isEventFromElement, loc, nextPaint, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-pagination', shadow: true, styleUrl: 'q2-pagination.scss' })\nexport class Q2Pagination implements ComponentInterface {\n /** Determines whether the component uses the dynamic resizing behavior. */\n @Prop({ reflect: true, mutable: true }) autoSize: boolean = true;\n\n /** The total number of records to paginate. */\n @Prop({ reflect: true }) total: number;\n\n /** The current page that is being displayed. */\n @Prop({ reflect: true, mutable: true }) page: number;\n\n /**\n * The number of pages that can be displayed.\n * @info\n * Only referenced when `pagesOnly` is true.\n */\n @Prop({ reflect: true, mutable: true }) pages: number;\n\n /** Indicates to only display the current and total pages. */\n @Prop({ reflect: true, mutable: true }) pagesOnly: boolean;\n\n /** The total number of records displayed on each page. */\n @Prop() perPage: number;\n\n /** Indicates to only display the current and total records. */\n @Prop({ reflect: true, mutable: true }) recordsOnly: boolean;\n\n /** Description of the record tupe to be displayed alongside the record count. */\n @Prop() recordType: string;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the page is changed.\n * @legacyEvent\n */\n @Event() change: EventEmitter<{ page: number }>;\n\n @State() isSmall: boolean;\n\n inputField: HTMLQ2InputElement;\n containerElement: HTMLElement;\n containerWidth: number;\n resizeObserver: ResizeObserver;\n\n ////////// LIFECYCLE HOOKS ////////\n componentWillLoad(): void {\n this.manageResizeObserver();\n }\n\n componentDidLoad(): void {\n this.containerWidth = this.containerElement.clientWidth;\n\n overrideFocus(this.hostElement);\n }\n\n disconnectedCallback() {\n this.removeResizeObserver();\n }\n\n ///////// OBSERVERS /////////\n\n @Watch('recordsOnly')\n @Watch('pagesOnly')\n @Watch('autoSize')\n manageResizeObserver() {\n if (this.autoSize && !this.recordsOnly && !this.pagesOnly) {\n if (this.resizeObserver) return;\n this.resizeObserver = new ResizeObserver(() => this.checkSize());\n this.resizeObserver.observe(this.hostElement);\n window.addEventListener('resize', this.checkSize);\n } else {\n this.isSmall = false;\n this.removeResizeObserver();\n }\n }\n\n ///////// HOST ELEMENT EVENTS /////////\n\n @Listen('focus')\n onHostElementFocus(event) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const { isFullViewHidden, containerElement, inputField } = this;\n if (isFullViewHidden) {\n containerElement.querySelector<HTMLElement>('q2-btn:not([disabled])')?.focus();\n } else {\n inputField.focus();\n }\n }\n\n ///////// GETTERS /////////\n\n get isFullViewHidden() {\n return this.isSmall || this.recordsOnly || this.pagesOnly;\n }\n\n get pageWithDefault() {\n return this.page || 1;\n }\n\n get perPageWithDefault() {\n return this.perPage || 10;\n }\n\n get totalWithDefault() {\n return this.total || 0;\n }\n\n get recordTypeWithDefault() {\n return this.recordType || loc('tecton.element.pagination.defaultRecordType');\n }\n\n get currentRange() {\n const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;\n const start = (page - 1) * perPage + 1;\n const end = Math.min(page * perPage, total);\n return `${start} - ${end}`;\n }\n\n get nextRange() {\n const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;\n const start = page * perPage + 1;\n const end = Math.min((page + 1) * perPage, total);\n return `${start} - ${end}`;\n }\n\n get prevRange() {\n const { perPageWithDefault: perPage, pageWithDefault: page } = this;\n const start = Math.max(1, (page - 2) * perPage + 1);\n const end = (page - 1) * perPage;\n return `${start} - ${end}`;\n }\n\n get totalPages() {\n const { pagesOnly, totalWithDefault: total, perPageWithDefault: perPage, pages } = this;\n\n if (pagesOnly && pages && !isNaN(parseInt(`${pages}`))) return pages;\n\n return Math.ceil(total / perPage);\n }\n\n ///////// HELPERS /////////\n\n removeResizeObserver() {\n if (this.resizeObserver) {\n this.resizeObserver?.unobserve(this.hostElement);\n this.resizeObserver = null;\n window.removeEventListener('resize', this.checkSize);\n }\n }\n\n handlePageChange = (page: number) => {\n const { totalPages, inputField } = this;\n if (page < 1) {\n page = 1;\n } else if (page > totalPages) {\n page = totalPages;\n }\n\n if (inputField.value !== `${page}`) inputField.value = `${page}`;\n\n if (!this.hostElement.onchange) {\n this.page = page;\n }\n\n this.change.emit({ page });\n };\n\n checkSize = () => {\n const { hostElement, containerElement } = this;\n const isOverflowing = this.containerWidth > hostElement.clientWidth;\n this.isSmall = isOverflowing;\n if (isOverflowing) return;\n\n nextPaint(() => {\n const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;\n if (containerWidthHasNotChanged) return;\n this.containerWidth = containerElement.clientWidth;\n this.checkSize();\n });\n };\n\n render() {\n const {\n pagesOnly,\n recordsOnly,\n isFullViewHidden,\n recordTypeWithDefault: recordType,\n totalPages,\n totalWithDefault: total,\n pageWithDefault: page,\n currentRange,\n nextRange,\n prevRange,\n } = this;\n const onFirstPage = page === 1;\n const onLastPage = page === totalPages;\n\n let nextButtonLabel: string = '';\n let prevButtonLabel: string = '';\n if (pagesOnly) {\n prevButtonLabel = loc('tecton.element.pagination.goToPages', { next: page - 1, total: totalPages });\n nextButtonLabel = loc('tecton.element.pagination.goToPages', { next: page + 1, total: totalPages });\n } else if (recordsOnly) {\n prevButtonLabel = loc('tecton.element.pagination.goToRecords', {\n range: prevRange,\n recordType: recordType.toLowerCase(),\n total,\n });\n nextButtonLabel = loc('tecton.element.pagination.goToRecords', {\n range: nextRange,\n recordType: recordType.toLowerCase(),\n total,\n });\n }\n\n return (\n <nav\n class=\"container\"\n ref={el => (this.containerElement = el)}\n aria-label={loc('tecton.element.pagination.title')}\n >\n <div\n class=\"description\"\n test-id=\"description\"\n >\n {pagesOnly\n ? loc('tecton.element.pagination.pages', {\n current: page,\n total: totalPages,\n })\n : loc('tecton.element.pagination.description', {\n range: currentRange,\n recordType: recordType.toLowerCase(),\n total: total.toLocaleString(),\n })}\n </div>\n <div class=\"btn-group\">\n <q2-btn\n label={loc('tecton.element.pagination.goToFirstPage')}\n disabled={onFirstPage}\n hidden={isFullViewHidden}\n onClick={() => this.handlePageChange(1)}\n test-id=\"firstPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-double-left\" />\n </q2-btn>\n <q2-btn\n label={prevButtonLabel}\n disabled={onFirstPage}\n onClick={() => this.handlePageChange(page - 1)}\n test-id=\"prevPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-left\" />\n </q2-btn>\n </div>\n <div\n class=\"controls\"\n hidden={isFullViewHidden}\n test-id=\"controls\"\n >\n <span aria-hidden=\"true\">{loc('tecton.element.pagination.page')}</span>\n <div\n class=\"input-wrapper\"\n onClick={() => this.inputField.dispatchEvent(new FocusEvent('focus'))}\n >\n <q2-input\n type=\"number\"\n value={`${page}`}\n min={1}\n max={this.totalPages}\n hideLabel\n optional\n label={`${loc('tecton.element.pagination.page')} (${loc(\n 'tecton.element.pagination.ofPages',\n [totalPages.toLocaleString()]\n )})`}\n onChange={event => this.handlePageChange(event.detail.value)}\n test-id=\"pageInput\"\n current=\"page\"\n ref={el => (this.inputField = el)}\n ></q2-input>\n </div>\n <span aria-hidden=\"true\">\n {loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()])}\n </span>\n </div>\n <div class=\"btn-group\">\n <q2-btn\n label={nextButtonLabel}\n disabled={onLastPage}\n onClick={() => this.handlePageChange(page + 1)}\n test-id=\"nextPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-right\" />\n </q2-btn>\n <q2-btn\n label=\"tecton.element.pagination.goToLastPage\"\n disabled={onLastPage}\n hidden={isFullViewHidden}\n onClick={() => this.handlePageChange(totalPages)}\n test-id=\"lastPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-double-right\" />\n </q2-btn>\n </div>\n </nav>\n );\n }\n}\n"],"mappings":"6GAAA,MAAMA,EAAkB,g/DACxB,MAAAC,EAAeD,E,MCcFE,EAAY,M,wDAsJrBC,KAAAC,iBAAoBC,IAChB,MAAMC,WAAEA,EAAUC,WAAEA,GAAeJ,KACnC,GAAIE,EAAO,EAAG,CACVA,EAAO,C,MACJ,GAAIA,EAAOC,EAAY,CAC1BD,EAAOC,C,CAGX,GAAIC,EAAWC,QAAU,GAAGH,IAAQE,EAAWC,MAAQ,GAAGH,IAE1D,IAAKF,KAAKM,YAAYC,SAAU,CAC5BP,KAAKE,KAAOA,C,CAGhBF,KAA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kB,QAAQxB,EAAI,mCAC9BuB,EAAA,OAAAC,IAAA,2CACIC,MAAM,gBACNQ,QAAS,IAAM/E,KAAKI,WAAW6E,cAAc,IAAIC,WAAW,WAE5Db,EAAA,YAAAC,IAAA,2CACIU,KAAK,SACL3E,MAAO,GAAGH,IACViD,IAAK,EACLG,IAAKtD,KAAKG,WACVgF,UAAS,KACTC,SAAQ,KACRR,MAAO,GAAG9B,EAAI,sCAAsCA,EAChD,oCACA,CAAC3C,EAAWwE,sBAEhBU,SAAUpD,GAASjC,KAAKC,iBAAiBgC,EAAMqD,OAAOjF,OAAM,UACpD,YACRqE,QAAQ,OACRF,IAAKC,GAAOzE,KAAKI,WAAaqE,KAGtCJ,EAAA,QAAAC,IAAA,yDAAkB,QACbxB,EAAI,oCAAqC,CAAC3C,EAAWwE,qBAG9DN,EAAA,OAAAC,IAAA,2CAAKC,MAAM,aACPF,EAAA,UAAAC,IAAA,2CACIM,MAAOZ,EACPa,SAAUd,EACVgB,QAAS,IAAM/E,KAAKC,iBAAiBC,EAAO,GAAE,UACtC,cAAa,mBAGrBmE,EAAA,WAAAC,IAAA,2CAASU,KAAK,mBAElBX,EAAA,UAAAC,IAAA,2CACIM,MAAM,yCACNC,SAAUd,EACVe,OAAQ3C,EACR4C,QAAS,IAAM/E,KAAKC,iBAAiBE,GAAW,UACxC,cAAa,mBAGrBkE,EAAA,WAAAC,IAAA,2CAASU,KAAK,2B"}
1
+ {"version":3,"names":["q2PaginationCss","Q2PaginationStyle0","Q2Pagination","this","handlePageChange","page","totalPages","inputField","value","hostElement","onchange","change","emit","checkSize","containerElement","isOverflowing","containerWidth","clientWidth","isSmall","nextPaint","containerWidthHasNotChanged","componentWillLoad","manageResizeObserver","componentDidLoad","overrideFocus","disconnectedCallback","removeResizeObserver","autoSize","recordsOnly","pagesOnly","resizeObserver","ResizeObserver","observe","window","addEventListener","onHostElementFocus","event","isEventFromElement","isFullViewHidden","_a","querySelector","focus","pageWithDefault","perPageWithDefault","perPage","totalWithDefault","total","recordTypeWithDefault","recordType","loc","currentRange","start","end","Math","min","nextRange","prevRange","max","pages","isNaN","parseInt","ceil","unobserve","removeEventListener","render","onFirstPage","onLastPage","nextButtonLabel","prevButtonLabel","next","range","toLowerCase","h","key","class","ref","el","current","toLocaleString","label","disabled","hidden","onClick","type","dispatchEvent","FocusEvent","hideLabel","optional","onChange","detail"],"sources":["src/components/q2-pagination/q2-pagination.scss?tag=q2-pagination&encapsulation=shadow","src/components/q2-pagination/q2-pagination.tsx"],"sourcesContent":["@import '../../styles/host';\n@import '../../styles/functions';\n\n:host {\n text-align: right;\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.container {\n display: inline-flex;\n column-gap: var-list(var-prefixer(pagination-column-gap), --app-scale-2x, 10px);\n align-items: center;\n height: var-list(var-prefixer(pagination-height), 44px);\n}\n\n.btn-group {\n display: flex;\n gap: var-list(var-prefixer(pagination-btn-gap), 0);\n}\n\n.description,\n.controls {\n white-space: nowrap;\n}\n\n.controls {\n display: grid;\n grid-template-columns: auto 50px auto;\n align-items: center;\n gap: var-list(var-prefixer(pagination-controls-gap), --app-scale-1x, 5px);\n\n &[hidden] {\n display: none;\n }\n}\n\n.input-wrapper {\n height: var-list(var-prefixer(pagination-height), 44px);\n display: flex;\n align-items: center;\n}\n\nq2-btn {\n --tct-btn-border-radius: #{var-list(var-prefixer(pagination-btn-border-radius))};\n --tct-btn-border: #{var-list(var-prefixer(pagination-btn-border))};\n}\n\nq2-icon {\n --tct-icon-size: #{var-list(var-prefixer(pagination-icon-size), 12px)};\n color: var-list(var-prefixer(pagination-icon-color), --t-text, #4d4d4d);\n}\n\nq2-input {\n --tct-input-margin-top: 0;\n --tct-input-margin-bottom: 0;\n --tct-input-height: #{var-list(var-prefixer(pagination-input-height), 30px)};\n --tct-input-min-height: var(--tct-input-height);\n --tct-input-align: center;\n}\n","import {\n Component,\n State,\n Prop,\n h,\n ComponentInterface,\n Watch,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { isEventFromElement, loc, nextPaint, overrideFocus } from 'src/utils';\n\n@Component({ tag: 'q2-pagination', shadow: true, styleUrl: 'q2-pagination.scss' })\nexport class Q2Pagination implements ComponentInterface {\n /** Determines whether the component uses the dynamic resizing behavior. */\n @Prop({ reflect: true, mutable: true }) autoSize: boolean = true;\n\n /** The total number of records to paginate. */\n @Prop({ reflect: true }) total: number;\n\n /** The current page that is being displayed. */\n @Prop({ reflect: true, mutable: true }) page: number;\n\n /**\n * The number of pages that can be displayed.\n * @info\n * Only referenced when `pagesOnly` is true.\n */\n @Prop({ reflect: true, mutable: true }) pages: number;\n\n /** Indicates to only display the current and total pages. */\n @Prop({ reflect: true, mutable: true }) pagesOnly: boolean;\n\n /** The total number of records displayed on each page. */\n @Prop() perPage: number;\n\n /** Indicates to only display the current and total records. */\n @Prop({ reflect: true, mutable: true }) recordsOnly: boolean;\n\n /** Description of the record type to be displayed alongside the record count. */\n @Prop() recordType: string;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the page is changed.\n * @legacyEvent\n */\n @Event() change: EventEmitter<{ page: number }>;\n\n @State() isSmall: boolean;\n\n inputField: HTMLQ2InputElement;\n containerElement: HTMLElement;\n containerWidth: number;\n resizeObserver: ResizeObserver;\n\n ////////// LIFECYCLE HOOKS ////////\n componentWillLoad(): void {\n this.manageResizeObserver();\n }\n\n componentDidLoad(): void {\n this.containerWidth = this.containerElement.clientWidth;\n\n overrideFocus(this.hostElement);\n }\n\n disconnectedCallback() {\n this.removeResizeObserver();\n }\n\n ///////// OBSERVERS /////////\n\n @Watch('recordsOnly')\n @Watch('pagesOnly')\n @Watch('autoSize')\n manageResizeObserver() {\n if (this.autoSize && !this.recordsOnly && !this.pagesOnly) {\n if (this.resizeObserver) return;\n this.resizeObserver = new ResizeObserver(() => this.checkSize());\n this.resizeObserver.observe(this.hostElement);\n window.addEventListener('resize', this.checkSize);\n } else {\n this.isSmall = false;\n this.removeResizeObserver();\n }\n }\n\n ///////// HOST ELEMENT EVENTS /////////\n\n @Listen('focus')\n onHostElementFocus(event) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const { isFullViewHidden, containerElement, inputField } = this;\n if (isFullViewHidden) {\n containerElement.querySelector<HTMLElement>('q2-btn:not([disabled])')?.focus();\n } else {\n inputField.focus();\n }\n }\n\n ///////// GETTERS /////////\n\n get isFullViewHidden() {\n return this.isSmall || this.recordsOnly || this.pagesOnly;\n }\n\n get pageWithDefault() {\n return this.page || 1;\n }\n\n get perPageWithDefault() {\n return this.perPage || 10;\n }\n\n get totalWithDefault() {\n return this.total || 0;\n }\n\n get recordTypeWithDefault() {\n return this.recordType || loc('tecton.element.pagination.defaultRecordType');\n }\n\n get currentRange() {\n const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;\n const start = (page - 1) * perPage + 1;\n const end = Math.min(page * perPage, total);\n return `${start} - ${end}`;\n }\n\n get nextRange() {\n const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;\n const start = page * perPage + 1;\n const end = Math.min((page + 1) * perPage, total);\n return `${start} - ${end}`;\n }\n\n get prevRange() {\n const { perPageWithDefault: perPage, pageWithDefault: page } = this;\n const start = Math.max(1, (page - 2) * perPage + 1);\n const end = (page - 1) * perPage;\n return `${start} - ${end}`;\n }\n\n get totalPages() {\n const { pagesOnly, totalWithDefault: total, perPageWithDefault: perPage, pages } = this;\n\n if (pagesOnly && pages && !isNaN(parseInt(`${pages}`))) return pages;\n\n return Math.ceil(total / perPage);\n }\n\n ///////// HELPERS /////////\n\n removeResizeObserver() {\n if (this.resizeObserver) {\n this.resizeObserver?.unobserve(this.hostElement);\n this.resizeObserver = null;\n window.removeEventListener('resize', this.checkSize);\n }\n }\n\n handlePageChange = (page: number) => {\n const { totalPages, inputField } = this;\n if (page < 1) {\n page = 1;\n } else if (page > totalPages) {\n page = totalPages;\n }\n\n if (inputField.value !== `${page}`) inputField.value = `${page}`;\n\n if (!this.hostElement.onchange) {\n this.page = page;\n }\n\n this.change.emit({ page });\n };\n\n checkSize = () => {\n const { hostElement, containerElement } = this;\n const isOverflowing = this.containerWidth > hostElement.clientWidth;\n this.isSmall = isOverflowing;\n if (isOverflowing) return;\n\n nextPaint(() => {\n const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;\n if (containerWidthHasNotChanged) return;\n this.containerWidth = containerElement.clientWidth;\n this.checkSize();\n });\n };\n\n render() {\n const {\n pagesOnly,\n recordsOnly,\n isFullViewHidden,\n recordTypeWithDefault: recordType,\n totalPages,\n totalWithDefault: total,\n pageWithDefault: page,\n currentRange,\n nextRange,\n prevRange,\n } = this;\n const onFirstPage = page === 1;\n const onLastPage = page === totalPages;\n\n let nextButtonLabel: string = '';\n let prevButtonLabel: string = '';\n if (pagesOnly) {\n prevButtonLabel = loc('tecton.element.pagination.goToPages', { next: page - 1, total: totalPages });\n nextButtonLabel = loc('tecton.element.pagination.goToPages', { next: page + 1, total: totalPages });\n } else if (recordsOnly) {\n prevButtonLabel = loc('tecton.element.pagination.goToRecords', {\n range: prevRange,\n recordType: recordType.toLowerCase(),\n total,\n });\n nextButtonLabel = loc('tecton.element.pagination.goToRecords', {\n range: nextRange,\n recordType: recordType.toLowerCase(),\n total,\n });\n }\n\n return (\n <nav\n class=\"container\"\n ref={el => (this.containerElement = el)}\n aria-label={loc('tecton.element.pagination.title')}\n >\n <div\n class=\"description\"\n test-id=\"description\"\n >\n {pagesOnly\n ? loc('tecton.element.pagination.pages', {\n current: page,\n total: totalPages,\n })\n : loc('tecton.element.pagination.description', {\n range: currentRange,\n recordType: recordType.toLowerCase(),\n total: total.toLocaleString(),\n })}\n </div>\n <div class=\"btn-group\">\n <q2-btn\n label={loc('tecton.element.pagination.goToFirstPage')}\n disabled={onFirstPage}\n hidden={isFullViewHidden}\n onClick={() => this.handlePageChange(1)}\n test-id=\"firstPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-double-left\" />\n </q2-btn>\n <q2-btn\n label={prevButtonLabel}\n disabled={onFirstPage}\n onClick={() => this.handlePageChange(page - 1)}\n test-id=\"prevPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-left\" />\n </q2-btn>\n </div>\n <div\n class=\"controls\"\n hidden={isFullViewHidden}\n test-id=\"controls\"\n >\n <span aria-hidden=\"true\">{loc('tecton.element.pagination.page')}</span>\n <div\n class=\"input-wrapper\"\n onClick={() => this.inputField.dispatchEvent(new FocusEvent('focus'))}\n >\n <q2-input\n type=\"number\"\n value={`${page}`}\n min={1}\n max={this.totalPages}\n hideLabel\n optional\n label={`${loc('tecton.element.pagination.page')} (${loc(\n 'tecton.element.pagination.ofPages',\n [totalPages.toLocaleString()]\n )})`}\n onChange={event => this.handlePageChange(event.detail.value)}\n test-id=\"pageInput\"\n current=\"page\"\n ref={el => (this.inputField = el)}\n ></q2-input>\n </div>\n <span aria-hidden=\"true\">\n {loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()])}\n </span>\n </div>\n <div class=\"btn-group\">\n <q2-btn\n label={nextButtonLabel}\n disabled={onLastPage}\n onClick={() => this.handlePageChange(page + 1)}\n test-id=\"nextPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-right\" />\n </q2-btn>\n <q2-btn\n label=\"tecton.element.pagination.goToLastPage\"\n disabled={onLastPage}\n hidden={isFullViewHidden}\n onClick={() => this.handlePageChange(totalPages)}\n test-id=\"lastPageBtn\"\n hide-label\n >\n <q2-icon type=\"chevron-double-right\" />\n </q2-btn>\n </div>\n </nav>\n );\n }\n}\n"],"mappings":"6GAAA,MAAMA,EAAkB,g/DACxB,MAAAC,EAAeD,E,MCcFE,EAAY,M,wDAsJrBC,KAAAC,iBAAoBC,IAChB,MAAMC,WAAEA,EAAUC,WAAEA,GAAeJ,KACnC,GAAIE,EAAO,EAAG,CACVA,EAAO,C,MACJ,GAAIA,EAAOC,EAAY,CAC1BD,EAAOC,C,CAGX,GAAIC,EAAWC,QAAU,GAAGH,IAAQE,EAAWC,MAAQ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,IAAA,2CACIC,MAAM,WACNO,OAAQ3C,EAAgB,UAChB,YAERkC,EAAA,QAAAC,IAAA,yDAAkB,QAAQxB,EAAI,mCAC9BuB,EAAA,OAAAC,IAAA,2CACIC,MAAM,gBACNQ,QAAS,IAAM/E,KAAKI,WAAW6E,cAAc,IAAIC,WAAW,WAE5Db,EAAA,YAAAC,IAAA,2CACIU,KAAK,SACL3E,MAAO,GAAGH,IACViD,IAAK,EACLG,IAAKtD,KAAKG,WACVgF,UAAS,KACTC,SAAQ,KACRR,MAAO,GAAG9B,EAAI,sCAAsCA,EAChD,oCACA,CAAC3C,EAAWwE,sBAEhBU,SAAUpD,GAASjC,KAAKC,iBAAiBgC,EAAMqD,OAAOjF,OAAM,UACpD,YACRqE,QAAQ,OACRF,IAAKC,GAAOzE,KAAKI,WAAaqE,KAGtCJ,EAAA,QAAAC,IAAA,yDAAkB,QACbxB,EAAI,oCAAqC,CAAC3C,EAAWwE,qBAG9DN,EAAA,OAAAC,IAAA,2CAAKC,MAAM,aACPF,EAAA,UAAAC,IAAA,2CACIM,MAAOZ,EACPa,SAAUd,EACVgB,QAAS,IAAM/E,KAAKC,iBAAiBC,EAAO,GAAE,UACtC,cAAa,mBAGrBmE,EAAA,WAAAC,IAAA,2CAASU,KAAK,mBAElBX,EAAA,UAAAC,IAAA,2CACIM,MAAM,yCACNC,SAAUd,EACVe,OAAQ3C,EACR4C,QAAS,IAAM/E,KAAKC,iBAAiBE,GAAW,UACxC,cAAa,mBAGrBkE,EAAA,WAAAC,IAAA,2CAASU,KAAK,2B"}
@@ -1,2 +1,2 @@
1
- import{r as e,c as a,h as t,H as r,g as o}from"./p-a5f18e27.js";import{l as n}from"./p-5c46acb8.js";const s="*{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-carousel .swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;transition:all 0.2s}q2-carousel-pane.q2-carousel-pane{--comp-carousel-pane-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));--comp-carousel-shadow:var(--app-shadow-2, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));cursor:grab}q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) *{cursor:pointer}q2-carousel-pane.q2-carousel-pane:focus{box-shadow:none}q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content{outline:none;box-shadow:var(--const-double-focus-ring)}q2-carousel-pane.q2-carousel-pane button{border:0;background:transparent;transition:all 0.2s;opacity:0.3;cursor:pointer}q2-carousel-pane.q2-carousel-pane button:hover{opacity:0.7}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content{box-shadow:var(--comp-carousel-shadow);transition:var(--comp-carousel-pane-tween);background:var(--tct-carousel-background, var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff)))));border:var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 0px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));border-radius:var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));padding:var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 7px));height:var(--tct-carousel-pane-height, var(--t-carousel-pane-height, 10em))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content:hover{box-shadow:var(--const-double-focus-ring), var(--comp-carousel-shadow)}";const i=s;const c=class{constructor(t){e(this,t);this.clickCarouselPane=a(this,"clickCarouselPane",7);this.generatePaneClass=e=>`q2-carousel-pane swiper-slide q2-carousel-pane-${e}`;this.paneClicked=e=>{if(this.isActivePane)return;e.preventDefault();this.clickCarouselPane.emit({paneIndex:this.index,pane:this.hostElement})};this.index=undefined;this.siblingCount=undefined;this.isActivePane=undefined;this.label=undefined}get currentPaneIndex(){return Array.prototype.indexOf.call(this.hostElement.parentElement.children,this.hostElement)}componentDidLoad(){this.determineDisabledContent()}determineDisabledContent(){const{isActivePane:e}=this;const a=this.hostElement.querySelectorAll('q2-btn, a[href], button, [tabindex]:not([tabindex="-1"])');a.forEach((a=>{const t=a.hasAttribute("tabindex")&&parseInt(a.getAttribute("tabindex"))>=0;if(t){a.dataset.q2Tabindex=`${a.tabIndex}`}if(e){if(a.hasAttribute("data-q2-tabindex")){a.tabIndex=parseInt(a.getAttribute("data-q2-tabindex"));a.removeAttribute("data-q2-tabindex")}else if(a.tagName.startsWith("Q2-")){a.tabIndex=undefined}else{a.removeAttribute("tabindex")}}else{a.tabIndex=-1}}))}render(){const{label:e}=this;return t(r,{key:"fd5d9d03af8d68ff9edfd8ed39fdf4186d7b36a2",class:this.generatePaneClass(this.currentPaneIndex),tabIndex:this.isActivePane?0:-1,role:"group","aria-roledescription":"slide","aria-hidden":this.isActivePane?undefined:"true","aria-label":e?n(e):n("tecton.element.carousel.itemDescription",[(this.currentPaneIndex+1).toString(),(this.siblingCount||0).toString()]),onClick:this.paneClicked},t("article",{key:"f947a07e8fae57beabcd93e7fc599701cedfacc6",class:"q2-carousel-pane-main-content"},t("slot",{key:"e35fc5d6f4bab2909902938ba205a9ceaaf0e1be"})))}get hostElement(){return o(this)}static get watchers(){return{isActivePane:["determineDisabledContent"]}}};c.style=i;export{c as q2_carousel_pane};
2
- //# sourceMappingURL=p-5b3f885f.entry.js.map
1
+ import{r as e,c as a,h as t,H as r,g as o}from"./p-a5f18e27.js";import{l as n}from"./p-42302f6f.js";const s="*{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-carousel .swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;transition:all 0.2s}q2-carousel-pane.q2-carousel-pane{--comp-carousel-pane-tween:var(--tct-tween-1, var(--app-tween-1, 0.2s ease));--comp-carousel-shadow:var(--app-shadow-2, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));cursor:grab}q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) *{cursor:pointer}q2-carousel-pane.q2-carousel-pane:focus{box-shadow:none}q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content{outline:none;box-shadow:var(--const-double-focus-ring)}q2-carousel-pane.q2-carousel-pane button{border:0;background:transparent;transition:all 0.2s;opacity:0.3;cursor:pointer}q2-carousel-pane.q2-carousel-pane button:hover{opacity:0.7}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content{box-shadow:var(--comp-carousel-shadow);transition:var(--comp-carousel-pane-tween);background:var(--tct-carousel-background, var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff)))));border:var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 0px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));border-radius:var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));padding:var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 7px));height:var(--tct-carousel-pane-height, var(--t-carousel-pane-height, 10em))}q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content:hover{box-shadow:var(--const-double-focus-ring), var(--comp-carousel-shadow)}q2-carousel-pane.q2-carousel-pane[slot-frameless]:not([slot-frameless=false]) .q2-carousel-pane-main-content{box-shadow:none;border:0;border-radius:0;padding:0}";const i=s;const c=class{constructor(t){e(this,t);this.clickCarouselPane=a(this,"clickCarouselPane",7);this.generatePaneClass=e=>`q2-carousel-pane swiper-slide q2-carousel-pane-${e}`;this.paneClicked=e=>{if(this.isActivePane)return;e.preventDefault();this.clickCarouselPane.emit({paneIndex:this.index,pane:this.hostElement})};this.index=undefined;this.siblingCount=undefined;this.isActivePane=undefined;this.label=undefined;this.slotFrameless=undefined}get currentPaneIndex(){return Array.prototype.indexOf.call(this.hostElement.parentElement.children,this.hostElement)}componentDidLoad(){this.determineDisabledContent()}determineDisabledContent(){const{isActivePane:e}=this;const a=this.hostElement.querySelectorAll('q2-btn, q2-dropdown, a[href], button, [tabindex]:not([tabindex="-1"])');a.forEach((a=>{const t=a.hasAttribute("tabindex")&&parseInt(a.getAttribute("tabindex"))>=0;if(t){a.setAttribute("data-q2-tabindex",`${a.tabIndex}`)}if(e){if(a.hasAttribute("data-q2-tabindex")){a.tabIndex=parseInt(a.getAttribute("data-q2-tabindex"));a.removeAttribute("data-q2-tabindex")}else if(a.tagName.startsWith("Q2-")){a.tabIndex=undefined}else{a.removeAttribute("tabindex")}}else{a.tabIndex=-1}}))}render(){const{label:e}=this;return t(r,{key:"3408598713aeea60c644c3ea0750f0dce2d40ca9",class:this.generatePaneClass(this.currentPaneIndex),tabIndex:this.isActivePane?0:-1,role:"group","aria-roledescription":"slide","aria-hidden":this.isActivePane?undefined:"true","aria-label":e?n(e):n("tecton.element.carousel.itemDescription",[(this.currentPaneIndex+1).toString(),(this.siblingCount||0).toString()]),onClick:this.paneClicked},t("article",{key:"a03a7125b958195b21d731f9cbeebdb1c8f9a0b3",class:"q2-carousel-pane-main-content"},t("slot",{key:"c07f1d5fc75a902a6f9741e746279bad8c094a13"})))}get hostElement(){return o(this)}static get watchers(){return{isActivePane:["determineDisabledContent"]}}};c.style=i;export{c as q2_carousel_pane};
2
+ //# sourceMappingURL=p-b7d5fd12.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["q2CarouselPaneCss","Q2CarouselPaneStyle0","Q2CarouselPane","this","generatePaneClass","currentIndex","paneClicked","event","isActivePane","preventDefault","clickCarouselPane","emit","paneIndex","index","pane","hostElement","currentPaneIndex","Array","prototype","indexOf","call","parentElement","children","componentDidLoad","determineDisabledContent","focusableElements","querySelectorAll","forEach","element","hasValidTabIndex","hasAttribute","parseInt","getAttribute","setAttribute","tabIndex","removeAttribute","tagName","startsWith","undefined","render","label","h","Host","key","class","role","loc","toString","siblingCount","onClick"],"sources":["src/components/q2-carousel-pane/q2-carousel-pane.scss?tag=q2-carousel-pane","src/components/q2-carousel-pane/q2-carousel-pane.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\nq2-carousel .swiper-slide {\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n position: relative;\n transition-property: transform;\n transition: all 0.2s;\n}\n\nq2-carousel-pane.q2-carousel-pane {\n --comp-carousel-pane-tween: #{var-list(--tct-tween-1, --app-tween-1, unquote('0.2s ease'))};\n --comp-carousel-shadow: #{var-list(--app-shadow-2, unquote('0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25))'))};\n\n cursor: grab;\n\n &:not([is-active-pane]) * {\n cursor: pointer;\n }\n\n &:focus {\n box-shadow: none;\n .q2-carousel-pane-main-content {\n outline: none;\n box-shadow: var(--const-double-focus-ring);\n }\n }\n\n button {\n border: 0;\n background: transparent;\n transition: all 0.2s;\n opacity: 0.3;\n cursor: pointer;\n\n &:hover {\n opacity: 0.7;\n }\n }\n\n .q2-carousel-pane-main-content {\n box-shadow: var(--comp-carousel-shadow);\n transition: var(--comp-carousel-pane-tween);\n background: var-list(\n --tct-carousel-background,\n var-prefixer(carousel-background-color),\n --tct-white,\n --app-white,\n #ffffff\n );\n border: var-list(var-prefixer(carousel-pane-border-width), 0px) solid\n var-list(\n var-prefixer(carousel-pane-border-color),\n var-prefixer(gray-11),\n --tct-gray-l1,\n --app-gray-l1,\n #cccccc\n );\n border-radius: var-list(var-prefixer(carousel-pane-border-radius), 8px);\n padding: var-list(var-prefixer(carousel-pane-padding), 7px);\n height: var-list(var-prefixer(carousel-pane-height), 10em);\n }\n\n .q2-carousel-pane-main-content:hover {\n box-shadow: var(--const-double-focus-ring), var(--comp-carousel-shadow);\n }\n &[slot-frameless]:not([slot-frameless='false']) {\n .q2-carousel-pane-main-content {\n box-shadow: none;\n border: 0;\n border-radius: 0;\n padding: 0;\n }\n }\n}\n","import { Component, ComponentInterface, Event, Element, Host, Watch, Prop, h, EventEmitter } from '@stencil/core';\nimport { loc } from 'src/utils';\n\n@Component({ tag: 'q2-carousel-pane', shadow: false, styleUrl: 'q2-carousel-pane.scss' })\nexport class Q2CarouselPane implements ComponentInterface {\n /**\n * Used by q2-carousel to determine the pane's index.\n * @private\n */\n @Prop({ reflect: false }) index: number;\n\n /**\n * Used by q2-carousel to indicate how many panes are in the carousel.\n * @private\n */\n @Prop({ reflect: false }) siblingCount: number;\n\n /**\n * Used by `q2-carousel` to indicate which pane is currently active.\n * @private\n */\n @Prop({ reflect: true }) isActivePane: boolean;\n\n /**\n * Text used only as an `aria-label` for accessibility purposes.\n * @localizable\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * Used by `q2-carousel` to indicate the pane should be frameless\n * @private\n */\n @Prop({ reflect: true }) slotFrameless: boolean;\n\n @Element() hostElement: HTMLElement;\n\n get currentPaneIndex() {\n return Array.prototype.indexOf.call(this.hostElement.parentElement.children, this.hostElement);\n }\n\n componentDidLoad(): void {\n this.determineDisabledContent();\n }\n\n generatePaneClass = (currentIndex: number) => {\n return `q2-carousel-pane swiper-slide q2-carousel-pane-${currentIndex}`;\n };\n\n /**\n * Emitted when the pane is clicked.\n */\n @Event() clickCarouselPane: EventEmitter<{ paneIndex: number; pane: HTMLElement }>;\n\n paneClicked = event => {\n if (this.isActivePane) return;\n event.preventDefault();\n this.clickCarouselPane.emit({\n paneIndex: this.index,\n pane: this.hostElement,\n });\n };\n\n @Watch('isActivePane')\n determineDisabledContent() {\n const { isActivePane } = this;\n const focusableElements = this.hostElement.querySelectorAll<HTMLElement>(\n 'q2-btn, q2-dropdown, a[href], button, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n focusableElements.forEach(element => {\n const hasValidTabIndex =\n element.hasAttribute('tabindex') && parseInt(element.getAttribute('tabindex')) >= 0;\n\n if (hasValidTabIndex) {\n element.setAttribute('data-q2-tabindex', `${element.tabIndex}`);\n }\n\n if (isActivePane) {\n if (element.hasAttribute('data-q2-tabindex')) {\n element.tabIndex = parseInt(element.getAttribute('data-q2-tabindex'));\n element.removeAttribute('data-q2-tabindex');\n } else if (element.tagName.startsWith('Q2-')) {\n element.tabIndex = undefined;\n } else {\n element.removeAttribute('tabindex');\n }\n } else {\n element.tabIndex = -1;\n }\n });\n }\n\n render() {\n const { label } = this;\n\n return (\n <Host\n class={this.generatePaneClass(this.currentPaneIndex)}\n tabIndex={this.isActivePane ? 0 : -1}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-hidden={this.isActivePane ? undefined : 'true'}\n aria-label={\n label\n ? loc(label)\n : loc('tecton.element.carousel.itemDescription', [\n (this.currentPaneIndex + 1).toString(),\n (this.siblingCount || 0).toString(),\n ])\n }\n onClick={this.paneClicked}\n >\n <article class=\"q2-carousel-pane-main-content\">\n <slot></slot>\n </article>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAoB,sgFAC1B,MAAAC,EAAeD,E,MCGFE,EAA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H,EAAA,QAAAE,IAAA,8C"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as r,F as i,g as o}from"./p-a5f18e27.js";import{o as a,i as s,l as n}from"./p-5c46acb8.js";const l='*{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;position:relative}ul{--comp-bullet-background:var(--tct-stepper-bullet-active-background, 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-btn-icon-size, var(--t-stepper-btn-icon-size, 24px));--comp-bullet-gap:var(--tct-stepper-btn-gap, var(--t-stepper-btn-gap, var(--app-scale-3x, 15px)));--comp-bullet-font-size:var-list(var-prefixer(stepper-btn-label-font-size), 16px);--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-btn-icon-size:var(--tct-stepper-btn-icon-size, var(--t-stepper-btn-icon-size, 24px));--comp-btn-label-font-size:var-list(var-prefixer(stepper-btn-label-font-size), 16px);--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;margin-top:2px;--comp-active-color:var(--comp-bullet-background)}.step-btn.status-complete{--comp-active-color:var(--const-stoplight-success, #0e8a00)}.step-btn.status-error{--comp-active-color:var(--const-stoplight-alert, #d20a0a)}.step-btn[aria-disabled]{cursor:not-allowed}.step-btn[aria-disabled],.step-btn[aria-disabled]+.step-divider{--comp-bullet-font-color:var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));--comp-bullet-background:var(--tct-stepper-bullet-inactive-background, var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray-12, #d9d9d9))))}.step-icon,.step-bubble{display:flex;justify-content:center;align-items:center;line-height:0;margin:var(--comp-bullet-gap) auto;color:var(--comp-bullet-font-color);width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);min-height:var(--comp-btn-icon-size);font-size:var(--comp-bullet-font-size);transition:var(--comp-tween);transition-property:background, color;border-radius:50%;position:relative}.step-icon q2-icon,.step-bubble q2-icon{--tct-icon-fill:var(--comp-active-color)}.step-icon q2-icon:before,.step-bubble q2-icon:before{content:"";display:block;background:var(--comp-bullet-font-color);position:absolute;width:80%;height:80%;left:11%;top:11%;border-radius:50%}.status-complete .step-icon,.status-error .step-icon,.status-complete .step-bubble,.status-error .step-bubble{background:var(--comp-active-color)}[aria-selected] .step-icon,[aria-selected] .step-bubble{box-shadow:0 0 0 2px var(--t-base, #ffffff), 0 0 0 4px var(--comp-active-color);font-weight:var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600))}.step-bubble{background:var(--comp-bullet-background)}.step-divider{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-background);height:0;position:absolute;margin:0;transition:border var(--comp-tween)}.step-container{position:relative}.step-label{color:var(--tct-stepper-label-color, var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d))));font-size:var(--tct-stepper-label-font-size, var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px))));line-height:var(--tct-stepper-label-line-height, 1.5em);text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--tct-stepper-label-line-count, 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:var(--tct-stepper-label-line-count, 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:var(--tct-stepper-description-line-count, 4);-webkit-box-orient:vertical;padding-bottom:0.2em}.step-description .ellipsize{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:var(--comp-step-width);display:block}.gradient-left,.gradient-right{z-index:1;position:absolute;top:0;height:100%;width:18px}.gradient-left{background-image:linear-gradient(to left, var(--t-base-a0, rgba(255, 255, 255, 0)), var(--t-base-a2, rgba(255, 255, 255, 0.5)) 10%, var(--t-base, #ffffff) 100%);left:0}.gradient-right{background-image:linear-gradient(to right, var(--t-base-a0, rgba(255, 255, 255, 0)), var(--t-base-a2, rgba(255, 255, 255, 0.5)) 10%, var(--t-base, #ffffff) 100%);right:0}.btn-left,.btn-right{--tct-icon-size:18px;--tct-btn-icon-hover-background: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 q2-icon,.btn-right q2-icon{--tct-icon-stroke-width:3}.btn-left{left:0}.btn-right{right:0}';const c=l;const p=class{constructor(r){t(this,r);this.change=e(this,"change",7);this.scheduledAfterRender=[];this.onSlotChange=()=>{this.checkForPanes();this.checkScrollState()};this.onScrollBtnClick=t=>{const e=Math.floor(this.listElement.clientWidth/2);this.listElement.scrollBy({left:t==="left"?-e:e,behavior:"smooth"})};this.onStepClick=(t,e)=>{t.stopPropagation();const{currentStep:r,stepCount:i,lastEnabledStep:o}=this;if(e>o||e===r)return;this.change.emit({selectedStep:e,lastEnabledStep:o,currentStep:r,stepCount:i})};this.onStepKeyDown=(t,e)=>{const{lastEnabledStep:r,stepCount:i}=this;const{key:o}=t;let a;switch(o){case"ArrowLeft":t.preventDefault();a=Math.max(e-1,0);break;case"ArrowRight":t.preventDefault();a=Math.min(e+1,i);break;case"Home":t.preventDefault();a=1;break;case"End":t.preventDefault();a=r;break}if(!a)return;this.focusStep(a,true)};this.checkForPanes=()=>{const{allPanes:t}=this;if(!t.length)return;this.stepCount=t.length};this.checkScrollState=()=>{if(!this.listElement)return;const{scrollLeft:t,scrollWidth:e,clientWidth:r}=this.listElement;this.scrollEnabled=e>r;this.showScrollLeft=!!t;this.showScrollRight=e!==t+r};this.currentStep=1;this.stepCount=undefined;this.lastEnabledStep=undefined;this.contentChangeTriggerCount=0;this.scrollEnabled=false;this.showScrollLeft=false;this.showScrollRight=false}componentWillLoad(){if(!this.lastEnabledStep)this.lastEnabledStep=this.currentStep||1;this.resizeObserver=new ResizeObserver((()=>this.checkScrollState()));this.checkForPanes()}componentDidLoad(){this.resizeObserver.observe(this.listElement);this.checkScrollState();a(this.hostElement);setTimeout((()=>this.showStep(this.currentStep||1)),0)}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}disconnectedCallback(){this.resizeObserver.disconnect()}currentStepChanged(t){this.showStep(t)}defaultChangeHandler(t){const{hostElement:e}=this;if(t.target===e&&!e.getAttribute("onchange")&&!!t.detail){this.currentStep=t.detail.selectedStep}}delegateFocus(t){if(!s(t,this.hostElement))return;this.focusStep(this.currentStep,true,true)}statusChangeHandler(t){const e=Array.from(this.allPanes).findIndex((e=>t.detail.id===e.id));if(e>-1){this.allPanes[e].status=t.detail.status;this.renderStepBtn(e)}}contentChangeHandler(){this.contentChangeTriggerCount+=1}get allPanes(){return this.hostElement.querySelectorAll("q2-stepper-pane")}showStep(t){if(t>this.lastEnabledStep){const{currentStep:e,stepCount:r}=this;this.lastEnabledStep=t;this.change.emit({selectedStep:null,lastEnabledStep:t,currentStep:e,stepCount:r})}this.scheduledAfterRender.push(this.resizeIframe);this.showStepPane(t);this.focusStep(t,this.scrollEnabled)}resizeIframe(){var t,e;return(e=(t=window===null||window===void 0?void 0:window.TectonElements)===null||t===void 0?void 0:t.resizeIframe)===null||e===void 0?void 0:e.call(t)}showStepPane(t){this.allPanes.forEach(((e,r)=>{e.isActive=t===r+1}))}focusStep(t,e,r){var i;const o=this.listElement.children[t-1];const a=document.activeElement===this.hostElement;if(!o)return;if(a||r){(i=o.firstElementChild)===null||i===void 0?void 0:i.focus()}if(e){const t=o.offsetLeft-this.listElement.clientWidth/2;this.listElement.scrollTo({left:t,behavior:"smooth"})}}getPaneSlotOrProperty(t,e){var r;const i=t.querySelector(`[slot="${e}"]`);return(r=i===null||i===void 0?void 0:i.outerHTML)!==null&&r!==void 0?r:n(t[e])}renderStepBtn(t){var e;const{allPanes:o,stepCount:a,currentStep:s,lastEnabledStep:l}=this;const c=(e=o===null||o===void 0?void 0:o[t])!==null&&e!==void 0?e:null;const{id:p,status:b}=c;const d=this.getPaneSlotOrProperty(c,"label");const h=this.getPaneSlotOrProperty(c,"description");const v=t+1;const u=v===s;const f=!!d&&`label-${p}`;const g=!!d&&!!h&&`description-${p}`;const m=!d&&n("tecton.element.stepper.number",[`${v}`,`${a}`]);let w;if(b==="complete")w="success-filled";else if(b==="error")w="warning-filled";const x=["step-btn"];if(b)x.push(`status-${b}`);const k=b==="locked";const y=k||v>l;return r("li",{role:"presentation"},r("button",{class:x.join(" "),type:"button","aria-labelledby":f,"aria-describedBy":g,"aria-label":m,"aria-selected":u,"aria-controls":p,"aria-disabled":y?"true":null,role:"tab",tabIndex:u?0:-1,onKeyDown:t=>this.onStepKeyDown(t,v),onClick:t=>!k&&this.onStepClick(t,v)},r(i,null,w?r("div",{class:"step-icon"},r("q2-icon",{type:w})):r("div",{class:"step-bubble"},v),f&&r("div",{class:"step-label",id:f,innerHTML:d}),f&&g&&r("div",{class:"step-description",id:g,innerHTML:h}))),t?r("div",{class:"step-divider"}):"")}render(){const{stepCount:t,scrollEnabled:e,showScrollLeft:o,showScrollRight:a}=this;const s=["step-container"];if(e)s.push("has-scroll");return r(i,{key:"965d2f62ad31f1261ac4b5075b5c9b81314ec0ea"},r("div",{key:"38f57eda34c0c8bda0ebe56cb3a8ab6a5923eea4",class:s.join(" ")},e&&r(i,{key:"0f07c432180e66c9381ad74ee21523954af7b5ba"},r("div",{key:"2ecfa2e708506d28de8d6d3ccb6c8e79c239e8cc",class:"gradient-left",hidden:!o}),r("div",{key:"1059a8cd55972546358d68fb9db5c20a8cbdb66d",class:"gradient-right",hidden:!a}),r("q2-btn",{key:"a2d33950402827781ff23fe6afdae01b9aac6a27",class:"btn-left",hidden:!this.showScrollLeft,onClick:()=>this.onScrollBtnClick("left")},r("q2-icon",{key:"1af94b1d9408aaa913b43e9b76e7e5f1b6da4617",type:"chevron-left"})),r("q2-btn",{key:"f323277f414a4fb7a8c29a4c9b25becdb19aab14",class:"btn-right",hidden:!this.showScrollRight,onClick:()=>this.onScrollBtnClick("right")},r("q2-icon",{key:"8610ca1651bef3e92133ec52802082f66b95d04f",type:"chevron-right"}))),r("ul",{key:"6362aa56e9e76be08956f9d413b1a16a0f844273",onScroll:this.checkScrollState,ref:t=>this.listElement=t,role:"tablist"},t>0&&[...Array(t).keys()].map((t=>this.renderStepBtn(t))))),r("div",{key:"7bc7f714397f19db7fb208919c35a1e6fe9f0757"},r("slot",{key:"af091365538eae26e68a0086b4f099960015c26f",onSlotchange:()=>this.onSlotChange()})))}get hostElement(){return o(this)}static get watchers(){return{currentStep:["currentStepChanged"]}}};p.style=c;export{p as q2_stepper};
2
- //# sourceMappingURL=p-cb30f949.entry.js.map
1
+ import{r as t,c as e,h as r,F as i,g as o}from"./p-a5f18e27.js";import{o as s,i as a,l as n}from"./p-42302f6f.js";const l='*{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;position:relative}ul{--comp-bullet-background:var(--tct-stepper-bullet-active-background, 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-btn-icon-size, var(--t-stepper-btn-icon-size, 24px));--comp-bullet-gap:var(--tct-stepper-btn-gap, var(--t-stepper-btn-gap, var(--app-scale-3x, 15px)));--comp-bullet-font-size:var-list(var-prefixer(stepper-btn-label-font-size), 16px);--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-btn-icon-size:var(--tct-stepper-btn-icon-size, var(--t-stepper-btn-icon-size, 24px));--comp-btn-label-font-size:var-list(var-prefixer(stepper-btn-label-font-size), 16px);--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;margin-top:2px;--comp-active-color:var(--comp-bullet-background)}.step-btn.status-complete{--comp-active-color:var(--const-stoplight-success, #0e8a00)}.step-btn.status-error{--comp-active-color:var(--const-stoplight-alert, #d20a0a)}.step-btn[aria-disabled]{cursor:not-allowed}.step-btn[aria-disabled],.step-btn[aria-disabled]+.step-divider{--comp-bullet-font-color:var(--tct-stepper-bullet-inactive-font-color, var(--t-stepper-bullet-inactive-font-color, var(--t-text, #4d4d4d)));--comp-bullet-background:var(--tct-stepper-bullet-inactive-background, var(--tct-stepper-bullet-inactive-bg, var(--t-stepper-bullet-inactive-bg, var(--t-gray-12, #d9d9d9))))}.step-icon,.step-bubble{display:flex;justify-content:center;align-items:center;line-height:0;margin:var(--comp-bullet-gap) auto;color:var(--comp-bullet-font-color);width:var(--comp-btn-icon-size);height:var(--comp-btn-icon-size);min-height:var(--comp-btn-icon-size);font-size:var(--comp-bullet-font-size);transition:var(--comp-tween);transition-property:background, color;border-radius:50%;position:relative}.step-icon q2-icon,.step-bubble q2-icon{--tct-icon-fill:var(--comp-active-color)}.step-icon q2-icon:before,.step-bubble q2-icon:before{content:"";display:block;background:var(--comp-bullet-font-color);position:absolute;width:80%;height:80%;left:11%;top:11%;border-radius:50%}.status-complete .step-icon,.status-error .step-icon,.status-complete .step-bubble,.status-error .step-bubble{background:var(--comp-active-color)}[aria-selected] .step-icon,[aria-selected] .step-bubble{box-shadow:0 0 0 2px var(--t-base, #ffffff), 0 0 0 4px var(--comp-active-color);font-weight:var(--tct-stepper-bullet-active-font-weight, var(--t-stepper-bullet-active-font-weight, 600))}.step-bubble{background:var(--comp-bullet-background)}.step-divider{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-background);height:0;position:absolute;margin:0;transition:border var(--comp-tween)}.step-container{position:relative}.step-label{color:var(--tct-stepper-label-color, var(--tct-stepper-title-color, var(--t-stepper-title-color, var(--t-text, #4d4d4d))));font-size:var(--tct-stepper-label-font-size, var(--tct-stepper-title-font-size, var(--t-stepper-title-font-size, var(--app-font-size-small, 12px))));line-height:var(--tct-stepper-label-line-height, 1.5em);text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--tct-stepper-label-line-count, 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:var(--tct-stepper-label-line-count, 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:var(--tct-stepper-description-line-count, 4);-webkit-box-orient:vertical;padding-bottom:0.2em}.step-description .ellipsize{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:var(--comp-step-width);display:block}.gradient-left,.gradient-right{z-index:1;position:absolute;top:0;height:100%;width:18px}.gradient-left{background-image:linear-gradient(to left, var(--t-base-a0, rgba(255, 255, 255, 0)), var(--t-base-a2, rgba(255, 255, 255, 0.5)) 10%, var(--t-base, #ffffff) 100%);left:0}.gradient-right{background-image:linear-gradient(to right, var(--t-base-a0, rgba(255, 255, 255, 0)), var(--t-base-a2, rgba(255, 255, 255, 0.5)) 10%, var(--t-base, #ffffff) 100%);right:0}.btn-left,.btn-right{--tct-icon-size:18px;--tct-btn-icon-hover-background: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 q2-icon,.btn-right q2-icon{--tct-icon-stroke-width:3}.btn-left{left:0}.btn-right{right:0}';const c=l;const p=class{constructor(r){t(this,r);this.change=e(this,"change",7);this.scheduledAfterRender=[];this.onSlotChange=()=>{this.checkForPanes();this.checkScrollState()};this.onScrollBtnClick=t=>{const e=Math.floor(this.listElement.clientWidth/2);this.listElement.scrollBy({left:t==="left"?-e:e,behavior:"smooth"})};this.onStepClick=(t,e)=>{t.stopPropagation();const{currentStep:r,stepCount:i,lastEnabledStep:o}=this;if(e>o||e===r)return;this.change.emit({selectedStep:e,lastEnabledStep:o,currentStep:r,stepCount:i})};this.onStepKeyDown=(t,e)=>{const{lastEnabledStep:r,stepCount:i}=this;const{key:o}=t;let s;switch(o){case"ArrowLeft":t.preventDefault();s=Math.max(e-1,0);break;case"ArrowRight":t.preventDefault();s=Math.min(e+1,i);break;case"Home":t.preventDefault();s=1;break;case"End":t.preventDefault();s=r;break}if(!s)return;this.focusStep(s,true)};this.checkForPanes=()=>{const{allPanes:t}=this;if(!t.length)return;this.stepCount=t.length};this.checkScrollState=()=>{if(!this.listElement)return;const{scrollLeft:t,scrollWidth:e,clientWidth:r}=this.listElement;this.scrollEnabled=e>r;this.showScrollLeft=!!t;this.showScrollRight=e!==t+r};this.currentStep=1;this.stepCount=undefined;this.lastEnabledStep=undefined;this.contentChangeTriggerCount=0;this.scrollEnabled=false;this.showScrollLeft=false;this.showScrollRight=false}componentWillLoad(){if(!this.lastEnabledStep)this.lastEnabledStep=this.currentStep||1;this.resizeObserver=new ResizeObserver((()=>this.checkScrollState()));this.checkForPanes()}componentDidLoad(){this.resizeObserver.observe(this.listElement);this.checkScrollState();s(this.hostElement);setTimeout((()=>this.showStep(this.currentStep||1)),0)}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}disconnectedCallback(){this.resizeObserver.disconnect()}currentStepChanged(t){this.showStep(t)}defaultChangeHandler(t){const{hostElement:e}=this;if(t.target===e&&!e.getAttribute("onchange")&&!!t.detail){this.currentStep=t.detail.selectedStep}}delegateFocus(t){if(!a(t,this.hostElement))return;this.focusStep(this.currentStep,true,true)}statusChangeHandler(t){const e=Array.from(this.allPanes).findIndex((e=>t.detail.id===e.id));if(e>-1){this.allPanes[e].status=t.detail.status;this.renderStepBtn(e)}}contentChangeHandler(){this.contentChangeTriggerCount+=1}get allPanes(){return this.hostElement.querySelectorAll("q2-stepper-pane")}showStep(t){if(t>this.lastEnabledStep){const{currentStep:e,stepCount:r}=this;this.lastEnabledStep=t;this.change.emit({selectedStep:null,lastEnabledStep:t,currentStep:e,stepCount:r})}this.scheduledAfterRender.push(this.resizeIframe);this.showStepPane(t);this.focusStep(t,this.scrollEnabled)}resizeIframe(){var t,e;return(e=(t=window===null||window===void 0?void 0:window.TectonElements)===null||t===void 0?void 0:t.resizeIframe)===null||e===void 0?void 0:e.call(t)}showStepPane(t){this.allPanes.forEach(((e,r)=>{e.isActive=t===r+1}))}focusStep(t,e,r){var i;const o=this.listElement.children[t-1];const s=document.activeElement===this.hostElement;if(!o)return;if(s||r){(i=o.firstElementChild)===null||i===void 0?void 0:i.focus()}if(e){const t=o.offsetLeft-this.listElement.clientWidth/2;this.listElement.scrollTo({left:t,behavior:"smooth"})}}getPaneSlotOrProperty(t,e){var r;const i=t.querySelector(`[slot="${e}"]`);return(r=i===null||i===void 0?void 0:i.outerHTML)!==null&&r!==void 0?r:n(t[e])}renderStepBtn(t){var e;const{allPanes:o,stepCount:s,currentStep:a,lastEnabledStep:l}=this;const c=(e=o===null||o===void 0?void 0:o[t])!==null&&e!==void 0?e:null;const{id:p,status:d}=c;const b=this.getPaneSlotOrProperty(c,"label");const h=this.getPaneSlotOrProperty(c,"description");const v=t+1;const u=v===a;const f=!!b&&`label-${p}`;const g=!!b&&!!h&&`description-${p}`;const m=!b&&n("tecton.element.stepper.number",[`${v}`,`${s}`]);let w;if(d==="complete")w="success-filled";else if(d==="error")w="warning-filled";const x=["step-btn"];if(d)x.push(`status-${d}`);const k=d==="locked";const y=k||v>l;return r("li",{role:"presentation"},r("button",{class:x.join(" "),type:"button","aria-labelledby":f,"aria-describedBy":g,"aria-label":m,"aria-selected":u,"aria-controls":p,"aria-disabled":y?"true":null,role:"tab",tabIndex:u?0:-1,onKeyDown:t=>this.onStepKeyDown(t,v),onClick:t=>!k&&this.onStepClick(t,v)},r(i,null,w?r("div",{class:"step-icon"},r("q2-icon",{type:w})):r("div",{class:"step-bubble"},v),f&&r("div",{class:"step-label",id:f,innerHTML:b}),f&&g&&r("div",{class:"step-description",id:g,innerHTML:h}))),t?r("div",{class:"step-divider"}):"")}render(){const{stepCount:t,scrollEnabled:e,showScrollLeft:o,showScrollRight:s}=this;const a=["step-container"];if(e)a.push("has-scroll");return r(i,{key:"0725d44fe3643cf8cfa22615c2e84c1b2d94c73a"},r("div",{key:"cce4ed1010c247e4a73a9875fd3ca3d2aff40308",class:a.join(" ")},e&&r(i,{key:"3308619f909ba2d72587e285502c1e5bde37eec1"},r("div",{key:"d41c11095e7710bd23a59dba23d1730c9a129782",class:"gradient-left",hidden:!o}),r("div",{key:"9537b4b2b45e388be063e623b01b271e6b6f952c",class:"gradient-right",hidden:!s}),r("q2-btn",{key:"4d6cc7e82d6ead7bcd5ec2a9cadb6c224bf54644",class:"btn-left",hidden:!this.showScrollLeft,onClick:()=>this.onScrollBtnClick("left")},r("q2-icon",{key:"cd9eb6d9868eafd32c84d3b60b6f798d3327e3f8",type:"chevron-left"})),r("q2-btn",{key:"61ef838d8648d998e5d69ee1b2b4d14659dcd43c",class:"btn-right",hidden:!this.showScrollRight,onClick:()=>this.onScrollBtnClick("right")},r("q2-icon",{key:"b6542d47f5eeb4c1208c1405d03b49199d7245f6",type:"chevron-right"}))),r("ul",{key:"3065e3524afc7071ec57260511c30bb769218998",onScroll:this.checkScrollState,ref:t=>this.listElement=t,role:"tablist"},t>0&&[...Array(t).keys()].map((t=>this.renderStepBtn(t))))),r("div",{key:"66838a87e2dcebe837fccc32557e1639a1f961fc"},r("slot",{key:"bdda7acf5353fd55e3f643826e30619f0b6f9bdf",onSlotchange:()=>this.onSlotChange()})))}get hostElement(){return o(this)}static get watchers(){return{currentStep:["currentStepChanged"]}}};p.style=c;export{p as q2_stepper};
2
+ //# sourceMappingURL=p-bf125cdf.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e,g as i}from"./p-a5f18e27.js";import{f as s}from"./p-42302f6f.js";const n="*{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}*{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([bordered]:not([bordered=false])) ::slotted(q2-item:not(:last-child)),:host([bordered]:not([bordered=false])) .header{border-bottom:var(--tct-list-item-separator, 1px solid #949494)}.header{--comp-default-header-padding:var(--app-scale-2x, 8px) var(--app-scale-4x, 16px);display:flex;gap:var(--app-scale-3x, 12px);padding:var(--tct-list-header-padding, var(--tct-item-padding, var(--comp-default-header-padding)));min-height:var(--tct-list-header-min-height, var(--t-list-header-min-height, 44px))}.header-spacebetween{justify-content:space-between}.header-start{justify-content:flex-start}.header-end{justify-content:flex-end}.header .label{width:100%;height:var(--tct-list-label-height, 44px);line-height:var(--tct-list-label-line-height, 44px);font-size:var(--tct-list-label-font-size, 16px);font-weight:var(--tct-list-label-font-weight, 600);color:var(--tct-list-label-font-color, var(--t-text, #4d4d4d))}.main{grid-column:2;grid-row:1}.main-no-action-nor-bullet{grid-column:1}.main-no-bullet{grid-column:1}";const o=n;const r=class{constructor(e){t(this,e);this.scheduledAfterRender=[];this.onMutationObserved=()=>{this.renderTrigger+=1;this.scheduledAfterRender.push((()=>{Array.from(this.hostElement.children).forEach((t=>{if(t.tagName==="Q2-ITEM")t.role="listitem"}))}))};this.label=undefined;this.renderTrigger=0;this.bordered=undefined}componentDidLoad(){if(typeof MutationObserver!=="undefined"){const t=new MutationObserver(this.onMutationObserved);t.observe(this.hostElement,{childList:true,subtree:true,attributes:true});this.mutationObserver=t;this.onMutationObserved()}}componentDidRender(){this.scheduledAfterRender.forEach((t=>t()));this.scheduledAfterRender=[]}disconnectedCallback(){if(this.mutationObserver){this.mutationObserver.disconnect();this.mutationObserver=null}}get hasLabelContent(){return!!this.label}get hasFilterSlot(){return!!this.hostElement.querySelector("q2-pill")||s(this.hostElement,"pill")}get headerClasses(){const t=["header"];if(this.hasLabelContent&&this.hasFilterSlot){t.push("header-spacebetween")}else if(this.hasLabelContent&&!this.hasFilterSlot){t.push("header-start")}else if(!this.hasLabelContent&&this.hasFilterSlot){t.push("header-end")}return t.join(" ")}get listClasses(){const t=["list"];return t.join(" ")}render(){return e("div",{key:"37b0671ca94200f7e753f2b5e02a3dfd00efc6a3",class:this.listClasses,ref:t=>this.listElement=t},(this.hasFilterSlot||this.hasLabelContent)&&e("div",{key:"a00b89d9153d707f5b7a3c0aaea857e5d489caff",class:this.headerClasses},e("div",{key:"6ab05c1b898d8340526e9c45b457eb1920d37431",class:"label"},this.label),this.hasFilterSlot&&e("slot",{key:"cb491e1700fc4312aa65016f897c35501ada01ff",name:"filter"})),e("div",{key:"b5af288fd5a3b233f981f67156bf1fbb59e1326d",role:"list"},e("slot",{key:"3c48768066b42cecfc998506537a9447b5b61ff5"})))}get hostElement(){return i(this)}};r.style=o;export{r as q2_list};
2
+ //# sourceMappingURL=p-d1a9ed3d.entry.js.map