@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
@@ -71,8 +71,11 @@ export class SwirlThemeProvider {
71
71
  this.updateAppTheme();
72
72
  }
73
73
  resolveConfig() {
74
- var _a, _b;
75
- 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) });
74
+ this.resolvedConfig = {
75
+ ...(this.config || {}),
76
+ rootElement: this.config?.rootElement || document.documentElement,
77
+ storage: this.config?.storage || window?.localStorage,
78
+ };
76
79
  }
77
80
  determineOSTheme() {
78
81
  if (!Boolean(window.matchMedia)) {
@@ -111,8 +114,7 @@ export class SwirlThemeProvider {
111
114
  }
112
115
  }
113
116
  updateTenantVariables() {
114
- var _a;
115
- const tenantTheme = (_a = this.resolvedConfig) === null || _a === void 0 ? void 0 : _a.tenantColors;
117
+ const tenantTheme = this.resolvedConfig?.tenantColors;
116
118
  if (!Boolean(tenantTheme)) {
117
119
  this.resetTenantVariables();
118
120
  return;
@@ -128,7 +130,15 @@ export class SwirlThemeProvider {
128
130
  const secondaryPressed = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.15, 1));
129
131
  const textHovered = toRgba(hsla(textHsla[0], textHsla[1] - 0.34, textHsla[2] + 0.1, 1));
130
132
  const textPressed = toRgba(hsla(textHsla[0], textHsla[1] - 0.48, textHsla[2] + 0.2, 1));
131
- const tenantThemeWithGeneratedStateColors = Object.assign(Object.assign({}, tenantTheme), { primaryHovered: primaryHovered, primaryPressed: primaryPressed, secondaryHovered: secondaryHovered, secondaryPressed: secondaryPressed, textHovered: textHovered, textPressed: textPressed });
133
+ const tenantThemeWithGeneratedStateColors = {
134
+ ...tenantTheme,
135
+ primaryHovered: primaryHovered,
136
+ primaryPressed: primaryPressed,
137
+ secondaryHovered: secondaryHovered,
138
+ secondaryPressed: secondaryPressed,
139
+ textHovered: textHovered,
140
+ textPressed: textPressed,
141
+ };
132
142
  // set custom properties for tenant theme colors
133
143
  Object.entries(tenantColorMapping).forEach(([key, value]) => rootElement.style.setProperty(key, tenantThemeWithGeneratedStateColors[value]));
134
144
  }
@@ -73,11 +73,16 @@ export class SwirlTimeInput {
73
73
  this.setupMask();
74
74
  this.updateIconSize(this.desktopMediaQuery.matches);
75
75
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
76
+ // see https://stackoverflow.com/a/27314017
77
+ if (this.autoFocus) {
78
+ setTimeout(() => {
79
+ this.inputEl.focus();
80
+ });
81
+ }
76
82
  }
77
83
  disconnectedCallback() {
78
- var _a, _b, _c;
79
- (_a = this.mask) === null || _a === void 0 ? void 0 : _a.destroy();
80
- (_c = (_b = this.desktopMediaQuery).removeEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "change", this.desktopMediaQueryHandler);
84
+ this.mask?.destroy();
85
+ this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
81
86
  }
82
87
  watchFormat() {
83
88
  this.setupMask();
@@ -92,8 +97,7 @@ export class SwirlTimeInput {
92
97
  event.target.select();
93
98
  }
94
99
  setupMask() {
95
- var _a;
96
- (_a = this.mask) === null || _a === void 0 ? void 0 : _a.destroy();
100
+ this.mask?.destroy();
97
101
  this.mask = createMask(`#${this.id}`, {
98
102
  mask: this.format.replace(/[Hhms]/g, "#"),
99
103
  });
@@ -111,7 +115,7 @@ export class SwirlTimeInput {
111
115
  const className = classnames("time-input", {
112
116
  "time-input--inline": this.inline,
113
117
  });
114
- return (h(Host, null, h("div", { class: className }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "time-input__input", disabled: this.disabled, id: this.id, onBlur: this.onBlur, onClick: this.onClick, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder, required: this.required, type: "text", value: displayValue }), h("span", { class: "time-input__icon" }, h("swirl-icon-time-outlined", { size: this.iconSize })))));
118
+ return (h(Host, null, h("div", { class: className }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "time-input__input", disabled: this.disabled, id: this.id, onBlur: this.onBlur, onClick: this.onClick, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder, ref: (el) => (this.inputEl = el), required: this.required, type: "text", value: displayValue }), h("span", { class: "time-input__icon" }, h("swirl-icon-time-outlined", { size: this.iconSize })))));
115
119
  }
