q2-tecton-elements 1.13.0-alpha.0 → 1.13.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 (234) hide show
  1. package/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
  2. package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
  3. package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
  4. package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
  7. package/dist/cjs/q2-badge.cjs.entry.js +43 -0
  8. package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
  9. package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
  10. package/dist/cjs/q2-card.cjs.entry.js +127 -0
  11. package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
  12. package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
  13. package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
  14. package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
  15. package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
  16. package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
  17. package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
  18. package/dist/cjs/q2-icon.cjs.entry.js +3 -3
  19. package/dist/cjs/q2-input.cjs.entry.js +439 -437
  20. package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
  21. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-message.cjs.entry.js +5 -5
  23. package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
  24. package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
  25. package/dist/cjs/q2-option.cjs.entry.js +3 -11
  26. package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
  27. package/dist/cjs/q2-pill.cjs.entry.js +137 -0
  28. package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
  29. package/dist/cjs/q2-radio.cjs.entry.js +21 -4
  30. package/dist/cjs/q2-section.cjs.entry.js +5 -7
  31. package/dist/cjs/q2-select.cjs.entry.js +23 -26
  32. package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
  33. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
  34. package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
  35. package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
  36. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-tag.cjs.entry.js +94 -0
  38. package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
  39. package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
  40. package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
  41. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
  42. package/dist/collection/collection-manifest.json +10 -3
  43. package/dist/collection/components/click-elsewhere/index.js +4 -6
  44. package/dist/collection/components/q2-badge/index.js +148 -0
  45. package/dist/collection/components/q2-badge/styles.css +134 -0
  46. package/dist/collection/components/q2-btn/index.js +14 -14
  47. package/dist/collection/components/q2-btn/styles.css +1 -1
  48. package/dist/collection/components/q2-calendar/helpers.js +22 -20
  49. package/dist/collection/components/q2-calendar/index.js +44 -37
  50. package/dist/collection/components/q2-calendar/validation.js +4 -2
  51. package/dist/collection/components/q2-card/index.js +347 -0
  52. package/dist/collection/components/q2-card/styles.css +177 -0
  53. package/dist/collection/components/q2-carousel/index.js +11 -16
  54. package/dist/collection/components/q2-carousel/styles.css +3 -3
  55. package/dist/collection/components/q2-carousel-pane/index.js +2 -2
  56. package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
  57. package/dist/collection/components/q2-checkbox/index.js +37 -12
  58. package/dist/collection/components/q2-checkbox-group/index.js +22 -1
  59. package/dist/collection/components/q2-dropdown/index.js +6 -15
  60. package/dist/collection/components/q2-dropdown-item/index.js +5 -5
  61. package/dist/collection/components/q2-editable-field/index.js +3 -6
  62. package/dist/collection/components/q2-icon/icons.js +393 -383
  63. package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
  64. package/dist/collection/components/q2-input/formatting/currency.js +162 -162
  65. package/dist/collection/components/q2-input/formatting/date.js +1 -1
  66. package/dist/collection/components/q2-input/formatting/generic.js +7 -8
  67. package/dist/collection/components/q2-input/formatting/number.js +6 -9
  68. package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
  69. package/dist/collection/components/q2-input/formatting/phone.js +215 -215
  70. package/dist/collection/components/q2-input/formatting/postal.js +1 -1
  71. package/dist/collection/components/q2-input/index.js +81 -25
  72. package/dist/collection/components/q2-input/styles.css +19 -14
  73. package/dist/collection/components/q2-loading/index.js +4 -4
  74. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
  75. package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
  76. package/dist/collection/components/q2-message/index.js +3 -3
  77. package/dist/collection/components/q2-optgroup/index.js +1 -1
  78. package/dist/collection/components/q2-option/index.js +19 -25
  79. package/dist/collection/components/q2-option/styles.css +5 -0
  80. package/dist/collection/components/q2-option-list/index.js +648 -0
  81. package/dist/collection/components/q2-option-list/styles.css +128 -0
  82. package/dist/collection/components/q2-pagination/index.js +275 -0
  83. package/dist/collection/components/q2-pagination/styles.css +120 -0
  84. package/dist/collection/components/q2-pill/index.js +324 -0
  85. package/dist/collection/components/q2-pill/styles.css +229 -0
  86. package/dist/collection/components/q2-radio/index.js +38 -1
  87. package/dist/collection/components/q2-radio-group/index.js +66 -24
  88. package/dist/collection/components/q2-section/index.js +5 -7
  89. package/dist/collection/components/q2-select/index.js +40 -25
  90. package/dist/collection/components/q2-stepper/index.js +8 -10
  91. package/dist/collection/components/q2-stepper/styles.css +5 -5
  92. package/dist/collection/components/q2-stepper-pane/index.js +133 -5
  93. package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
  94. package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
  95. package/dist/collection/components/q2-tab-container/index.js +11 -7
  96. package/dist/collection/components/q2-tag/index.js +200 -0
  97. package/dist/collection/components/q2-tag/styles.css +141 -0
  98. package/dist/collection/components/q2-textarea/index.js +6 -6
  99. package/dist/collection/components/tecton-tab-pane/index.js +3 -10
  100. package/dist/collection/utils/index.js +25 -13
  101. package/dist/esm/click-elsewhere.entry.js +5 -7
  102. package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
  103. package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
  104. package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
  105. package/dist/esm/loader.js +3 -3
  106. package/dist/esm/polyfills/css-shim.js +1 -1
  107. package/dist/esm/q2-avatar.entry.js +2 -2
  108. package/dist/esm/q2-badge.entry.js +39 -0
  109. package/dist/esm/q2-btn_2.entry.js +13 -13
  110. package/dist/esm/q2-calendar.entry.js +53 -59
  111. package/dist/esm/q2-card.entry.js +123 -0
  112. package/dist/esm/q2-carousel-pane.entry.js +5 -5
  113. package/dist/esm/q2-carousel.entry.js +318 -106
  114. package/dist/esm/q2-checkbox-group.entry.js +6 -3
  115. package/dist/esm/q2-checkbox.entry.js +18 -10
  116. package/dist/esm/q2-dropdown-item.entry.js +7 -7
  117. package/dist/esm/q2-dropdown.entry.js +8 -17
  118. package/dist/esm/q2-editable-field.entry.js +5 -8
  119. package/dist/esm/q2-icon.entry.js +3 -3
  120. package/dist/esm/q2-input.entry.js +439 -437
  121. package/dist/esm/q2-loading-element.entry.js +3 -3
  122. package/dist/esm/q2-loc.entry.js +2 -2
  123. package/dist/esm/q2-message.entry.js +5 -5
  124. package/dist/esm/q2-optgroup.entry.js +3 -3
  125. package/dist/esm/q2-option-list.entry.js +355 -0
  126. package/dist/esm/q2-option.entry.js +3 -11
  127. package/dist/esm/q2-pagination.entry.js +112 -0
  128. package/dist/esm/q2-pill.entry.js +133 -0
  129. package/dist/esm/q2-radio-group.entry.js +43 -18
  130. package/dist/esm/q2-radio.entry.js +21 -4
  131. package/dist/esm/q2-section.entry.js +5 -7
  132. package/dist/esm/q2-select.entry.js +23 -26
  133. package/dist/esm/q2-stepper-pane.entry.js +42 -4
  134. package/dist/esm/q2-stepper-vertical.entry.js +274 -0
  135. package/dist/esm/q2-stepper.entry.js +10 -12
  136. package/dist/esm/q2-tab-container.entry.js +12 -8
  137. package/dist/esm/q2-tab-pane.entry.js +1 -1
  138. package/dist/esm/q2-tag.entry.js +90 -0
  139. package/dist/esm/q2-tecton-elements.js +3 -3
  140. package/dist/esm/q2-textarea.entry.js +8 -8
  141. package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
  142. package/dist/esm/tecton-tab-pane.entry.js +2 -5
  143. package/dist/loader/index.d.ts +0 -1
  144. package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
  145. package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
  146. package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
  147. package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
  148. package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
  149. package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
  150. package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
  151. package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
  152. package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
  153. package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
  154. package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
  155. package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
  156. package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
  157. package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
  158. package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
  159. package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
  160. package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
  161. package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
  162. package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
  163. package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
  164. package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
  165. package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
  167. package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
  168. package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
  170. package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
  171. package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
  173. package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
  174. package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
  175. package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
  176. package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
  177. package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
  178. package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
  179. package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
  180. package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
  181. package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
  182. package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
  183. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  184. package/dist/test/elements/q2-tag-test.js +151 -0
  185. package/dist/test/helpers.js +20 -9
  186. package/dist/types/components/q2-badge/index.d.ts +13 -0
  187. package/dist/types/components/q2-btn/index.d.ts +3 -3
  188. package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
  189. package/dist/types/components/q2-calendar/index.d.ts +2 -1
  190. package/dist/types/components/q2-calendar/validation.d.ts +1 -1
  191. package/dist/types/components/q2-card/index.d.ts +35 -0
  192. package/dist/types/components/q2-checkbox/index.d.ts +3 -1
  193. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
  194. package/dist/types/components/q2-dropdown/index.d.ts +1 -1
  195. package/dist/types/components/q2-editable-field/index.d.ts +1 -1
  196. package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
  197. package/dist/types/components/q2-input/index.d.ts +5 -2
  198. package/dist/types/components/q2-option/index.d.ts +2 -3
  199. package/dist/types/components/q2-option-list/index.d.ts +62 -0
  200. package/dist/types/components/q2-pagination/index.d.ts +30 -0
  201. package/dist/types/components/q2-pill/index.d.ts +39 -0
  202. package/dist/types/components/q2-radio/index.d.ts +4 -1
  203. package/dist/types/components/q2-radio-group/index.d.ts +5 -1
  204. package/dist/types/components/q2-select/index.d.ts +2 -1
  205. package/dist/types/components/q2-stepper/index.d.ts +1 -1
  206. package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
  207. package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
  208. package/dist/types/components/q2-tab-container/index.d.ts +1 -1
  209. package/dist/types/components/q2-tag/index.d.ts +28 -0
  210. package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
  211. package/dist/types/components.d.ts +235 -11
  212. package/dist/types/global.d.ts +1 -0
  213. package/dist/types/stencil-public-runtime.d.ts +6 -4
  214. package/dist/types/util.d.ts +2 -10
  215. package/dist/types/utils/index.d.ts +1 -0
  216. package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
  217. package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
  218. package/package.json +13 -13
  219. package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
  220. package/dist/q2-tecton-elements/p-080839ed.js +0 -1
  221. package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
  222. package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
  223. package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
  224. package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
  225. package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
  226. package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
  227. package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
  228. package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
  229. package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
  230. package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
  231. package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
  232. package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
  233. package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
  234. package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c2e53804.js');
