@getflip/swirl-components 0.81.3 → 0.82.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 (264) hide show
  1. package/components.json +29 -3
  2. package/dist/cjs/file-manager.cjs.entry.js +2 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/swirl-action-list_3.cjs.entry.js +8 -12
  5. package/dist/cjs/swirl-app-bar.cjs.entry.js +1 -2
  6. package/dist/cjs/swirl-app-layout_7.cjs.entry.js +10 -15
  7. package/dist/cjs/swirl-autocomplete.cjs.entry.js +4 -6
  8. package/dist/cjs/swirl-avatar-group.cjs.entry.js +1 -1
  9. package/dist/cjs/swirl-banner.cjs.entry.js +5 -7
  10. package/dist/cjs/swirl-button.cjs.entry.js +2 -3
  11. package/dist/cjs/swirl-carousel.cjs.entry.js +3 -4
  12. package/dist/cjs/swirl-chip.cjs.entry.js +2 -3
  13. package/dist/cjs/swirl-components.cjs.js +1 -1
  14. package/dist/cjs/swirl-console-layout.cjs.entry.js +2 -4
  15. package/dist/cjs/swirl-date-input.cjs.entry.js +14 -7
  16. package/dist/cjs/swirl-dialog.cjs.entry.js +4 -5
  17. package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +13 -20
  18. package/dist/cjs/swirl-form-control.cjs.entry.js +1 -2
  19. package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +3 -5
  20. package/dist/cjs/swirl-icon-error_3.cjs.entry.js +2 -3
  21. package/dist/cjs/swirl-inline-status.cjs.entry.js +1 -2
  22. package/dist/cjs/swirl-lightbox.cjs.entry.js +8 -16
  23. package/dist/cjs/swirl-menu-item.cjs.entry.js +4 -7
  24. package/dist/cjs/swirl-menu.cjs.entry.js +6 -8
  25. package/dist/cjs/swirl-modal.cjs.entry.js +15 -6
  26. package/dist/cjs/swirl-option-list.cjs.entry.js +5 -8
  27. package/dist/cjs/swirl-pdf-reader.cjs.entry.js +3 -5
  28. package/dist/cjs/swirl-popover_2.cjs.entry.js +9 -14
  29. package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +2 -3
  30. package/dist/cjs/swirl-search.cjs.entry.js +8 -3
  31. package/dist/cjs/swirl-select.cjs.entry.js +9 -7
  32. package/dist/cjs/swirl-shell-layout.cjs.entry.js +2 -3
  33. package/dist/cjs/swirl-table-column.cjs.entry.js +1 -1
  34. package/dist/cjs/swirl-table-row.cjs.entry.js +1 -1
  35. package/dist/cjs/swirl-table.cjs.entry.js +1 -2
  36. package/dist/cjs/swirl-tabs.cjs.entry.js +2 -4
  37. package/dist/cjs/swirl-tag.cjs.entry.js +1 -2
  38. package/dist/cjs/swirl-text-input.cjs.entry.js +8 -4
  39. package/dist/cjs/swirl-theme-provider.cjs.entry.js +15 -5
  40. package/dist/cjs/swirl-time-input.cjs.entry.js +10 -6
  41. package/dist/cjs/swirl-toast-provider.cjs.entry.js +8 -3
  42. package/dist/cjs/swirl-toast.cjs.entry.js +4 -6
  43. package/dist/cjs/swirl-tooltip.cjs.entry.js +6 -8
  44. package/dist/collection/assets/pdfjs/pdf.worker.min.js +0 -22
  45. package/dist/collection/components/swirl-action-list/swirl-action-list.js +3 -5
  46. package/dist/collection/components/swirl-action-list-item/swirl-action-list-item.js +5 -7
  47. package/dist/collection/components/swirl-app-bar/swirl-app-bar.js +1 -2
  48. package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +1 -2
  49. package/dist/collection/components/swirl-autocomplete/swirl-autocomplete.js +4 -6
  50. package/dist/collection/components/swirl-avatar-group/swirl-avatar-group.js +1 -1
  51. package/dist/collection/components/swirl-banner/swirl-banner.js +5 -7
  52. package/dist/collection/components/swirl-button/swirl-button.js +2 -3
  53. package/dist/collection/components/swirl-carousel/swirl-carousel.js +3 -4
  54. package/dist/collection/components/swirl-chip/swirl-chip.js +2 -3
  55. package/dist/collection/components/swirl-console-layout/swirl-console-layout.js +2 -4
  56. package/dist/collection/components/swirl-date-input/swirl-date-input.js +14 -7
  57. package/dist/collection/components/swirl-dialog/swirl-dialog.js +4 -5
  58. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-csv/swirl-file-viewer-csv.js +2 -4
  59. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +11 -16
  60. package/dist/collection/components/swirl-form-control/swirl-form-control.js +1 -2
  61. package/dist/collection/components/swirl-form-control/swirl-form-control.stories.js +28 -7
  62. package/dist/collection/components/swirl-inline-error/swirl-inline-error.js +2 -3
  63. package/dist/collection/components/swirl-inline-status/swirl-inline-status.js +1 -2
  64. package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +8 -16
  65. package/dist/collection/components/swirl-menu/swirl-menu.js +6 -8
  66. package/dist/collection/components/swirl-menu-item/swirl-menu-item.js +4 -7
  67. package/dist/collection/components/swirl-modal/swirl-modal.js +53 -9
  68. package/dist/collection/components/swirl-modal/swirl-modal.stories.js +1 -1
  69. package/dist/collection/components/swirl-option-list/swirl-option-list.js +5 -8
  70. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +3 -5
  71. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +3 -5
  72. package/dist/collection/components/swirl-popover/swirl-popover.js +8 -12
  73. package/dist/collection/components/swirl-popover/swirl-popover.stories.js +1 -1
  74. package/dist/collection/components/swirl-popover-trigger/swirl-popover-trigger.js +1 -2
  75. package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +6 -8
  76. package/dist/collection/components/swirl-resource-list-file-item/swirl-resource-list-file-item.js +2 -3
  77. package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +3 -5
  78. package/dist/collection/components/swirl-search/swirl-search.js +8 -3
  79. package/dist/collection/components/swirl-select/swirl-select.js +9 -7
  80. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +2 -3
  81. package/dist/collection/components/swirl-table/swirl-table.js +1 -2
  82. package/dist/collection/components/swirl-table-column/swirl-table-column.js +1 -1
  83. package/dist/collection/components/swirl-table-row/swirl-table-row.js +1 -1
  84. package/dist/collection/components/swirl-tabs/swirl-tabs.js +2 -4
  85. package/dist/collection/components/swirl-tag/swirl-tag.js +1 -2
  86. package/dist/collection/components/swirl-text-input/swirl-text-input.js +8 -4
  87. package/dist/collection/components/swirl-text-input/swirl-text-input.spec.js +1 -4
  88. package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.js +15 -5
  89. package/dist/collection/components/swirl-time-input/swirl-time-input.js +10 -6
  90. package/dist/collection/components/swirl-toast/swirl-toast.js +4 -6
  91. package/dist/collection/components/swirl-toast-provider/swirl-toast-provider.js +8 -3
  92. package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +6 -8
  93. package/dist/collection/prototypes/file-manager/file-manager.js +2 -4
  94. package/dist/components/assets/pdfjs/pdf.worker.min.js +0 -22
  95. package/dist/components/file-manager.js +2 -4
  96. package/dist/components/swirl-action-list-item2.js +5 -7
  97. package/dist/components/swirl-action-list2.js +3 -5
  98. package/dist/components/swirl-app-bar.js +1 -2
  99. package/dist/components/swirl-app-layout2.js +1 -2
  100. package/dist/components/swirl-autocomplete.js +4 -6
  101. package/dist/components/swirl-avatar-group.js +1 -1
  102. package/dist/components/swirl-banner.js +5 -7
  103. package/dist/components/swirl-button2.js +2 -3
  104. package/dist/components/swirl-carousel.js +3 -4
  105. package/dist/components/swirl-chip.js +2 -3
  106. package/dist/components/swirl-console-layout.js +2 -4
  107. package/dist/components/swirl-date-input.js +14 -7
  108. package/dist/components/swirl-dialog.js +4 -5
  109. package/dist/components/swirl-file-viewer-csv2.js +2 -4
  110. package/dist/components/swirl-file-viewer-pdf2.js +11 -16
  111. package/dist/components/swirl-form-control.js +1 -2
  112. package/dist/components/swirl-inline-error2.js +2 -3
  113. package/dist/components/swirl-inline-status.js +1 -2
  114. package/dist/components/swirl-lightbox.js +8 -16
  115. package/dist/components/swirl-menu-item.js +4 -7
  116. package/dist/components/swirl-menu.js +6 -8
  117. package/dist/components/swirl-modal.js +16 -6
  118. package/dist/components/swirl-option-list-item2.js +3 -5
  119. package/dist/components/swirl-option-list2.js +5 -8
  120. package/dist/components/swirl-pdf-reader.js +3 -5
  121. package/dist/components/swirl-popover-trigger2.js +1 -2
  122. package/dist/components/swirl-popover2.js +8 -12
  123. package/dist/components/swirl-resource-list-file-item.js +2 -3
  124. package/dist/components/swirl-resource-list-item2.js +3 -5
  125. package/dist/components/swirl-resource-list2.js +6 -8
  126. package/dist/components/swirl-search.js +8 -3
  127. package/dist/components/swirl-select.js +9 -7
  128. package/dist/components/swirl-shell-layout.js +2 -3
  129. package/dist/components/swirl-table-column.js +1 -1
  130. package/dist/components/swirl-table-row.js +1 -1
  131. package/dist/components/swirl-table.js +1 -2
  132. package/dist/components/swirl-tabs.js +2 -4
  133. package/dist/components/swirl-tag2.js +1 -2
  134. package/dist/components/swirl-text-input2.js +8 -4
  135. package/dist/components/swirl-theme-provider.js +15 -5
  136. package/dist/components/swirl-time-input.js +10 -6
  137. package/dist/components/swirl-toast-provider.js +8 -3
  138. package/dist/components/swirl-toast2.js +4 -6
  139. package/dist/components/swirl-tooltip.js +6 -8
  140. package/dist/esm/file-manager.entry.js +2 -4
  141. package/dist/esm/loader.js +1 -1
  142. package/dist/esm/swirl-action-list_3.entry.js +8 -12
  143. package/dist/esm/swirl-app-bar.entry.js +1 -2
  144. package/dist/esm/swirl-app-layout_7.entry.js +10 -15
  145. package/dist/esm/swirl-autocomplete.entry.js +4 -6
  146. package/dist/esm/swirl-avatar-group.entry.js +1 -1
  147. package/dist/esm/swirl-banner.entry.js +5 -7
  148. package/dist/esm/swirl-button.entry.js +2 -3
  149. package/dist/esm/swirl-carousel.entry.js +3 -4
  150. package/dist/esm/swirl-chip.entry.js +2 -3
  151. package/dist/esm/swirl-components.js +1 -1
  152. package/dist/esm/swirl-console-layout.entry.js +2 -4
  153. package/dist/esm/swirl-date-input.entry.js +14 -7
  154. package/dist/esm/swirl-dialog.entry.js +4 -5
  155. package/dist/esm/swirl-file-viewer_7.entry.js +13 -20
  156. package/dist/esm/swirl-form-control.entry.js +1 -2
  157. package/dist/esm/swirl-icon-check-small_3.entry.js +3 -5
  158. package/dist/esm/swirl-icon-error_3.entry.js +2 -3
  159. package/dist/esm/swirl-inline-status.entry.js +1 -2
  160. package/dist/esm/swirl-lightbox.entry.js +8 -16
  161. package/dist/esm/swirl-menu-item.entry.js +4 -7
  162. package/dist/esm/swirl-menu.entry.js +6 -8
  163. package/dist/esm/swirl-modal.entry.js +15 -6
  164. package/dist/esm/swirl-option-list.entry.js +5 -8
  165. package/dist/esm/swirl-pdf-reader.entry.js +3 -5
  166. package/dist/esm/swirl-popover_2.entry.js +9 -14
  167. package/dist/esm/swirl-resource-list-file-item.entry.js +2 -3
  168. package/dist/esm/swirl-search.entry.js +8 -3
  169. package/dist/esm/swirl-select.entry.js +9 -7
  170. package/dist/esm/swirl-shell-layout.entry.js +2 -3
  171. package/dist/esm/swirl-table-column.entry.js +1 -1
  172. package/dist/esm/swirl-table-row.entry.js +1 -1
  173. package/dist/esm/swirl-table.entry.js +1 -2
  174. package/dist/esm/swirl-tabs.entry.js +2 -4
  175. package/dist/esm/swirl-tag.entry.js +1 -2
  176. package/dist/esm/swirl-text-input.entry.js +8 -4
  177. package/dist/esm/swirl-theme-provider.entry.js +15 -5
  178. package/dist/esm/swirl-time-input.entry.js +10 -6
  179. package/dist/esm/swirl-toast-provider.entry.js +8 -3
  180. package/dist/esm/swirl-toast.entry.js +4 -6
  181. package/dist/esm/swirl-tooltip.entry.js +6 -8
  182. package/dist/swirl-components/p-07957b9a.entry.js +1 -0
  183. package/dist/swirl-components/p-1a05f16b.entry.js +1 -0
  184. package/dist/swirl-components/{p-1d92561c.entry.js → p-1a4c6557.entry.js} +1 -1
  185. package/dist/swirl-components/p-1f3c35bd.entry.js +1 -0
  186. package/dist/swirl-components/p-3da6d23a.entry.js +1 -0
  187. package/dist/swirl-components/{p-ab7f6735.entry.js → p-44196449.entry.js} +1 -1
  188. package/dist/swirl-components/p-4dafdcee.entry.js +1 -0
  189. package/dist/swirl-components/p-56fa872b.entry.js +1 -0
  190. package/dist/swirl-components/p-5fcf5a79.entry.js +1 -0
  191. package/dist/swirl-components/p-62f1aaae.entry.js +1 -0
  192. package/dist/swirl-components/p-684170ee.entry.js +1 -0
  193. package/dist/swirl-components/p-6f178b75.entry.js +1 -0
  194. package/dist/swirl-components/p-723f12cd.entry.js +1 -0
  195. package/dist/swirl-components/{p-bd0ba465.entry.js → p-7c9311c4.entry.js} +2 -2
  196. package/dist/swirl-components/p-7e90107b.entry.js +1 -0
  197. package/dist/swirl-components/p-81067ba3.entry.js +1 -0
  198. package/dist/swirl-components/p-8e5e6c16.entry.js +1 -0
  199. package/dist/swirl-components/p-902fc533.entry.js +1 -0
  200. package/dist/swirl-components/p-9c5e2b99.entry.js +1 -0
  201. package/dist/swirl-components/p-9c70b38e.entry.js +1 -0
  202. package/dist/swirl-components/p-a3e6a921.entry.js +1 -0
  203. package/dist/swirl-components/p-a8dc02be.entry.js +1 -0
  204. package/dist/swirl-components/p-baf3c630.entry.js +1 -0
  205. package/dist/swirl-components/p-bf317ae5.entry.js +1 -0
  206. package/dist/swirl-components/p-c3d23855.entry.js +1 -0
  207. package/dist/swirl-components/p-c4c4d5c4.entry.js +1 -0
  208. package/dist/swirl-components/p-ce1cd2e1.entry.js +1 -0
  209. package/dist/swirl-components/p-d14846f2.entry.js +1 -0
  210. package/dist/swirl-components/p-d1edd738.entry.js +10 -0
  211. package/dist/swirl-components/p-d3c3cb10.entry.js +1 -0
  212. package/dist/swirl-components/p-d3e39e06.entry.js +1 -0
  213. package/dist/swirl-components/p-d403f973.entry.js +1 -0
  214. package/dist/swirl-components/p-e4819964.entry.js +1 -0
  215. package/dist/swirl-components/p-e86c79d8.entry.js +1 -0
  216. package/dist/swirl-components/{p-b6e75c2e.entry.js → p-e9cefe04.entry.js} +1 -1
  217. package/dist/swirl-components/p-efb5e6ee.entry.js +1 -0
  218. package/dist/swirl-components/p-f299ab14.entry.js +1 -0
  219. package/dist/swirl-components/p-f703a664.entry.js +1 -0
  220. package/dist/swirl-components/p-fd7140dc.entry.js +1 -0
  221. package/dist/swirl-components/p-fdfeb16a.entry.js +1 -0
  222. package/dist/swirl-components/swirl-components.esm.js +1 -1
  223. package/dist/types/components/swirl-date-input/swirl-date-input.d.ts +1 -0
  224. package/dist/types/components/swirl-modal/swirl-modal.d.ts +5 -2
  225. package/dist/types/components/swirl-time-input/swirl-time-input.d.ts +1 -0
  226. package/dist/types/components.d.ts +5 -2
  227. package/package.json +2 -2
  228. package/vscode-data.json +4 -0
  229. package/dist/swirl-components/p-017fc399.entry.js +0 -1
  230. package/dist/swirl-components/p-028dbe1a.entry.js +0 -1
  231. package/dist/swirl-components/p-059f706f.entry.js +0 -1
  232. package/dist/swirl-components/p-062a4329.entry.js +0 -1
  233. package/dist/swirl-components/p-209e85c5.entry.js +0 -1
  234. package/dist/swirl-components/p-2278aeae.entry.js +0 -1
  235. package/dist/swirl-components/p-251884ec.entry.js +0 -1
  236. package/dist/swirl-components/p-27bdb25e.entry.js +0 -1
  237. package/dist/swirl-components/p-29147daa.entry.js +0 -1
  238. package/dist/swirl-components/p-29d32e39.entry.js +0 -1
  239. package/dist/swirl-components/p-2d5438ae.entry.js +0 -1
  240. package/dist/swirl-components/p-2fb83beb.entry.js +0 -1
  241. package/dist/swirl-components/p-30ae7d5c.entry.js +0 -1
  242. package/dist/swirl-components/p-34edf304.entry.js +0 -1
  243. package/dist/swirl-components/p-3d7a911b.entry.js +0 -1
  244. package/dist/swirl-components/p-5875e90e.entry.js +0 -1
  245. package/dist/swirl-components/p-67770da3.entry.js +0 -1
  246. package/dist/swirl-components/p-6832ee6c.entry.js +0 -1
  247. package/dist/swirl-components/p-687f534e.entry.js +0 -1
  248. package/dist/swirl-components/p-70db5c75.entry.js +0 -1
  249. package/dist/swirl-components/p-71c6c311.entry.js +0 -1
  250. package/dist/swirl-components/p-75a0a157.entry.js +0 -1
  251. package/dist/swirl-components/p-75d85160.entry.js +0 -1
  252. package/dist/swirl-components/p-794d25e2.entry.js +0 -1
  253. package/dist/swirl-components/p-873a1d91.entry.js +0 -1
  254. package/dist/swirl-components/p-8c62e1d4.entry.js +0 -1
  255. package/dist/swirl-components/p-8d92436f.entry.js +0 -1
  256. package/dist/swirl-components/p-97ac3d63.entry.js +0 -1
  257. package/dist/swirl-components/p-9d9427ab.entry.js +0 -1
  258. package/dist/swirl-components/p-a7568135.entry.js +0 -10
  259. package/dist/swirl-components/p-af46650d.entry.js +0 -1
  260. package/dist/swirl-components/p-d2845730.entry.js +0 -1
  261. package/dist/swirl-components/p-d56358aa.entry.js +0 -1
  262. package/dist/swirl-components/p-d5c14ee5.entry.js +0 -1
  263. package/dist/swirl-components/p-dd83db88.entry.js +0 -1
  264. package/dist/swirl-components/p-f6a11841.entry.js +0 -1