116
120
  static get is() { return "swirl-time-input"; }
117
121
  static get encapsulation() { return "scoped"; }
@@ -27,15 +27,13 @@ export class SwirlToast {
27
27
  this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
28
28
  }
29
29
  disconnectedCallback() {
30
- var _a, _b;
31
- (_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
30
+ this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
32
31
  }
33
32
  forceIconProps(smallIcon) {
34
- var _a;
35
- const icon = (_a = this.iconEl) === null || _a === void 0 ? void 0 : _a.children[0];
33
+ const icon = this.iconEl?.children[0];
36
34
  const dismissIcon = this.dismissIconEl;
37
- icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
38
- dismissIcon === null || dismissIcon === void 0 ? void 0 : dismissIcon.setAttribute("size", smallIcon ? "20" : "24");
35
+ icon?.setAttribute("size", smallIcon ? "20" : "24");
36
+ dismissIcon?.setAttribute("size", smallIcon ? "20" : "24");
39
37
  }
40
38
  startTimer() {
41
39
  this.clearTimer();
@@ -39,14 +39,19 @@ export class SwirlToastProvider {
39
39
  else if (this.globalDuration === 0) {
40
40
  duration = undefined;
41
41
  }
42
- const newToastWithId = Object.assign(Object.assign({}, newToast), { createdAt: new Date(), duration, toastId: newToast.toastId || String(Math.round(Math.random() * 10000)) });
42
+ const newToastWithId = {
43
+ ...newToast,
44
+ createdAt: new Date(),
45
+ duration,
46
+ toastId: newToast.toastId || String(Math.round(Math.random() * 10000)),
47
+ };
43
48
  this.toasts = [...this.toasts, newToastWithId];
44
49
  return newToastWithId;
45
50
  }
46
51
  render() {
47
52
  return (h(Host, { role: "status" }, h("swirl-stack", { spacing: "12" }, this.toasts.map((toast) => {
48
- const props = Object.assign(Object.assign({}, toast), { content: undefined });
49
- return (h("swirl-toast", Object.assign({ key: toast.toastId, onDismiss: this.onDismiss }, props), toast.content));
53
+ const props = { ...toast, content: undefined };
54
+ return (h("swirl-toast", { key: toast.toastId, onDismiss: this.onDismiss, ...props }, toast.content));
50
55
  }))));
51
56
  }
52
57
  static get is() { return "swirl-toast-provider"; }
@@ -46,29 +46,28 @@ export class SwirlTooltip {
46
46
  };
47
47
  };
48
48
  this.getArrowStyles = () => {
49
- var _a, _b, _c, _d;
50
- if (((_a = this.actualPosition) === null || _a === void 0 ? void 0 : _a.placement) === "top") {
49
+ if (this.actualPosition?.placement === "top") {
51
50
  return {
52
51
  top: "100%",
53
52
  left: "50%",
54
53
  transform: "translate3d(-50%, -50%, 0) rotate(45deg)",
55
54
  };
56
55
  }
57
- if (((_b = this.actualPosition) === null || _b === void 0 ? void 0 : _b.placement) === "bottom") {
56
+ if (this.actualPosition?.placement === "bottom") {
58
57
  return {
59
58
  bottom: "100%",
60
59
  left: "50%",
61
60
  transform: "translate3d(-50%, 50%, 0) rotate(45deg)",
62
61
  };
63
62
  }
64
- if (((_c = this.actualPosition) === null || _c === void 0 ? void 0 : _c.placement) === "right") {
63
+ if (this.actualPosition?.placement === "right") {
65
64
  return {
66
65
  top: "50%",
67
66
  right: "100%",
68
67
  transform: "translate3d(50%, -50%, 0) rotate(45deg)",
69
68
  };
70
69
  }
71
- if (((_d = this.actualPosition) === null || _d === void 0 ? void 0 : _d.placement) === "left") {
70
+ if (this.actualPosition?.placement === "left") {
72
71
  return {
73
72
  top: "50%",
74
73
  left: "100%",
@@ -104,14 +103,13 @@ export class SwirlTooltip {
104
103
  this.updateOptions();
105
104
  }
106
105
  render() {
107
- var _a, _b;
108
106
  const arrowStyles = this.getArrowStyles();
109
107
  return (h(Host, { onKeydown: this.onKeydown }, h("span", { class: "tooltip" }, h("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onBlur: this.hide, onClick: this.hide, onFocus: this.show, ref: (el) => (this.referenceEl = el), tabIndex: 0 }, h("slot", null)), h("span", { class: "tooltip__popper", ref: (el) => (this.popperEl = el), style: {
110
108
  top: Boolean(this.actualPosition)
111
- ? `${(_a = this.actualPosition) === null || _a === void 0 ? void 0 : _a.y}px`
109
+ ? `${this.actualPosition?.y}px`
112
110
  : "",
113
111
  left: Boolean(this.actualPosition)
114
- ? `${(_b = this.actualPosition) === null || _b === void 0 ? void 0 : _b.x}px`
112
+ ? `${this.actualPosition?.x}px`
115
113
  : "",
116
114
  } }, this.visible && (h("span", { class: "tooltip__bubble", id: "tooltip", part: "tooltip__bubble", role: "tooltip" }, h("span", { class: "tooltip__content", innerHTML: this.content }), h("span", { class: "tooltip__arrow", style: arrowStyles })))))));
117
115
  }
@@ -41,8 +41,7 @@ export class FileManager {
41
41
  this.selectedDirectory = undefined;
42
42
  };
43
43
  this.toggleSidebar = () => {
44
- var _a;
45
- (_a = this.layout) === null || _a === void 0 ? void 0 : _a.toggleSidebar();
44
+ this.layout?.toggleSidebar();
46
45
  };
47
46
  this.selectedDirectory = undefined;
48
47
  this.selectedFile = undefined;
@@ -57,8 +56,7 @@ export class FileManager {
57
56
  onClick: () => this.selectItem(item) }, "type" in item ? (h("swirl-icon-file", { slot: "media" })) : (h("swirl-icon-folder-shared", { slot: "media" })))))) : (h("swirl-box", { padding: "16" }, h("swirl-text", { color: "subdued", weight: "medium" }, "This directory is empty.")));
58
57
  }
59
58
  render() {
60
- var _a, _b;
61
- return (h(Host, null, h("swirl-app-layout", { appName: "Documents", backToNavigationViewButtonLabel: "Back to documents list", ctaIcon: "<swirl-icon-add></swirl-icon-add>", ctaLabel: "Upload file", navigationLabel: "Documents", onNavigationBackButtonClick: this.resetSelectedDirectory, ref: (el) => (this.layout = el), sidebarCloseButtonLabel: "Close file info", sidebarHeading: "File info", showNavigationBackButton: Boolean(this.selectedDirectory), transitionStyle: "dialog" }, h("swirl-resource-list", { label: "Documents", slot: "navigation" }, this.renderNavigation()), h("swirl-popover-trigger", { popover: this.sortMenu, slot: "navigation-controls" }, h("swirl-button", { label: "Sort items" })), h("swirl-stack", { orientation: "horizontal", slot: "app-bar" }, h("swirl-stack", null, h("swirl-heading", { as: "h2", level: 4, text: (_a = this.selectedFile) === null || _a === void 0 ? void 0 : _a.name }), h("swirl-text", { color: "subdued", truncate: true }, (_b = this.selectedFile) === null || _b === void 0 ? void 0 : _b.description))), Boolean(this.selectedFile) ? (h("swirl-file-viewer", { file: this.selectedFile.url, slot: "content", type: this.selectedFile.type })) : (h("swirl-box", { cover: true, centerBlock: true, centerInline: true, padding: "16", slot: "content" }, h("swirl-empty-state", { heading: "Nothing to see here.", illustration: "/images/empty-state-1.svg" }, "Please select a file from the list."))), h("div", { slot: "app-bar-controls" }, this.selectedFile && (h("swirl-button", { "hide-label": true, class: "info-button", icon: "<swirl-icon-info></swirl-icon-info>", label: "Open file info", onClick: this.toggleSidebar }))), h("swirl-box", { padding: "16", slot: "sidebar" }, h("swirl-text", { color: "subdued", weight: "medium" }, "File info goes here \u2026"))), h("swirl-popover", { label: "Sort items", ref: (el) => (this.sortMenu = el) }, h("swirl-option-list", { value: ["ascending"] }, h("swirl-option-list-item", { icon: "<swirl-icon-expand-less></swirl-icon-expand-less>", label: "Ascending", value: "ascending" }), h("swirl-option-list-item", { icon: "<swirl-icon-expand-more></swirl-icon-expand-more>", label: "Descending", value: "descending" }), h("swirl-option-list-item", { icon: "<swirl-icon-time-outlined></swirl-icon-time-outlined>", label: "By date", value: "date" })))));
59
+ return (h(Host, null, h("swirl-app-layout", { appName: "Documents", backToNavigationViewButtonLabel: "Back to documents list", ctaIcon: "<swirl-icon-add></swirl-icon-add>", ctaLabel: "Upload file", navigationLabel: "Documents", onNavigationBackButtonClick: this.resetSelectedDirectory, ref: (el) => (this.layout = el), sidebarCloseButtonLabel: "Close file info", sidebarHeading: "File info", showNavigationBackButton: Boolean(this.selectedDirectory), transitionStyle: "dialog" }, h("swirl-resource-list", { label: "Documents", slot: "navigation" }, this.renderNavigation()), h("swirl-popover-trigger", { popover: this.sortMenu, slot: "navigation-controls" }, h("swirl-button", { label: "Sort items" })), h("swirl-stack", { orientation: "horizontal", slot: "app-bar" }, h("swirl-stack", null, h("swirl-heading", { as: "h2", level: 4, text: this.selectedFile?.name }), h("swirl-text", { color: "subdued", truncate: true }, this.selectedFile?.description))), Boolean(this.selectedFile) ? (h("swirl-file-viewer", { file: this.selectedFile.url, slot: "content", type: this.selectedFile.type })) : (h("swirl-box", { cover: true, centerBlock: true, centerInline: true, padding: "16", slot: "content" }, h("swirl-empty-state", { heading: "Nothing to see here.", illustration: "/images/empty-state-1.svg" }, "Please select a file from the list."))), h("div", { slot: "app-bar-controls" }, this.selectedFile && (h("swirl-button", { "hide-label": true, class: "info-button", icon: "<swirl-icon-info></swirl-icon-info>", label: "Open file info", onClick: this.toggleSidebar }))), h("swirl-box", { padding: "16", slot: "sidebar" }, h("swirl-text", { color: "subdued", weight: "medium" }, "File info goes here \u2026"))), h("swirl-popover", { label: "Sort items", ref: (el) => (this.sortMenu = el) }, h("swirl-option-list", { value: ["ascending"] }, h("swirl-option-list-item", { icon: "<swirl-icon-expand-less></swirl-icon-expand-less>", label: "Ascending", value: "ascending" }), h("swirl-option-list-item", { icon: "<swirl-icon-expand-more></swirl-icon-expand-more>", label: "Descending", value: "descending" }), h("swirl-option-list-item", { icon: "<swirl-icon-time-outlined></swirl-icon-time-outlined>", label: "By date", value: "date" })))));
62
60
  }
63
61
  static get is() { return "file-manager"; }
64
62
  static get encapsulation() { return "shadow"; }