6
- const shapes = require('./shapes-086c0365.js');
5
+ const index = require('./index-7febb200.js');
6
+ const shapes = require('./shapes-305746b5.js');
7
7
 
8
8
  const stylesCss = "q2-loading-element{display:block}.skeleton-shape.rectangle:not(.no-margin){margin:var(--tct-loading-skeleton-vertical-gap, var(--tct-scale-2, 10px)) var(--tct-loading-skeleton-horizontal-gap, var(--tct-scale-2, 10px))}.skeleton-shape.circle,.skeleton-shape.rectangle{background-color:var(--tct-loading-skeleton-element-bg, var(--tct-gray-l3, var(--t-gray-14, #f2f2f2)))}.skeleton-shape.circle{border-radius:50%;padding-top:100%}";
9
9
 
@@ -16,7 +16,7 @@ const Q2Loading = class {
16
16
  ? shapes.atoms[this.shape]({
17
17
  width: this.width,
18
18
  height: this.height,
19
- borderRadius: this.borderRadius
19
+ borderRadius: this.borderRadius,
20
20
  })
21
21
  : '';
22
22
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c2e53804.js');
6
- const index$1 = require('./index-a55d3c34.js');
5
+ const index = require('./index-7febb200.js');
6
+ const index$1 = require('./index-dd823ee6.js');
7
7
 
8
8
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline}";
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c2e53804.js');
6
- const index$1 = require('./index-a55d3c34.js');
5
+ const index = require('./index-7febb200.js');
6
+ const index$1 = require('./index-dd823ee6.js');
7
7
 