@@ -15,8 +15,7 @@ const SwirlLightbox = class {
15
15
  this.close();
16
16
  };
17
17
  this.onDownloadButtonClick = () => {
18
- var _a;
19
- (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.download();
18
+ this.slides[this.activeSlideIndex]?.download();
20
19
  this.menu.close();
21
20
  };
22
21
  this.onKeyDown = (event) => {
@@ -50,9 +49,8 @@ const SwirlLightbox = class {
50
49
  });
51
50
  };
52
51
  this.onPointerMove = async (event) => {
53
- var _a, _b;
54
52
  const isMultiTouch = !(event instanceof MouseEvent) && event.touches.length > 1;
55
- const imageViewer = (_b = (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("swirl-file-viewer-image");
53
+ const imageViewer = this.slides[this.activeSlideIndex]?.shadowRoot?.querySelector("swirl-file-viewer-image");
56
54
  const showsZoomedImage = Boolean(imageViewer)
57
55
  ? (await imageViewer.getZoom()) > 1
58
56
  : false;
@@ -111,8 +109,7 @@ const SwirlLightbox = class {
111
109
  this.activateSlide(0);
112
110
  }
113
111
  disconnectedCallback() {
114
- var _a;
115
- (_a = this.modal) === null || _a === void 0 ? void 0 : _a.destroy();
112
+ this.modal?.destroy();
116
113
  this.unlockBodyScroll();
117
114
  }
118
115
  /**
@@ -143,8 +140,7 @@ const SwirlLightbox = class {
143
140
  * @param newActiveSlideIndex
144
141
  */
145
142
  async activateSlide(newActiveSlideIndex) {
146
- var _a, _b;
147
- (_b = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
143
+ this.menu?.close?.();
148
144
  this.dragging = false;
149
145
  this.activeSlideIndex = newActiveSlideIndex;
150
146
  this.slides.forEach((slide, index) => {
@@ -190,16 +186,13 @@ const SwirlLightbox = class {
190
186
  });
191
187
  }
192
188
  getCurrentFileName() {
193
- var _a, _b;
194
- return (_b = (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.file) === null || _b === void 0 ? void 0 : _b.split("/").pop();
189
+ return this.slides[this.activeSlideIndex]?.file?.split("/").pop();
195
190
  }
196
191
  getCurrentFileType() {
197
- var _a;
198
- return (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.type;
192
+ return this.slides[this.activeSlideIndex]?.type;
199
193
  }
200
194
  getCurrentThumbnailUrl() {
201
- var _a;
202
- return (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.thumbnailUrl;
195
+ return this.slides[this.activeSlideIndex]?.thumbnailUrl;
203
196
  }
204
197
  lockBodyScroll() {
205
198
  disableBodyScroll(this.el);
@@ -216,8 +209,7 @@ const SwirlLightbox = class {
216
209
  }
217
210
  resetImageZoom() {
218
211
  this.slides.forEach((slide) => {
219
- var _a;
220
- const imageViewer = (_a = slide === null || slide === void 0 ? void 0 : slide.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("swirl-file-viewer-image");
212
+ const imageViewer = slide?.shadowRoot?.querySelector("swirl-file-viewer-image");
221
213
  if (Boolean(imageViewer)) {
222
214
  imageViewer.resetZoom();
223
215
  }
@@ -87,22 +87,19 @@ const SwirlMenuItem = class {
87
87
  : undefined;
88
88
  }
89
89
  renderActionListItem() {
90
- var _a, _b, _c;
91
- const badge = Boolean((_a = this.subMenu) === null || _a === void 0 ? void 0 : _a.value)
92
- ? (_c = Array.from(((_b = this.subMenu) === null || _b === void 0 ? void 0 : _b.querySelectorAll("swirl-menu-item")) || []).find((item) => { var _a; return item.value === ((_a = this.subMenu) === null || _a === void 0 ? void 0 : _a.value); })) === null || _c === void 0 ? void 0 : _c.label
90
+ const badge = Boolean(this.subMenu?.value)
91
+ ? Array.from(this.subMenu?.querySelectorAll("swirl-menu-item") || []).find((item) => item.value === this.subMenu?.value)?.label
93
92
  : undefined;
94
93
  return (h("swirl-action-list-item", { badge: badge, description: this.description, disabled: this.disabled, icon: this.icon, intent: this.intent, label: this.label, onClick: this.onActionListItemClick, ref: (el) => (this.actionListItem = el) }));
95
94
  }
96
95
  renderOptionListItem() {
97
- var _a;
98
- return (h("swirl-option-list-item", { disabled: this.disabled, icon: this.icon, label: this.label, onClick: this.onOptionListItemClick, onKeyDown: this.onOptionListItemKeyDown, onKeyUp: this.onOptionListItemKeyUp, ref: (el) => (this.optionListItem = el), selected: ((_a = this.parentMenu) === null || _a === void 0 ? void 0 : _a.value) === this.value, swirlAriaRole: "menuitemradio", value: this.value }));
96
+ return (h("swirl-option-list-item", { disabled: this.disabled, icon: this.icon, label: this.label, onClick: this.onOptionListItemClick, onKeyDown: this.onOptionListItemKeyDown, onKeyUp: this.onOptionListItemKeyUp, ref: (el) => (this.optionListItem = el), selected: this.parentMenu?.value === this.value, swirlAriaRole: "menuitemradio", value: this.value }));
99
97
  }
100
98
  render() {
101
- var _a;
102
99
  const className = classnames("menu-item", {
103
100
  "menu-item--expanded": this.expanded,
104
101
  });
105
- return (h(Host, null, h("div", { class: className }, ((_a = this.parentMenu) === null || _a === void 0 ? void 0 : _a.variant) === "selection"
102
+ return (h(Host, null, h("div", { class: className }, this.parentMenu?.variant === "selection"
106
103
  ? this.renderOptionListItem()
107
104
  : this.renderActionListItem(), h("slot", { onSlotchange: this.onSlotChange }))));
108
105
  }
@@ -120,10 +120,9 @@ const SwirlMenu = class {
120
120
  this.updateItems();
121
121
  }
122
122
  disconnectedCallback() {
123
- var _a, _b, _c;
124
123
  this.popover.removeEventListener("popoverClose", this.resetMenu);
125
- (_b = (_a = this.mobileMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.mediaQueryHandler);
126
- (_c = this.observer) === null || _c === void 0 ? void 0 : _c.disconnect();
124
+ this.mobileMediaQuery.removeEventListener?.("change", this.mediaQueryHandler);
125
+ this.observer?.disconnect();
127
126
  }
128
127
  watchActive() {
129
128
  this.reposition();
@@ -261,11 +260,10 @@ const SwirlMenu = class {
261
260
  getActiveItemIndex() {
262
261
  const activeElement = getActiveElement();
263
262
  return this.items.findIndex((item) => item === activeElement ||
264
- item === (activeElement === null || activeElement === void 0 ? void 0 : activeElement.querySelector('[role="menuitem"]')) ||
265
- item === (activeElement === null || activeElement === void 0 ? void 0 : activeElement.querySelector('[role="menuitemradio"]')));
263
+ item === activeElement?.querySelector('[role="menuitem"]') ||
264
+ item === activeElement?.querySelector('[role="menuitemradio"]'));
266
265
  }
267
266
  render() {
268
- var _a, _b;
269
267
  const isTopLevelMenu = !Boolean(this.parentMenu);
270
268
  const ariaLabel = isTopLevelMenu && this.mobile ? undefined : this.label;
271
269
  const ariaLabelledby = isTopLevelMenu && this.mobile ? "menu-title" : undefined;
@@ -277,8 +275,8 @@ const SwirlMenu = class {
277
275
  });
278
276
  return (h(Host, null, h("div", { class: className }, this.mobile && isTopLevelMenu && (h("div", { class: "menu__mobile-header" }, this.activeLevel === 0 && (h("swirl-button", { hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.mobileCloseMenuButtonLabel, onClick: this.onClose, variant: "plain" })), this.activeLevel > 0 && (h("swirl-button", { hideLabel: true, icon: "<swirl-icon-chevron-left></swirl-icon-chevron-left>", label: this.mobileBackButtonLabel, onClick: this.onGoBack, variant: "plain" })), h("span", { class: "menu__title", id: "menu-title" }, h("swirl-heading", { align: "center", as: "span", level: 4, text: this.label, truncate: true })), h("swirl-button", { class: "menu__done-button", intent: "primary", label: this.mobileDoneButtonLabel, onClick: this.onDone }))), h("div", { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": "vertical", class: "menu__menu", onKeyDown: this.onKeyDown, ref: (el) => (this.menuContainer = el), role: role, style: !this.mobile && this.level > 0
279
277
  ? {
280
- top: Boolean(this.position) ? `${(_a = this.position) === null || _a === void 0 ? void 0 : _a.y}px` : "",
281
- left: Boolean(this.position) ? `${(_b = this.position) === null || _b === void 0 ? void 0 : _b.x}px` : "",
278
+ top: Boolean(this.position) ? `${this.position?.y}px` : "",
279
+ left: Boolean(this.position) ? `${this.position?.x}px` : "",
282
280
  }
283
281
  : this.mobile
284
282
  ? {
@@ -1152,6 +1152,7 @@ const SwirlModal = class {
1152
1152
  this.modalClose = createEvent(this, "modalClose", 7);
1153
1153
  this.modalOpen = createEvent(this, "modalOpen", 7);
1154
1154
  this.primaryAction = createEvent(this, "primaryAction", 7);
1155
+ this.requestModalClose = createEvent(this, "requestModalClose", 7);
1155
1156
  this.secondaryAction = createEvent(this, "secondaryAction", 7);
1156
1157
  this.onKeyDown = (event) => {
1157
1158
  if (event.code === "Escape") {
@@ -1171,10 +1172,9 @@ const SwirlModal = class {
1171
1172
  this.secondaryAction.emit(event);
1172
1173
  };
1173
1174
  this.determineScrollStatus = () => {
1174
- var _a, _b, _c, _d, _e, _f;
1175
- const scrolled = ((_a = this.scrollContainer) === null || _a === void 0 ? void 0 : _a.scrollTop) > 0;
1176
- const scrolledDown = Math.ceil(((_b = this.scrollContainer) === null || _b === void 0 ? void 0 : _b.scrollTop) + ((_c = this.scrollContainer) === null || _c === void 0 ? void 0 : _c.offsetHeight)) >= ((_d = this.scrollContainer) === null || _d === void 0 ? void 0 : _d.scrollHeight);
1177
- const scrollable = ((_e = this.scrollContainer) === null || _e === void 0 ? void 0 : _e.scrollHeight) > ((_f = this.scrollContainer) === null || _f === void 0 ? void 0 : _f.offsetHeight);
1175
+ const scrolled = this.scrollContainer?.scrollTop > 0;
1176
+ const scrolledDown = Math.ceil(this.scrollContainer?.scrollTop + this.scrollContainer?.offsetHeight) >= this.scrollContainer?.scrollHeight;
1177
+ const scrollable = this.scrollContainer?.scrollHeight > this.scrollContainer?.offsetHeight;
1178
1178
  if (scrolled !== this.scrolled) {
1179
1179
  this.scrolled = scrolled;
1180
1180
  }
@@ -1185,6 +1185,7 @@ const SwirlModal = class {
1185
1185
  this.scrollable = scrollable;
1186
1186
  }
1187
1187
  };
1188
+ this.closable = true;
1188
1189
  this.closeButtonLabel = "Close modal";
1189
1190
  this.hideCloseButton = undefined;
1190
1191
  this.hideLabel = undefined;
@@ -1232,6 +1233,7 @@ const SwirlModal = class {
1232
1233
  // wait for animation
1233
1234
  setTimeout(() => {
1234
1235
  this.focusTrap.activate();
1236
+ this.handleAutoFocus();
1235
1237
  }, 200);
1236
1238
  }
1237
1239
  else {
@@ -1248,12 +1250,16 @@ const SwirlModal = class {
1248
1250
  this.determineScrollStatus();
1249
1251
  }
1250
1252
  /**
1251
- * Close the modal.
1253
+ * Close the modal. Pass `true` to force close even if the modal is not closable.
1252
1254
  */
1253
- async close() {
1255
+ async close(force) {
1254
1256
  if (this.closing) {
1255
1257
  return;
1256
1258
  }
1259
+ this.requestModalClose.emit();
1260
+ if (!this.closable && !force) {
1261
+ return;
1262
+ }
1257
1263
  this.closing = true;
1258
1264
  this.unlockBodyScroll();
1259
1265
  setTimeout(() => {
@@ -1271,6 +1277,9 @@ const SwirlModal = class {
1271
1277
  updateHeaderToolsStatus() {
1272
1278
  this.hasHeaderTools = Boolean(this.el.querySelector('[slot="header-tools"]'));
1273
1279
  }
1280
+ handleAutoFocus() {
1281
+ this.modalEl.querySelector("input[autofocus]")?.focus();
1282
+ }
1274
1283
  lockBodyScroll() {
1275
1284
  disableBodyScroll(this.scrollContainer);
1276
1285
  }
@@ -25,7 +25,7 @@ const SwirlOptionList = class {
25
25
  this.onClick = (event) => {
26
26
  event.preventDefault();
27
27
  const target = event.target;
28
- const item = target === null || target === void 0 ? void 0 : target.closest("swirl-option-list-item");
28
+ const item = target?.closest("swirl-option-list-item");
29
29
  const composedTarget = event.composedPath()[0];
30
30
  const clickedOption = Boolean(closestPassShadow(composedTarget, '[role="option"]'));
31
31
  if (!Boolean(item) || !clickedOption) {
@@ -134,9 +134,8 @@ const SwirlOptionList = class {
134
134
  this.setupDragDrop();
135
135
  }
136
136
  disconnectedCallback() {
137
- var _a, _b;
138
- (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
139
- (_b = this.sortable) === null || _b === void 0 ? void 0 : _b.destroy();
137
+ this.observer?.disconnect();
138
+ this.sortable?.destroy();
140
139
  }
141
140
  watchAllowDrag() {
142
141
  this.setItemAllowDragState();
@@ -264,16 +263,14 @@ const SwirlOptionList = class {
264
263
  }
265
264
  }
266
265
  syncItemsWithValue() {
267
- var _a;
268
- (_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => (item.selected = this.value.includes(item.value)));
266
+ this.items?.forEach((item) => (item.selected = this.value.includes(item.value)));
269
267
  }
270
268
  focusItem(index) {
271
- var _a;
272
269
  if (this.disabled) {
273
270
  return;
274
271
  }
275
272
  this.items.forEach((item) => item.querySelector('[role="option"]').removeAttribute("tabIndex"));
276
- const item = (_a = this.items[index]) === null || _a === void 0 ? void 0 : _a.querySelector('[role="option"]');
273
+ const item = this.items[index]?.querySelector('[role="option"]');
277
274
  if (!Boolean(item)) {
278
275
  return;
279
276
  }
@@ -70,9 +70,8 @@ const SwirlPdfReader = class {
70
70
  this.zoom = value === "auto" ? value : +value;
71
71
  };
72
72
  this.onThumbnailClick = (index) => () => {
73
- var _a;
74
- const page = (_a = querySelectorAllDeep(this.el, `[data-page-number="${index + 1}"]`)) === null || _a === void 0 ? void 0 : _a[0];
75
- page === null || page === void 0 ? void 0 : page.scrollIntoView();
73
+ const page = querySelectorAllDeep(this.el, `[data-page-number="${index + 1}"]`)?.[0];
74
+ page?.scrollIntoView();
76
75
  };
77
76
  this.autoZoomLabel = "Full width";
78
77
  this.closeButtonLabel = "Close PDF viewer";
@@ -108,9 +107,8 @@ const SwirlPdfReader = class {
108
107
  this.modal = new A11yDialog(this.modalEl);
109
108
  }
110
109
  disconnectedCallback() {
111
- var _a;
112
110
  this.unlockBodyScroll();
113
- (_a = this.modal) === null || _a === void 0 ? void 0 : _a.destroy();
111
+ this.modal?.destroy();
114
112
  }
115
113
  onWindowResize() {
116
114
  if (!Boolean(this.pdfViewer)) {
@@ -77,7 +77,6 @@ const SwirlPopover = class {
77
77
  this.unlockBodyScroll();
78
78
  }
79
79
  onWindowFocusIn(event) {
80
- var _a;
81
80
  if (!this.active) {
82
81
  return;
83
82
  }
@@ -88,7 +87,7 @@ const SwirlPopover = class {
88
87
  const popoverLostFocus = !this.el.contains(target) &&
89
88
  !this.el.contains(activeElement) &&
90
89
  target !== this.triggerEl &&
91
- !((_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.contains(target)) &&
90
+ !this.triggerEl?.contains(target) &&
92
91
  (!isSafari ||
93
92
  (isSafari &&
94
93
  !this.el.contains(relatedTarget || target) &&
@@ -118,7 +117,6 @@ const SwirlPopover = class {
118
117
  * @returns
119
118
  */
120
119
  async close() {
121
- var _a;
122
120
  if (this.closing || !this.active) {
123
121
  return;
124
122
  }
@@ -133,7 +131,7 @@ const SwirlPopover = class {
133
131
  this.updateTriggerAttributes();
134
132
  }, 150);
135
133
  this.unlockBodyScroll();
136
- (_a = this.getNativeTriggerElement()) === null || _a === void 0 ? void 0 : _a.focus();
134
+ this.getNativeTriggerElement()?.focus();
137
135
  }
138
136
  /**
139
137
  * Open the popover.
@@ -182,10 +180,9 @@ const SwirlPopover = class {
182
180
  });
183
181
  }
184
182
  getNativeTriggerElement() {
185
- var _a, _b, _c, _d;
186
- return ((_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.tagName.startsWith("SWIRL-"))
187
- ? (((_b = this.triggerEl) === null || _b === void 0 ? void 0 : _b.children[0]) ||
188
- ((_d = (_c = this.triggerEl) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.children[0]) ||
183
+ return this.triggerEl?.tagName.startsWith("SWIRL-")
184
+ ? (this.triggerEl?.children[0] ||
185
+ this.triggerEl?.shadowRoot?.children[0] ||
189
186
  this.triggerEl)
190
187
  : this.triggerEl;
191
188
  }
@@ -238,17 +235,16 @@ const SwirlPopover = class {
238
235
  enableBodyScroll(this.scrollContainer);
239
236
  }
240
237
  render() {
241
- var _a, _b, _c;
242
238
  const mobile = !window.matchMedia("(min-width: 768px)").matches;
243
- const className = classnames("popover", `popover--animation-${this.animation}`, `popover--placement-${(_a = this.position) === null || _a === void 0 ? void 0 : _a.placement}`, {
239
+ const className = classnames("popover", `popover--animation-${this.animation}`, `popover--placement-${this.position?.placement}`, {
244
240
  "popover--closing": this.closing,
245
241
  "popover--active": this.active,
246
242
  "popover--fullscreen-bottom-sheet": this.fullscreenBottomSheet,
247
243
  "popover--inactive": !this.active,
248
244
  });
249
245
  return (h(Host, null, h("div", { class: className, onKeyDown: this.onKeydown }, h("div", { "aria-hidden": !this.active ? "true" : "false", "aria-label": this.label, class: "popover__content", id: this.popoverId, part: "popover__content", role: "dialog", ref: (el) => (this.contentContainer = el), style: {
250
- top: Boolean(this.position) ? `${(_b = this.position) === null || _b === void 0 ? void 0 : _b.y}px` : "",
251
- left: Boolean(this.position) ? `${(_c = this.position) === null || _c === void 0 ? void 0 : _c.x}px` : "",
246
+ top: Boolean(this.position) ? `${this.position?.y}px` : "",
247
+ left: Boolean(this.position) ? `${this.position?.x}px` : "",
252
248
  }, tabindex: "-1" }, h("span", { class: "popover__handle" }), h("div", { class: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
253
249
  maxHeight: !mobile && Boolean(this.maxHeight)
254
250
  ? this.maxHeight
@@ -290,12 +286,11 @@ const SwirlPopoverTrigger = class {
290
286
  }, { once: true });
291
287
  };
292
288
  this.updateTriggerElAriaAttributes = (open) => {
293
- var _a;
294
289
  if (!this.setAriaAttributes) {
295
290
  return;
296
291
  }
297
292
  const triggerEl = this.getTriggerEl();
298
- const popoverId = typeof this.popover === "string" ? this.popover : (_a = this.popover) === null || _a === void 0 ? void 0 : _a.id;
293
+ const popoverId = typeof this.popover === "string" ? this.popover : this.popover?.id;
299
294
  if (triggerEl.tagName.startsWith("SWIRL-")) {
300
295
  triggerEl.setAttribute("swirl-aria-controls", popoverId);
301
296
  triggerEl.setAttribute("swirl-aria-expanded", String(open || "false"));
@@ -25,15 +25,14 @@ const SwirlResourceListFileItem = class {
25
25
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
26
26
  }
27
27
  disconnectedCallback() {
28
- var _a, _b;
29
- (_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
28
+ this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
30
29
  }
31
30
  forceIconProps(smallIcon) {
32
31
  if (!Boolean(this.iconEl)) {
33
32
  return;
34
33
  }
35
34
  const icon = this.iconEl.children[0];
36
- icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
35
+ icon?.setAttribute("size", smallIcon ? "20" : "24");
37
36
  }
38
37
  render() {
39
38
  const showError = Boolean(this.errorMessage);
@@ -45,17 +45,22 @@ const SwirlSearch = class {
45
45
  componentDidLoad() {
46
46
  this.forceIconProps(this.desktopMediaQuery.matches);
47
47
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
48
+ // see https://stackoverflow.com/a/27314017
49
+ if (this.autoFocus) {
50
+ setTimeout(() => {
51
+ this.input.focus();
52
+ });
53
+ }
48
54
  }
49
55
  disconnectedCallback() {
50
- var _a, _b;
51
- (_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
56
+ this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
52
57
  }
53
58
  forceIconProps(smallIcon) {
54
59
  if (!Boolean(this.iconEl)) {
55
60
  return;
56
61
  }
57
62
  const icon = this.iconEl.children[0];
58
- icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
63
+ icon?.setAttribute("size", smallIcon ? "20" : "24");
59
64
  }
60
65
  onKeyDown(event) {
61
66
  if ((event.code === "KeyK" || event.code === "Slash") &&
@@ -26,8 +26,7 @@ const SwirlSelect = class {
26
26
  this.updateOptions();
27
27
  };
28
28
  this.onOpen = (event) => {
29
- var _a;
30
- this.placement = (_a = event.detail.position) === null || _a === void 0 ? void 0 : _a.placement;
29
+ this.placement = event.detail.position?.placement;
31
30
  this.open = true;
32
31
  };
33
32
  this.onClose = () => {
@@ -67,15 +66,16 @@ const SwirlSelect = class {
67
66
  this.options = querySelectorAllDeep(this.el, "swirl-option-list-item");
68
67
  }
69
68
  render() {
70
- var _a, _b, _c;
71
69
  const label = Boolean(this.value)
72
- ? (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => { var _a; return (_a = this.options.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.label; }).join(", ")
70
+ ? this.value
71
+ ?.map((value) => this.options.find((option) => option.value === value)?.label)
72
+ .join(", ")
73
73
  : "";
74
74
  const ariaInvalid = this.invalid === true || this.invalid === false
75
75
  ? String(this.invalid)
76
76
  : undefined;
77
77
  const formControl = this.el.closest("swirl-form-control");
78
- const offset = (formControl === null || formControl === void 0 ? void 0 : formControl.inline) || (formControl === null || formControl === void 0 ? void 0 : formControl.labelPosition) === "outside"
78
+ const offset = formControl?.inline || formControl?.labelPosition === "outside"
79
79
  ? -12
80
80
  : -16;
81
81
  const className = classnames("select", `select--placement-${this.placement}`, {
@@ -83,9 +83,11 @@ const SwirlSelect = class {
83
83
  "select--inline": this.inline,
84
84
  "select--multi": this.multiSelect,
85
85
  });
86
- return (h(Host, { onKeyDown: this.onKeyDown }, h("div", { class: className }, h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, type: "text", value: label })), h("span", { class: "select__multi-select-values" }, (_c = (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => this.options.find((option) => option.value === value))) === null || _c === void 0 ? void 0 : _c.map((option) => (h("swirl-tag", { "aria-hidden": "true", label: option === null || option === void 0 ? void 0 : option.label,
86
+ return (h(Host, { onKeyDown: this.onKeyDown }, h("div", { class: className }, h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, type: "text", value: label })), h("span", { class: "select__multi-select-values" }, this.value
87
+ ?.map((value) => this.options.find((option) => option.value === value))
88
+ ?.map((option) => (h("swirl-tag", { "aria-hidden": "true", label: option?.label,
87
89
  // eslint-disable-next-line react/jsx-no-bind
88
- onRemove: () => this.unselectOption(option === null || option === void 0 ? void 0 : option.value), removable: !this.disabled && this.allowDeselect })))), h("span", { class: "select__indicator" }, this.open ? (h("swirl-icon-expand-less", null)) : (h("swirl-icon-expand-more", null))), h("swirl-popover", { animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: [0, offset], onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.popover = el), useContainerWidth: "swirl-form-control" }, h("swirl-option-list", { allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, value: this.value }, h("slot", { onSlotchange: this.onSlotChange }))))));
90
+ onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect })))), h("span", { class: "select__indicator" }, this.open ? (h("swirl-icon-expand-less", null)) : (h("swirl-icon-expand-more", null))), h("swirl-popover", { animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: [0, offset], onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.popover = el), useContainerWidth: "swirl-form-control" }, h("swirl-option-list", { allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, value: this.value }, h("slot", { onSlotchange: this.onSlotChange }))))));
89
91
  }
90
92
  get el() { return getElement(this); }
91
93
  };
@@ -47,10 +47,9 @@ const SwirlShellLayout = class {
47
47
  }
48
48
  };
49
49
  this.onSidebarClick = () => {
50
- var _a, _b;
51
50
  if (this.collapsedSidebar) {
52
- (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
53
- (_b = getActiveElement()) === null || _b === void 0 ? void 0 : _b.blur();
51
+ document.activeElement?.blur();
52
+ getActiveElement()?.blur();
54
53
  }
55
54
  };
56
55
  this.onSidebarMouseEnter = () => {
@@ -15,7 +15,7 @@ const SwirlTableColumn = class {
15
15
  }
16
16
  componentDidRender() {
17
17
  const table = closestPassShadow(this.el, "swirl-table");
18
- table === null || table === void 0 ? void 0 : table.rerender();
18
+ table?.rerender();
19
19
  }
20
20
  render() {
21
21
  const styles = {
@@ -12,7 +12,7 @@ const SwirlTableRow = class {
12
12
  }
13
13
  componentDidLoad() {
14
14
  const table = closestPassShadow(this.el, "swirl-table");
15
- table === null || table === void 0 ? void 0 : table.rerender();
15
+ table?.rerender();
16
16
  }
17
17
  render() {
18
18
  const className = classnames("table-row", {
@@ -206,9 +206,8 @@ const SwirlTable = class {
206
206
  emptyRow.style.width = scrollWidth;
207
207
  }
208
208
  layoutRowGroups() {
209
- var _a;
210
209
  const tableRowGroups = Array.from(this.el.querySelectorAll("swirl-table-row-group"));
211
- const scrollWidth = `${(_a = this.el.shadowRoot.querySelector(".table__container")) === null || _a === void 0 ? void 0 : _a.scrollWidth}px`;
210
+ const scrollWidth = `${this.el.shadowRoot.querySelector(".table__container")?.scrollWidth}px`;
212
211
  tableRowGroups.forEach((tableRowGroup) => {
213
212
  const headerRow = tableRowGroup.shadowRoot.querySelector(".table-row-group__header-row");
214
213
  if (!Boolean(headerRow)) {
@@ -48,8 +48,7 @@ const SwirlTabs = class {
48
48
  const nextIndex = Math.min(this.tabs.length - 1, currentIndex + 1);
49
49
  this.activateTab(this.tabs[nextIndex].tabId);
50
50
  requestAnimationFrame(() => {
51
- var _a;
52
- (_a = this.el.querySelector(".tabs__tab--active")) === null || _a === void 0 ? void 0 : _a.focus();
51
+ this.el.querySelector(".tabs__tab--active")?.focus();
53
52
  });
54
53
  }
55
54
  activatePreviousTab() {
@@ -57,8 +56,7 @@ const SwirlTabs = class {
57
56
  const previousIndex = Math.max(0, currentIndex - 1);
58
57
  this.activateTab(this.tabs[previousIndex].tabId);
59
58
  requestAnimationFrame(() => {
60
- var _a;
61
- (_a = this.el.querySelector(".tabs__tab--active")) === null || _a === void 0 ? void 0 : _a.focus();
59
+ this.el.querySelector(".tabs__tab--active")?.focus();
62
60
  });
63
61
  }
64
62
  collectTabs() {
@@ -8,8 +8,7 @@ const SwirlTag = class {
8
8
  registerInstance(this, hostRef);
9
9
  this.remove = createEvent(this, "remove", 7);
10
10
  this.onRemove = (event) => {
11
- var _a;
12
- (_a = this.remove) === null || _a === void 0 ? void 0 : _a.emit(event);
11
+ this.remove?.emit(event);
13
12
  };
14
13
  this.intent = "default";
15
14
  this.label = undefined;
@@ -109,13 +109,18 @@ const SwirlTextInput = class {
109
109
  componentDidLoad() {
110
110
  this.updateIconSize(this.desktopMediaQuery.matches);
111
111
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
112
+ // see https://stackoverflow.com/a/27314017
113
+ if (this.autoFocus) {
114
+ setTimeout(() => {
115
+ this.inputEl.focus();
116
+ });
117
+ }
112
118
  }
113
119
  componentDidRender() {
114
120
  this.adjustInputSize();
115
121
  }
116
122
  disconnectedCallback() {
117
- var _a, _b;
118
- (_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
123
+ this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
119
124
  }
120
125
  updateIconSize(smallIcon) {
121
126
  this.iconSize = smallIcon ? 20 : 24;
@@ -145,7 +150,6 @@ const SwirlTextInput = class {
145
150
  event.target.select();
146
151
  }
147
152
  render() {
148
- var _a;
149
153
  const Tag = this.rows === 1 && !this.autoGrow ? "input" : "textarea";
150
154
  const ariaInvalid = this.invalid === true || this.invalid === false
151
155
  ? String(this.invalid)
@@ -168,7 +172,7 @@ const SwirlTextInput = class {
168
172
  "text-input--inline": this.inline,
169
173
  "text-input--show-password": this.type === "password" && this.showPassword,
170
174
  });
171
- return (h(Host, null, h("div", { class: className }, this.prefixLabel && (h("span", { class: "text-input__prefix" }, this.prefixLabel)), h(Tag, { "aria-autocomplete": this.swirlAriaAutocomplete, "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-invalid": ariaInvalid, autoComplete: this.autoComplete, autoFocus: this.autoFocus, class: "text-input__input", disabled: this.disabled, inputMode: this.mode, maxLength: this.maxLength, max: this.type === "number" ? this.max : undefined, min: this.type === "number" ? this.min : undefined, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, onKeyPress: this.onKeyPress, placeholder: !Boolean(this.suffixLabel) ? this.placeholder : undefined, ref: (el) => (this.inputEl = el), required: this.required, role: this.swirlRole, rows: this.rows > 1 ? this.rows : this.autoGrow ? 1 : undefined, spellcheck: this.spellCheck, step: this.type === "number" ? this.step : undefined, type: type, value: this.value }, this.rows > 1 && this.value), this.suffixLabel && (h("span", { class: "text-input__suffix" }, this.suffixLabel)), showClearButton && (h("button", { "aria-label": this.clearButtonLabel, class: "text-input__clear-button", onClick: this.clear, part: "text-input__clear-button", type: "button" }, h("swirl-icon-cancel", { size: this.iconSize }))), showPasswordToggle && (h("button", { "aria-label": this.passwordToggleLabel, class: "text-input__password-toggle", onClick: this.togglePassword, type: "button" }, this.showPassword ? (h("swirl-icon-visibility-off", { size: this.iconSize })) : (h("swirl-icon-visibility", { size: this.iconSize })))), showStepper && (h("span", { class: "text-input__stepper" }, h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.increaseValue, tabIndex: -1, type: "button" }, h("swirl-icon-expand-less", { size: this.iconSize })), h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.decreaseValue, tabIndex: -1, type: "button" }, h("swirl-icon-expand-more", { size: this.iconSize })))), this.showCharacterCounter && (h("span", { class: "text-input__character-counter" }, ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) || 0, " ", Boolean(this.maxLength) ? `/ ${this.maxLength}` : "")))));
175
+ return (h(Host, null, h("div", { class: className }, this.prefixLabel && (h("span", { class: "text-input__prefix" }, this.prefixLabel)), h(Tag, { "aria-autocomplete": this.swirlAriaAutocomplete, "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-invalid": ariaInvalid, autoComplete: this.autoComplete, autoFocus: this.autoFocus, class: "text-input__input", disabled: this.disabled, inputMode: this.mode, maxLength: this.maxLength, max: this.type === "number" ? this.max : undefined, min: this.type === "number" ? this.min : undefined, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, onKeyPress: this.onKeyPress, placeholder: !Boolean(this.suffixLabel) ? this.placeholder : undefined, ref: (el) => (this.inputEl = el), required: this.required, role: this.swirlRole, rows: this.rows > 1 ? this.rows : this.autoGrow ? 1 : undefined, spellcheck: this.spellCheck, step: this.type === "number" ? this.step : undefined, type: type, value: this.value }, this.rows > 1 && this.value), this.suffixLabel && (h("span", { class: "text-input__suffix" }, this.suffixLabel)), showClearButton && (h("button", { "aria-label": this.clearButtonLabel, class: "text-input__clear-button", onClick: this.clear, part: "text-input__clear-button", type: "button" }, h("swirl-icon-cancel", { size: this.iconSize }))), showPasswordToggle && (h("button", { "aria-label": this.passwordToggleLabel, class: "text-input__password-toggle", onClick: this.togglePassword, type: "button" }, this.showPassword ? (h("swirl-icon-visibility-off", { size: this.iconSize })) : (h("swirl-icon-visibility", { size: this.iconSize })))), showStepper && (h("span", { class: "text-input__stepper" }, h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.increaseValue, tabIndex: -1, type: "button" }, h("swirl-icon-expand-less", { size: this.iconSize })), h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.decreaseValue, tabIndex: -1, type: "button" }, h("swirl-icon-expand-more", { size: this.iconSize })))), this.showCharacterCounter && (h("span", { class: "text-input__character-counter" }, this.value?.length || 0, " ", Boolean(this.maxLength) ? `/ ${this.maxLength}` : "")))));
172
176
  }
173
177
  };
174
178
  SwirlTextInput.style = swirlTextInputCss;
@@ -292,8 +292,11 @@ const SwirlThemeProvider = class {
292
292
  this.updateAppTheme();
293
293
  }
294
294
  resolveConfig() {
295
- var _a, _b;
296
- this.resolvedConfig = Object.assign(Object.assign({}, (this.config || {})), { rootElement: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.rootElement) || document.documentElement, storage: ((_b = this.config) === null || _b === void 0 ? void 0 : _b.storage) || (window === null || window === void 0 ? void 0 : window.localStorage) });
295
+ this.resolvedConfig = {
296
+ ...(this.config || {}),
297
+ rootElement: this.config?.rootElement || document.documentElement,
298
+ storage: this.config?.storage || window?.localStorage,
299
+ };
297
300
  }
298
301
  determineOSTheme() {
299
302
  if (!Boolean(window.matchMedia)) {
@@ -332,8 +335,7 @@ const SwirlThemeProvider = class {
332
335
  }
333
336
  }
334
337
  updateTenantVariables() {
335
- var _a;
336
- const tenantTheme = (_a = this.resolvedConfig) === null || _a === void 0 ? void 0 : _a.tenantColors;
338
+ const tenantTheme = this.resolvedConfig?.tenantColors;
337
339
  if (!Boolean(tenantTheme)) {
338
340
  this.resetTenantVariables();
339
341
  return;
@@ -349,7 +351,15 @@ const SwirlThemeProvider = class {
349
351
  const secondaryPressed = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.15, 1));
350
352
  const textHovered = toRgba(hsla(textHsla[0], textHsla[1] - 0.34, textHsla[2] + 0.1, 1));
351
353
  const textPressed = toRgba(hsla(textHsla[0], textHsla[1] - 0.48, textHsla[2] + 0.2, 1));
352
- const tenantThemeWithGeneratedStateColors = Object.assign(Object.assign({}, tenantTheme), { primaryHovered: primaryHovered, primaryPressed: primaryPressed, secondaryHovered: secondaryHovered, secondaryPressed: secondaryPressed, textHovered: textHovered, textPressed: textPressed });
354
+ const tenantThemeWithGeneratedStateColors = {
355
+ ...tenantTheme,
356
+ primaryHovered: primaryHovered,
357
+ primaryPressed: primaryPressed,
358
+ secondaryHovered: secondaryHovered,
359
+ secondaryPressed: secondaryPressed,
360
+ textHovered: textHovered,
361
+ textPressed: textPressed,
362
+ };
353
363
  // set custom properties for tenant theme colors
354
364
  Object.entries(tenantColorMapping).forEach(([key, value]) => rootElement.style.setProperty(key, tenantThemeWithGeneratedStateColors[value]));
355
365
  }