8
8
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}:host([hidden]){display:none}.message{border-left-width:var(--tct-message-bar-width, var(--t-message-bar-width, var(--app-scale-1, 5px)));border-left-style:solid;display:grid;gap:var(--tct-scale-1, var(--app-scale-1, 5px));align-items:flex-start;background:var(--tct-message-bg, var(--t-message-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2))))));color:var(--tct-message-font-color, var(--t-message-font-color, inherit));box-shadow:var(--tct-message-box-shadow, var(--t-message-box-shadow, inherit));border-radius:var(--tct-message-border-radius, var(--t-message-border-radius, inherit))}.message:focus{box-shadow:var(--const-global-focus)}.message-icon{width:24px}.message-content{flex:1}::slotted(ul){padding-left:var(--tct-scale-l3, var(--app-scale-3, 15px))}:host(:not([appearance])),:host([appearance=standard]){margin:var(--tct-scale-l3, var(--app-scale-3, 15px)) 0}:host(:not([appearance])) .message,:host([appearance=standard]) .message{grid-template-columns:24px 1fr;--comp-padding:var(--tct-message-padding, var(--t-message-padding, var(--app-scale-3, 15px)));padding:var(--comp-padding);padding-top:calc(var(--comp-padding) - var(--tct-scale-1, var(--app-scale-1, 5px)));padding-left:calc(var(--comp-padding) - var(--tct-scale-2, var(--app-scale-2, 10px)))}:host(:not([appearance])) .message-content,:host([appearance=standard]) .message-content{padding-top:var(--tct-scale-1, var(--app-scale-1, 5px))}:host(:not([appearance])) ::slotted(ul),:host([appearance=standard]) ::slotted(ul){margin:var(--tct-scale-l3, var(--app-scale-3, 15px)) 0}:host([appearance=minimal]){margin:0}:host([appearance=minimal]) .message{padding:var(--tct-message-minimal-padding, var(--t-message-minimal-padding, var(--app-scale-2, 10px)));grid-template-columns:1fr}:host([appearance=minimal]) ::slotted(ul){margin:var(--tct-scale-1, var(--app-scale-1, 5px)) 0}:host(:not([type])) .message,:host([type=info]) .message{border-left-color:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host(:not([type])) .message-icon,:host([type=info]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1));--tct-icon-stroke-secondary:var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))}:host([type=success]) .message{border-left-color:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=success]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00));--tct-icon-stroke-secondary:var(--tct-stoplight-success, var(--const-stoplight-success, #0e8a00))}:host([type=warning]) .message{border-left-color:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=warning]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400));--tct-icon-stroke-secondary:var(--tct-stoplight-warning, var(--const-stoplight-warning, #f0b400))}:host([type=error]) .message,:host([type=danger]) .message{border-left-color:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}:host([type=error]) .message-icon,:host([type=danger]) .message-icon{--tct-icon-stroke-primary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000));--tct-icon-stroke-secondary:var(--tct-stoplight-error, var(--const-stoplight-alert, #c30000))}";
9
9
 
@@ -49,10 +49,10 @@ function generateIcon(type) {
49
49
  warning: 'warning',
50
50
  danger: 'error',
51
51
  error: 'error',
52
- info: 'info'
52
+ info: 'info',
53
53
  };
54
- const icon = iconMap[type] || iconMap['info'];
55
- return index.h("q2-icon", { type: icon, class: "message-icon" });
54
+ const icon = iconMap[type] || iconMap.info;
55
+ return (index.h("q2-icon", { type: icon, class: "message-icon" }));
56
56
  }
57
57
  Q2Message.style = stylesCss;
58
58
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c2e53804.js');
6
- const index$1 = require('./index-a55d3c34.js');
5
+ const index = require('./index-7febb200.js');
6
+ const index$1 = require('./index-dd823ee6.js');
7
7
 
8
8
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block}.q2-optgroup-header{background-color:var(--tct-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6)))));padding:var(--tct-scale-1, var(--app-scale-1, 5px)) var(--tct-scale-2, var(--app-scale-2, 10px));font-weight:var(--tct-optgroup-header-font-weight, 600);text-transform:var(--tct-optgroup-header-text-transform, uppercase);}";
9
9
 
@@ -22,7 +22,7 @@ const Q2Optgroup = class {
22
22
  const observer = new MutationObserver(this.setHidden);
23
23
  observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
24
24
  this.mutationObserver = observer;
25
- //set initially
25
+ // set initially
26
26
  this.setHidden();
27
27
  this.disabledWatcher(this.disabled);
28
28
  }
@@ -0,0 +1,359 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7febb200.js');
6
+ const index$1 = require('./index-dd823ee6.js');
7
+
8
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block}.content{margin-top:var(--tct-option-list-margin, var(--t-option-list-margin, var(--app-scale-1x, 5px)));position:absolute;height:0;opacity:0;visibility:hidden;background-color:var(--app-white);color:var(--t-font-color);z-index:100;width:max-content;min-width:var(--tct-option-list-min-width, var(--t-option-list-min-width, 135px));box-shadow:var(--app-shadow-1);overflow:hidden;text-align:start;transition:opacity var(--app-tween-1);border-radius:var(--tct-option-list-border-radius, var(--t-option-list-border-radius, 0));--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.content::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.content::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.content::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host(:not([align=right])) .content{left:0}:host([align=right]) .content{right:0}:host([open]) .content{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}:host([is-sizeable]) .content{display:block;height:auto}:host([alignment=right]) .content{left:unset;right:0}";
9
+
10
+ const Q2OptionList = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.change = index.createEvent(this, "change", 7);
14
+ this.optionListState = index.createEvent(this, "optionListState", 7);
15
+ this.role = 'listbox';
16
+ this.direction = 'down';
17
+ this.selectedOptions = [];
18
+ this.scheduledAfterRender = [];
19
+ /// Event Handlers ///
20
+ /* tslint:disable:cyclomatic-complexity */
21
+ this.keydownHandler = (event, ignoreSelectionEvents) => {
22
+ event.stopPropagation();
23
+ const { activeIndex, customSearch, allOptions } = this;
24
+ const { key, shiftKey } = event;
25
+ let newOption;
26
+ switch (key) {
27
+ case ' ':
28
+ case 'Enter':
29
+ if (ignoreSelectionEvents) {
30
+ this.setDefaultActiveElement();
31
+ break;
32
+ }
33
+ event.preventDefault();
34
+ newOption = allOptions.find(element => element.active);
35
+ if (!newOption || newOption.disabled)
36
+ break;
37
+ this.selectOption(newOption.value);
38
+ break;
39
+ case 'ArrowUp':
40
+ event.preventDefault();
41
+ const isFirstOption = activeIndex === 0;
42
+ if (isFirstOption)
43
+ break;
44
+ if (activeIndex === undefined) {
45
+ this.setDefaultActiveElement();
46
+ }
47
+ else {
48
+ const nextIndex = this.getNextVisibleIndex(-1);
49
+ if (nextIndex === -1)
50
+ break;
51
+ this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
52
+ }
53
+ break;
54
+ case 'ArrowDown':
55
+ event.preventDefault();
56
+ const isLastOption = activeIndex === allOptions.length - 1;
57
+ if (isLastOption)
58
+ break;
59
+ if (activeIndex === undefined) {
60
+ this.setDefaultActiveElement();
61
+ }
62
+ else {
63
+ const nextIndex = this.getNextVisibleIndex(1);
64
+ if (nextIndex === -1)
65
+ break;
66
+ this.adjustActiveOptionAndScroll(nextIndex - activeIndex);
67
+ }
68
+ break;
69
+ case 'Home':
70
+ event.preventDefault();
71
+ this.openDropdownWithActiveElement(0);
72
+ break;
73
+ case 'End':
74
+ event.preventDefault();
75
+ this.openDropdownWithActiveElement(allOptions.length - 1);
76
+ break;
77
+ case 'PageUp':
78
+ event.preventDefault();
79
+ this.openDropdownWithActiveElement(Math.max(activeIndex - 10, 0));
80
+ break;
81
+ case 'PageDown':
82
+ event.preventDefault();
83
+ this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));
84
+ break;
85
+ case 'Tab':
86
+ if (ignoreSelectionEvents)
87
+ break;
88
+ if (shiftKey)
89
+ break;
90
+ newOption = allOptions.find(element => element.active);
91
+ if (!newOption || newOption.disabled)
92
+ return;
93
+ this.selectOption(newOption.value);
94
+ break;
95
+ case 'Esc':
96
+ case 'Escape':
97
+ if (this.noSelect)
98
+ this.setActiveElement(null);
99
+ this.open = false;
100
+ break;
101
+ default:
102
+ if (customSearch)
103
+ break;
104
+ if (!key.match(/^[A-Za-z0-9]$/))
105
+ break;
106
+ // search in non-searchable select: alpha-numeric only
107
+ this.searchAndFocus(key);
108
+ break;
109
+ }
110
+ };
111
+ /* tslint:enable:cyclomatic-complexity */
112
+ this.focusoutHandler = (event) => {
113
+ const { relatedTarget } = event;
114
+ const isInDropdown = this.allOptions.includes(relatedTarget);
115
+ const isInLightDom = !isInDropdown && this.hostElement.contains(relatedTarget);
116
+ if (isInDropdown || isInLightDom) {
117
+ event.stopPropagation();
118
+ }
119
+ };
120
+ this.clickHandler = (event) => {
121
+ const target = event.target;
122
+ if (target.localName !== 'q2-option' || target.disabled) {
123
+ return;
124
+ }
125
+ this.selectOption(target.value);
126
+ };
127
+ }
128
+ /// LifeCycle Hooks ///
129
+ componentWillLoad() {
130
+ this.hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
131
+ }
132
+ componentDidLoad() {
133
+ index$1.overrideFocus(this.hostElement);
134
+ this.checkOptions();
135
+ }
136
+ componentDidRender() {
137
+ this.scheduledAfterRender.forEach(fn => fn());
138
+ this.scheduledAfterRender = [];
139
+ }
140
+ /// Getters ///
141
+ get allOptions() {
142
+ return this.getRootSlot(this.hostElement);
143
+ }
144
+ /// Helpers ///
145
+ checkOptions() {
146
+ const { noSelect, type, allOptions } = this;
147
+ if (!noSelect && !type)
148
+ return;
149
+ const optionRole = type === 'menu' ? 'menuitem' : 'option';
150
+ allOptions.forEach(option => {
151
+ if (noSelect)
152
+ option.noSelect = true;
153
+ if (type)
154
+ option.role = optionRole;
155
+ });
156
+ }
157
+ getRootSlot(element) {
158
+ var _a;
159
+ const slot = element.querySelector('slot');
160
+ const assignedElements = (_a = slot === null || slot === void 0 ? void 0 : slot.assignedElements()) !== null && _a !== void 0 ? _a : Array.from(element.children);
161
+ const hasAnotherSlot = !!assignedElements.length && assignedElements[0].tagName === 'SLOT';
162
+ if (hasAnotherSlot) {
163
+ return this.getRootSlot(assignedElements[0]);
164
+ }
165
+ else {
166
+ return assignedElements;
167
+ }
168
+ }
169
+ scrollToActiveOption() {
170
+ const activeOption = this.allOptions[this.activeIndex];
171
+ activeOption === null || activeOption === void 0 ? void 0 : activeOption.scrollIntoView({ block: 'nearest' });
172
+ }
173
+ resizeIframe() {
174
+ var _a, _b;
175
+ return (_b = (_a = window.TectonElements) === null || _a === void 0 ? void 0 : _a.resizeIframe) === null || _b === void 0 ? void 0 : _b.call(_a);
176
+ }
177
+ openDropdownWithActiveElement(activeIndex) {
178
+ if (this.disabled)
179
+ return;
180
+ this.activeIndex = activeIndex;
181
+ this.open = true;
182
+ this.setActiveOption();
183
+ this.setFocusedOption();
184
+ this.scheduledAfterRender.push(() => {
185
+ this.scrollToActiveOption();
186
+ this.resizeIframe();
187
+ });
188
+ }
189
+ getDefaultActiveIndex() {
190
+ const { allOptions } = this;
191
+ const firstSelected = allOptions.findIndex(element => element.selected);
192
+ if (firstSelected > -1)
193
+ return firstSelected;
194
+ const firstEnabled = allOptions.findIndex(element => !element.hidden);
195
+ if (firstEnabled > -1)
196
+ return firstEnabled;
197
+ return 0;
198
+ }
199
+ updateSingleOptionAttrs() {
200
+ var _a, _b;
201
+ const { allOptions, selectedOptions } = this;
202
+ const singleValue = (_b = (_a = selectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : undefined;
203
+ allOptions.forEach(element => {
204
+ element.selected = element.value === singleValue;
205
+ });
206
+ }
207
+ updateMultipleOptionAttrs() {
208
+ const { allOptions, selectedOptions } = this;
209
+ const selectedValues = selectedOptions.map(option => option.value);
210
+ allOptions.forEach(element => {
211
+ element.selected = selectedValues.includes(element.value);
212
+ });
213
+ }
214
+ setActiveOption() {
215
+ if (!this.open)
216
+ return;
217
+ const activeIndex = this.activeIndex;
218
+ this.allOptions.forEach((element, elementIndex) => {
219
+ element.active = activeIndex === elementIndex;
220
+ });
221
+ }
222
+ setFocusedOption() {
223
+ const option = this.allOptions[this.activeIndex];
224
+ if (!option)
225
+ return;
226
+ setTimeout(() => {
227
+ option.focus();
228
+ }, 25);
229
+ }
230
+ getNextVisibleIndex(direction) {
231
+ let index = this.activeIndex + direction;
232
+ while (index >= 0 && index <= this.allOptions.length - 1) {
233
+ const { display, visibility } = window.getComputedStyle(this.allOptions[index]);
234
+ if (display !== 'none' && visibility !== 'hidden') {
235
+ return index;
236
+ }
237
+ index = index + direction;
238
+ }
239
+ return -1;
240
+ }
241
+ selectOption(selectedValue) {
242
+ const option = this.allOptions.find(({ value }) => value === selectedValue);
243
+ const valueObject = {
244
+ value: selectedValue,
245
+ display: option.display || option.innerText.trim(),
246
+ };
247
+ const { multiple, noSelect } = this;
248
+ let values;
249
+ if (multiple) {
250
+ const { selectedOptions = [] } = this;
251
+ const isAlreadySelected = !!selectedOptions.find(({ value }) => value === selectedValue);
252
+ if (isAlreadySelected) {
253
+ values = selectedOptions.filter(({ value }) => value !== selectedValue);
254
+ }
255
+ else {
256
+ values = [...selectedOptions, valueObject];
257
+ }
258
+ }
259
+ else {
260
+ values = [valueObject];
261
+ }
262
+ if (noSelect)
263
+ this.setActiveElement(null);
264
+ else
265
+ this.selectedOptions = values;
266
+ this.change.emit({ value: selectedValue, values });
267
+ if (multiple)
268
+ return;
269
+ this.open = false;
270
+ }
271
+ adjustActiveOptionAndScroll(numToAdd) {
272
+ this.activeIndex += numToAdd;
273
+ this.setActiveOption();
274
+ this.setFocusedOption();
275
+ this.scrollToActiveOption();
276
+ }
277
+ resetTimer() {
278
+ if (this.searchStringTimer) {
279
+ clearTimeout(this.searchStringTimer);
280
+ }
281
+ this.searchStringTimer = window.setTimeout(() => {
282
+ this.searchString = null;
283
+ }, 2000);
284
+ }
285
+ searchAndFocus(key) {
286
+ this.resetTimer();
287
+ let searchString = this.searchString ? `${this.searchString}${key}` : key;
288
+ searchString = searchString.replace(/[^0-9a-z]/gi, '');
289
+ this.searchString = searchString;
290
+ const searchRegEx = new RegExp(searchString, 'i');
291
+ const foundIndex = this.allOptions.findIndex(option => option.value === searchString || option.textContent.match(searchRegEx));
292
+ if (foundIndex === -1)
293
+ return;
294
+ this.setActiveElement(foundIndex);
295
+ }
296
+ /// Watchers ///
297
+ selectedOptionsUpdated() {
298
+ if (this.multiple) {
299
+ this.updateMultipleOptionAttrs();
300
+ }
301
+ else {
302
+ this.updateSingleOptionAttrs();
303
+ }
304
+ }
305
+ openChanged(newValue) {
306
+ this.optionListState.emit({ open: newValue });
307
+ }
308
+ /// Listeners ///
309
+ delegateFocus(event) {
310
+ if (!index$1.isEventFromElement(event, this.hostElement))
311
+ return;
312
+ this.open = true;
313
+ this.setDefaultActiveElement();
314
+ }
315
+ handleClick(event) {
316
+ event.stopPropagation();
317
+ }
318
+ /// Public Methods ///
319
+ toggle() {
320
+ const isOpen = !this.open;
321
+ this.open = isOpen;
322
+ }
323
+ setDefaultActiveElement() {
324
+ this.activeIndex = this.getDefaultActiveIndex();
325
+ this.setActiveOption();
326
+ this.setFocusedOption();
327
+ }
328
+ setActiveElement(index) {
329
+ this.activeIndex = index;
330
+ this.setActiveOption();
331
+ this.setFocusedOption();
332
+ }
333
+ handleExternalKeydown(event) {
334
+ const keysThatTriggerOpen = ['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End'];
335
+ if (keysThatTriggerOpen.includes(event.key)) {
336
+ this.open = true;
337
+ }
338
+ const keysThatTriggerDefault = ['ArrowDown', 'ArrowUp'];
339
+ if (keysThatTriggerDefault.includes(event.key)) {
340
+ event.preventDefault();
341
+ this.setDefaultActiveElement();
342
+ }
343
+ else {
344
+ this.keydownHandler(event, true);
345
+ }
346
+ }
347
+ /// DOM ///
348
+ render() {
349
+ return (index.h(index.Host, null, index.h("div", { class: "content", ref: el => (this.contentElement = el), onFocusout: this.focusoutHandler }, index.h("div", { class: "options", role: this.type || 'listbox', onKeyDown: this.keydownHandler, onClick: this.clickHandler }, index.h("slot", null)))));
350
+ }
351
+ get hostElement() { return index.getElement(this); }
352
+ static get watchers() { return {
353
+ "selectedOptions": ["selectedOptionsUpdated"],
354
+ "open": ["openChanged"]
355
+ }; }
356
+ };
357
+ Q2OptionList.style = stylesCss;
358
+
359
+ exports.q2_option_list = Q2OptionList;
@@ -2,29 +2,21 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-c2e53804.js');
5
+ const index = require('./index-7febb200.js');
6
6
 
7
- const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{padding:0 var(--tct-scale-2, var(--app-scale-2, 10px));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--tct-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3, 15px))) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1, 5px))}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}q2-icon{grid-area:icon;--tct-icon-size:var(--tct-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3, 15px)))}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
7
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{padding:0 var(--tct-scale-2, var(--app-scale-2, 10px));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--tct-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3, 15px))) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1, 5px))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:\"content\"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}q2-icon{grid-area:icon;--tct-icon-size:var(--tct-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3, 15px)))}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
8
8
 
9
9
  const Q2Option = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.click = index.createEvent(this, "click", 7);
13
12
  this.role = 'option';
14
13
  this.tabindex = '-1';
15
14
  this._multiSelectHidden = false;
16
- this.onClick = (event) => {
17
- event.stopImmediatePropagation();
18
- const { disabled, disabledGroup } = this;
19
- if (disabled || disabledGroup)
20
- return;
21
- this.click.emit();
22
- };
23
15
  }
24
16
  render() {
25
17
  const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
26
18
  const isDisabled = disabled || disabledGroup;
27
- return (index.h(index.Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && index.h("q2-icon", { type: "checkmark" }), index.h("div", { class: "content", onClick: this.onClick }, index.h("slot", null))));
19
+ return (index.h(index.Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && index.h("q2-icon", { type: "checkmark" }), index.h("div", { class: "content" }, index.h("slot", null))));
28
20
  }
29
21
  get hostElement() { return index.getElement(this); }
30
22
  };
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7febb200.js');
6
+ const index$1 = require('./index-dd823ee6.js');
7
+
8
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-global-focus)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{text-align:right;display:block}: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-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}";
9
+
10
+ const Q2Pagination = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.change = index.createEvent(this, "change", 7);
14
+ this.handlePageChange = (page) => {
15
+ const { totalPages, inputField } = this;
16
+ if (page < 1) {
17
+ page = 1;
18
+ }
19
+ else if (page > totalPages) {
20
+ page = totalPages;
21
+ }
22
+ if (inputField.value !== `${page}`)
23
+ inputField.value = `${page}`;
24
+ if (!this.hostElement.onchange) {
25
+ this.page = page;
26
+ }
27
+ this.change.emit({ value: page });
28
+ };
29
+ }
30
+ ////////// LIFECYCLE HOOKS ////////
31
+ componentDidLoad() {
32
+ if (this.recordsOnly || this.pagesOnly)
33
+ return;
34
+ this.containerWidth = this.containerElement.clientWidth;
35
+ this.resizeObserver = new ResizeObserver(() => this.checkSize());
36
+ this.resizeObserver.observe(this.hostElement);
37
+ index$1.overrideFocus(this.hostElement);
38
+ }
39
+ disconnectedCallback() {
40
+ var _a;
41
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
42
+ }
43
+ onHostElementFocus(event) {
44
+ var _a;
45
+ if (!index$1.isEventFromElement(event, this.hostElement))
46
+ return;
47
+ const { isFullViewHidden, containerElement, inputField } = this;
48
+ if (isFullViewHidden) {
49
+ (_a = containerElement.querySelector('q2-btn:not([disabled])')) === null || _a === void 0 ? void 0 : _a.focus();
50
+ }
51
+ else {
52
+ inputField.focus();
53
+ }
54
+ }
55
+ get isFullViewHidden() {
56
+ return this.isSmall || this.recordsOnly || this.pagesOnly;
57
+ }
58
+ get pageWithDefault() {
59
+ return this.page || 1;
60
+ }
61
+ get perPageWithDefault() {
62
+ return this.perPage || 10;
63
+ }
64
+ get totalWithDefault() {
65
+ return this.total || 0;
66
+ }
67
+ get recordTypeWithDefault() {
68
+ return this.recordType || index$1.loc('tecton.element.pagination.defaultRecordType');
69
+ }
70
+ get currentRange() {
71
+ const { perPageWithDefault: perPage, totalWithDefault: total, pageWithDefault: page } = this;
72
+ const start = (page - 1) * perPage + 1;
73
+ const end = Math.min(page * perPage, total);
74
+ return `${start} - ${end}`;
75
+ }
76
+ get totalPages() {
77
+ const { pagesOnly, totalWithDefault: total, perPageWithDefault: perPage, pages } = this;
78
+ if (pagesOnly && pages && !isNaN(parseInt(`${pages}`)))
79
+ return pages;
80
+ return Math.ceil(total / perPage);
81
+ }
82
+ checkSize() {
83
+ const { hostElement, containerElement } = this;
84
+ const isOverflowing = this.containerWidth > hostElement.clientWidth;
85
+ this.isSmall = isOverflowing;
86
+ if (isOverflowing)
87
+ return;
88
+ index$1.nextPaint(() => {
89
+ const containerWidthHasNotChanged = this.containerWidth === containerElement.clientWidth;
90
+ if (containerWidthHasNotChanged)
91
+ return;
92
+ this.containerWidth = containerElement.clientWidth;
93
+ this.checkSize();
94
+ });
95
+ }
96
+ ////////// OBSERVERS //////////
97
+ render() {
98
+ const { pagesOnly, isFullViewHidden, recordTypeWithDefault: recordType, totalPages, totalWithDefault: total, pageWithDefault: page, currentRange, } = this;
99
+ const onFirstPage = page === 1;
100
+ const onLastPage = page === totalPages;
101
+ return (index.h("nav", { class: "container", ref: el => (this.containerElement = el), "aria-label": index$1.loc('tecton.element.pagination.title') }, index.h("div", { class: "description", "test-id": "description" }, pagesOnly
102
+ ? index$1.loc('tecton.element.pagination.pages', {
103
+ current: page,
104
+ total: totalPages,
105
+ })
106
+ : index$1.loc('tecton.element.pagination.description', {
107
+ range: currentRange,
108
+ recordType: recordType.toLowerCase(),
109
+ total: total.toLocaleString(),
110
+ })), index.h("div", { class: "btn-group" }, index.h("q2-btn", { label: "tecton.element.pagination.goToFirstPage", disabled: onFirstPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(1), "test-id": "firstPageBtn", "hide-label": true }, index.h("q2-icon", { type: "chevron-double-left" })), index.h("q2-btn", { label: index$1.loc('tecton.element.pagination.goToPage', [page - 1]), disabled: onFirstPage, onClick: () => this.handlePageChange(page - 1), "test-id": "prevPageBtn", "hide-label": true }, index.h("q2-icon", { type: "chevron-left" }))), index.h("div", { class: "controls", hidden: isFullViewHidden, "test-id": "controls" }, index.h("span", { "aria-hidden": "true" }, index$1.loc('tecton.element.pagination.page')), index.h("div", { class: "input-wrapper", onClick: () => this.inputField.dispatchEvent(new FocusEvent('focus')) }, index.h("q2-input", { type: "number", value: `${page}`, min: 1, max: this.totalPages, hideLabel: true, optional: true, label: `${index$1.loc('tecton.element.pagination.page')} (${index$1.loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()])})`, onChange: event => this.handlePageChange(event.detail.value), "test-id": "pageInput", current: "page", ref: el => (this.inputField = el) })), index.h("span", { "aria-hidden": "true" }, index$1.loc('tecton.element.pagination.ofPages', [totalPages.toLocaleString()]))), index.h("div", { class: "btn-group" }, index.h("q2-btn", { label: index$1.loc('tecton.element.pagination.goToPage', [page + 1]), disabled: onLastPage, onClick: () => this.handlePageChange(page + 1), "test-id": "nextPageBtn", "hide-label": true }, index.h("q2-icon", { type: "chevron-right" })), index.h("q2-btn", { label: "tecton.element.pagination.goToLastPage", disabled: onLastPage, hidden: isFullViewHidden, onClick: () => this.handlePageChange(totalPages), "test-id": "lastPageBtn", "hide-label": true }, index.h("q2-icon", { type: "chevron-double-right" })))));
111
+ }
112
+ get hostElement() { return index.getElement(this); }
113
+ };
114
+ Q2Pagination.style = stylesCss;
115
+
116
+ exports.q2_pagination = Q2Pagination;