@limetech/lime-elements 40.6.0 → 40.6.2

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 (457) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{adapt-color-contrast-Beo1IEl_.js → adapt-color-contrast-h6iwOfZd.js} +1 -1
  3. package/dist/cjs/{checkbox.template-BPk8WkQF.js → checkbox.template-CoNVC4Nf.js} +2 -2
  4. package/dist/cjs/{component-CFk7Dfoi.js → component-Cz24PdGy.js} +3 -3
  5. package/dist/cjs/{component-BrNWuGdj.js → component-DNiVfYHV.js} +1 -1
  6. package/dist/cjs/{component-y8swlNNR.js → component-GW2n79GH.js} +1 -1
  7. package/dist/cjs/{component-UyqdiWGc.js → component-xiw46M1b.js} +1 -1
  8. package/dist/cjs/{files-DI4jItxi.js → files-DpGigQ8k.js} +1 -1
  9. package/dist/cjs/{format-bytes-CpUKKU86.js → format-bytes-WTHVI718.js} +1 -4
  10. package/dist/cjs/{hotkeys-BtR8uxvl.js → hotkeys-D761KWnZ.js} +1 -0
  11. package/dist/cjs/{image-resize-CG2fitJT.js → image-resize-JlRLB97I.js} +1 -0
  12. package/dist/cjs/{image.template-DY7qwbuy.js → image.template-DlF-f23b.js} +1 -1
  13. package/dist/cjs/{index--B6-r0uo.js → index-BlsqxTB1.js} +1 -7
  14. package/dist/cjs/index.cjs.js +1 -1
  15. package/dist/cjs/{keycodes-k-EdzcMX.js → keycodes-BQ_AERli.js} +4 -0
  16. package/dist/cjs/{language-CaqPKPyW.js → language-v-MMS6ym.js} +1 -1
  17. package/dist/cjs/lime-elements.cjs.js +2 -2
  18. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
  19. package/dist/cjs/limel-action-bar_3.cjs.entry.js +20 -18
  20. package/dist/cjs/limel-ai-avatar.cjs.entry.js +5 -5
  21. package/dist/cjs/limel-badge.cjs.entry.js +3 -3
  22. package/dist/cjs/limel-banner.cjs.entry.js +2 -2
  23. package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +86 -86
  24. package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
  25. package/dist/cjs/limel-button.cjs.entry.js +4 -4
  26. package/dist/cjs/limel-callout.cjs.entry.js +6 -6
  27. package/dist/cjs/limel-card.cjs.entry.js +8 -7
  28. package/dist/cjs/limel-chart.cjs.entry.js +5 -5
  29. package/dist/cjs/limel-checkbox.cjs.entry.js +12 -10
  30. package/dist/cjs/limel-chip-set.cjs.entry.js +35 -44
  31. package/dist/cjs/limel-chip_2.cjs.entry.js +10 -10
  32. package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
  33. package/dist/cjs/limel-code-diff.cjs.entry.js +25 -28
  34. package/dist/cjs/limel-code-editor.cjs.entry.js +17 -12
  35. package/dist/cjs/limel-collapsible-section.cjs.entry.js +8 -8
  36. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
  37. package/dist/cjs/limel-color-picker.cjs.entry.js +6 -5
  38. package/dist/cjs/limel-config.cjs.entry.js +3 -3
  39. package/dist/cjs/limel-date-picker.cjs.entry.js +12 -15
  40. package/dist/cjs/limel-dialog.cjs.entry.js +8 -11
  41. package/dist/cjs/limel-dock-button.cjs.entry.js +6 -11
  42. package/dist/cjs/limel-dock.cjs.entry.js +3 -3
  43. package/dist/cjs/limel-drag-handle.cjs.entry.js +6 -6
  44. package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
  45. package/dist/cjs/limel-email-viewer.cjs.entry.js +11 -17
  46. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +11 -12
  47. package/dist/cjs/limel-file-viewer.cjs.entry.js +1098 -1146
  48. package/dist/cjs/limel-file.cjs.entry.js +17 -16
  49. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +100 -94
  50. package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
  51. package/dist/cjs/limel-form.cjs.entry.js +65 -50
  52. package/dist/cjs/limel-grid.cjs.entry.js +2 -2
  53. package/dist/cjs/limel-header.cjs.entry.js +2 -2
  54. package/dist/cjs/limel-help-content.cjs.entry.js +2 -2
  55. package/dist/cjs/limel-help.cjs.entry.js +3 -3
  56. package/dist/cjs/limel-helper-line_3.cjs.entry.js +14 -16
  57. package/dist/cjs/limel-hotkey_4.cjs.entry.js +23 -23
  58. package/dist/cjs/limel-icon-button.cjs.entry.js +4 -4
  59. package/dist/cjs/limel-icon.cjs.entry.js +15 -13
  60. package/dist/cjs/limel-info-tile.cjs.entry.js +10 -10
  61. package/dist/cjs/limel-list-item.cjs.entry.js +10 -10
  62. package/dist/cjs/limel-markdown.cjs.entry.js +25 -22
  63. package/dist/cjs/limel-masonry-layout.cjs.entry.js +6 -5
  64. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +3 -3
  65. package/dist/cjs/limel-pagination-jump.cjs.entry.js +18 -16
  66. package/dist/cjs/limel-pagination.cjs.entry.js +10 -9
  67. package/dist/cjs/limel-picker.cjs.entry.js +32 -30
  68. package/dist/cjs/limel-popover_2.cjs.entry.js +26 -22
  69. package/dist/cjs/limel-profile-picture.cjs.entry.js +12 -11
  70. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
  71. package/dist/cjs/limel-progress-flow.cjs.entry.js +11 -10
  72. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +475 -407
  73. package/dist/cjs/limel-radio-button-group.cjs.entry.js +2 -2
  74. package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
  75. package/dist/cjs/limel-scroller.cjs.entry.js +180 -0
  76. package/dist/cjs/limel-select.cjs.entry.js +20 -20
  77. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  78. package/dist/cjs/limel-slider.cjs.entry.js +18 -27
  79. package/dist/cjs/limel-snackbar.cjs.entry.js +5 -5
  80. package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
  81. package/dist/cjs/limel-switch.cjs.entry.js +3 -3
  82. package/dist/cjs/limel-tab-bar.cjs.entry.js +235 -2036
  83. package/dist/cjs/limel-tab-panel.cjs.entry.js +12 -9
  84. package/dist/cjs/limel-table.cjs.entry.js +527 -106
  85. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +16 -15
  86. package/dist/cjs/limel-text-editor.cjs.entry.js +3 -3
  87. package/dist/cjs/loader.cjs.js +2 -2
  88. package/dist/cjs/{make-enter-clickable-NuTMC9MU.js → make-enter-clickable-BZHEWIJD.js} +19 -12
  89. package/dist/cjs/{markdown-exporter-9p7d3Q76.js → markdown-exporter-C-UW43FF.js} +1 -1
  90. package/dist/cjs/{markdown-parser-Cgv5Y9Z4.js → markdown-parser-ssDij8_l.js} +24 -22
  91. package/dist/cjs/{moment-CqRdiK10.js → moment-Cfsz2WF1.js} +1062 -833
  92. package/dist/cjs/{ponyfill-BgIFyUG5.js → ponyfill-CHp7Zocr.js} +0 -1
  93. package/dist/cjs/{random-string-BTzDB2ee.js → random-string-CFCtFh5l.js} +1 -0
  94. package/dist/cjs/{render-list-component-5ZKWpCnM.js → render-list-component-BtAliHQp.js} +3 -5
  95. package/dist/cjs/{sv-BSR4W58y.js → sv-Co78RX70.js} +31 -3
  96. package/dist/cjs/{translations-DFFpR6AZ.js → translations-CNTWud2a.js} +5 -8
  97. package/dist/collection/collection-manifest.json +1 -0
  98. package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
  99. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +8 -7
  100. package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
  101. package/dist/collection/components/action-bar/action-bar.js +6 -5
  102. package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
  103. package/dist/collection/components/badge/badge.js +2 -2
  104. package/dist/collection/components/banner/banner.js +1 -1
  105. package/dist/collection/components/breadcrumbs/breadcrumbs.js +2 -2
  106. package/dist/collection/components/button/button.js +2 -2
  107. package/dist/collection/components/button-group/button-group.js +1 -1
  108. package/dist/collection/components/callout/callout.js +1 -1
  109. package/dist/collection/components/card/card.js +6 -5
  110. package/dist/collection/components/checkbox/checkbox.js +9 -7
  111. package/dist/collection/components/checkbox/checkbox.template.js +1 -1
  112. package/dist/collection/components/chip/chip.js +1 -1
  113. package/dist/collection/components/chip-set/chip-set-input-helpers.js +18 -21
  114. package/dist/collection/components/chip-set/chip-set.js +7 -13
  115. package/dist/collection/components/circular-progress/circular-progress.js +1 -1
  116. package/dist/collection/components/code-diff/code-diff.js +19 -22
  117. package/dist/collection/components/code-diff/diff-engine.js +2 -2
  118. package/dist/collection/components/code-editor/code-editor.js +8 -3
  119. package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
  120. package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
  121. package/dist/collection/components/color-picker/color-picker.js +5 -4
  122. package/dist/collection/components/config/config.js +2 -2
  123. package/dist/collection/components/date-picker/date-picker.js +3 -6
  124. package/dist/collection/components/date-picker/flatpickr-adapter/deferred-destroy.js +4 -3
  125. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
  126. package/dist/collection/components/date-picker/pickers/month-picker.js +40 -36
  127. package/dist/collection/components/date-picker/pickers/quarter-picker.js +35 -30
  128. package/dist/collection/components/date-picker/pickers/year-picker.js +16 -20
  129. package/dist/collection/components/dialog/dialog.js +4 -7
  130. package/dist/collection/components/dock/dock-button/dock-button.js +4 -9
  131. package/dist/collection/components/dock/dock.js +2 -2
  132. package/dist/collection/components/drag-handle/drag-handle.js +1 -1
  133. package/dist/collection/components/email-viewer/email-loader.js +14 -10
  134. package/dist/collection/components/email-viewer/email-viewer.js +1 -1
  135. package/dist/collection/components/email-viewer/sanitize-email-html.js +1 -4
  136. package/dist/collection/components/email-viewer/split-email-address-list.js +4 -10
  137. package/dist/collection/components/file/file.js +11 -10
  138. package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
  139. package/dist/collection/components/file-input/file-input.js +7 -8
  140. package/dist/collection/components/file-viewer/file-viewer.js +12 -9
  141. package/dist/collection/components/flex-container/flex-container.js +1 -1
  142. package/dist/collection/components/form/fields/schema-field.js +1 -1
  143. package/dist/collection/components/form/form.js +2 -5
  144. package/dist/collection/components/form/form.test-schemas.js +8 -10
  145. package/dist/collection/components/form/templates/array-field.js +7 -9
  146. package/dist/collection/components/form/templates/common.js +19 -19
  147. package/dist/collection/components/form/templates/object-field.js +1 -1
  148. package/dist/collection/components/form/validation-display.js +2 -2
  149. package/dist/collection/components/form/validators/format.js +1 -0
  150. package/dist/collection/components/form/widgets/code-editor.js +6 -9
  151. package/dist/collection/components/form/widgets/date-picker.js +1 -3
  152. package/dist/collection/components/grid/grid.js +1 -1
  153. package/dist/collection/components/header/header.js +1 -1
  154. package/dist/collection/components/help/help-content.js +1 -1
  155. package/dist/collection/components/help/help.js +2 -2
  156. package/dist/collection/components/helper-line/helper-line.js +3 -3
  157. package/dist/collection/components/hotkey/hotkey.js +1 -1
  158. package/dist/collection/components/icon/icon.js +11 -9
  159. package/dist/collection/components/icon-button/icon-button.js +1 -1
  160. package/dist/collection/components/info-tile/info-tile.js +9 -9
  161. package/dist/collection/components/input-field/input-field.js +11 -11
  162. package/dist/collection/components/list/list-renderer.js +5 -7
  163. package/dist/collection/components/list/list.js +2 -2
  164. package/dist/collection/components/list-item/list-item.js +2 -2
  165. package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
  166. package/dist/collection/components/markdown/hydrate-custom-elements.js +6 -5
  167. package/dist/collection/components/markdown/image-intersection-observer.js +9 -8
  168. package/dist/collection/components/markdown/image-markdown-plugin.js +9 -7
  169. package/dist/collection/components/markdown/link-markdown-plugin.js +11 -10
  170. package/dist/collection/components/markdown/markdown.js +6 -5
  171. package/dist/collection/components/markdown/remove-empty-paragraphs-plugin.js +4 -5
  172. package/dist/collection/components/masonry-layout/masonry-layout.js +5 -4
  173. package/dist/collection/components/menu/menu.js +48 -46
  174. package/dist/collection/components/menu-list/menu-list-renderer.js +8 -8
  175. package/dist/collection/components/menu-list/menu-list.js +1 -1
  176. package/dist/collection/components/menu-surface/menu-surface.js +6 -8
  177. package/dist/collection/components/notched-outline/notched-outline.js +1 -1
  178. package/dist/collection/components/pagination/jump/pagination-jump.js +13 -11
  179. package/dist/collection/components/pagination/pagination.js +5 -4
  180. package/dist/collection/components/picker/picker.js +25 -23
  181. package/dist/collection/components/popover/popover.js +13 -10
  182. package/dist/collection/components/popover-surface/popover-surface.js +1 -1
  183. package/dist/collection/components/portal/contains.js +9 -8
  184. package/dist/collection/components/portal/portal.js +16 -16
  185. package/dist/collection/components/profile-picture/profile-picture.js +4 -3
  186. package/dist/collection/components/progress-flow/progress-flow.js +10 -9
  187. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  188. package/dist/collection/components/radio-button-group/radio-button.js +2 -2
  189. package/dist/collection/components/scroller/scroller.css +317 -0
  190. package/dist/collection/components/scroller/scroller.js +284 -0
  191. package/dist/collection/components/select/select.js +13 -11
  192. package/dist/collection/components/select/select.template.js +1 -3
  193. package/dist/collection/components/slider/get-percentage-class.js +9 -18
  194. package/dist/collection/components/slider/slider.js +2 -2
  195. package/dist/collection/components/tab-bar/tab-bar.css +7 -289
  196. package/dist/collection/components/tab-bar/tab-bar.js +98 -128
  197. package/dist/collection/components/tab-panel/tab-panel.js +11 -8
  198. package/dist/collection/components/table/columns.js +1 -3
  199. package/dist/collection/components/table/element-pool.js +1 -1
  200. package/dist/collection/components/table/table-selection.js +6 -5
  201. package/dist/collection/components/table/table.css +15 -17
  202. package/dist/collection/components/table/table.js +44 -39
  203. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +11 -10
  204. package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/list-utils.js +1 -1
  205. package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js +6 -10
  206. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +37 -40
  207. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +2 -1
  208. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link/link-plugin.js +21 -20
  209. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/menu-state-tracking-plugin.js +6 -5
  210. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/trigger/factory-helpers/detect-trigger-removal.js +15 -14
  211. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +40 -34
  212. package/dist/collection/components/text-editor/text-editor.js +1 -1
  213. package/dist/collection/components/text-editor/utils/metadata-utils.js +1 -1
  214. package/dist/collection/components/text-editor/utils/plugin-factory.js +3 -3
  215. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  216. package/dist/collection/components/tooltip/tooltip.js +2 -2
  217. package/dist/collection/global/icon-cache/factory.js +2 -3
  218. package/dist/collection/global/icon-cache/in-memory-icon-cache.js +2 -0
  219. package/dist/collection/global/translations.js +1 -3
  220. package/dist/collection/translations/fr.js +3 -3
  221. package/dist/collection/util/adapt-color-contrast.js +1 -1
  222. package/dist/collection/util/files.js +1 -1
  223. package/dist/collection/util/format-bytes.js +1 -4
  224. package/dist/collection/util/hotkeys.js +1 -0
  225. package/dist/collection/util/image-resize.js +1 -0
  226. package/dist/collection/util/keyboard-navigation.js +144 -0
  227. package/dist/collection/util/keycodes.js +2 -0
  228. package/dist/collection/util/language.js +1 -1
  229. package/dist/collection/util/make-enter-clickable.js +19 -12
  230. package/dist/collection/util/random-string.js +1 -0
  231. package/dist/collection/util/render-list-component.js +2 -4
  232. package/dist/esm/{adapt-color-contrast-Dgcw_h7C.js → adapt-color-contrast-BQoih_t0.js} +1 -1
  233. package/dist/esm/{checkbox.template-Cx_3u92S.js → checkbox.template-IDyv2bgn.js} +2 -2
  234. package/dist/esm/{component-wGVqvUmL.js → component-CVihTrav.js} +3 -3
  235. package/dist/esm/{component-7QB0OUSF.js → component-CrjPGt1I.js} +1 -1
  236. package/dist/esm/{component-D4qgwaTf.js → component-CyFeUQ0l.js} +1 -1
  237. package/dist/esm/{component-B2Vy44Z3.js → component-kP1jCDLp.js} +1 -1
  238. package/dist/esm/{files-DnkFEKoB.js → files-CKnLqPDj.js} +1 -1
  239. package/dist/esm/{format-bytes-u_sd2HMb.js → format-bytes-24yUSW40.js} +1 -4
  240. package/dist/esm/{hotkeys-BxrRWYts.js → hotkeys-DjmlD0Mw.js} +1 -0
  241. package/dist/esm/{image-resize-BTSG--2-.js → image-resize-Dv2HOgWN.js} +1 -0
  242. package/dist/esm/{image.template-wqMwmOF-.js → image.template-BGjw97m_.js} +1 -1
  243. package/dist/esm/{index-Bnc9lzk2.js → index-BU9IJqli.js} +1 -7
  244. package/dist/esm/index.js +1 -1
  245. package/dist/esm/{keycodes-C4_9qUMP.js → keycodes-DQ5DmW_Y.js} +3 -1
  246. package/dist/esm/{language-C3hECvXE.js → language-ChagAaNf.js} +1 -1
  247. package/dist/esm/lime-elements.js +3 -3
  248. package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
  249. package/dist/esm/limel-action-bar_3.entry.js +20 -18
  250. package/dist/esm/limel-ai-avatar.entry.js +5 -5
  251. package/dist/esm/limel-badge.entry.js +3 -3
  252. package/dist/esm/limel-banner.entry.js +2 -2
  253. package/dist/esm/limel-breadcrumbs_6.entry.js +86 -86
  254. package/dist/esm/limel-button-group.entry.js +3 -3
  255. package/dist/esm/limel-button.entry.js +4 -4
  256. package/dist/esm/limel-callout.entry.js +6 -6
  257. package/dist/esm/limel-card.entry.js +8 -7
  258. package/dist/esm/limel-chart.entry.js +5 -5
  259. package/dist/esm/limel-checkbox.entry.js +12 -10
  260. package/dist/esm/limel-chip-set.entry.js +35 -44
  261. package/dist/esm/limel-chip_2.entry.js +10 -10
  262. package/dist/esm/limel-circular-progress.entry.js +2 -2
  263. package/dist/esm/limel-code-diff.entry.js +25 -28
  264. package/dist/esm/limel-code-editor.entry.js +17 -12
  265. package/dist/esm/limel-collapsible-section.entry.js +8 -8
  266. package/dist/esm/limel-color-picker-palette.entry.js +3 -3
  267. package/dist/esm/limel-color-picker.entry.js +6 -5
  268. package/dist/esm/limel-config.entry.js +3 -3
  269. package/dist/esm/limel-date-picker.entry.js +12 -15
  270. package/dist/esm/limel-dialog.entry.js +8 -11
  271. package/dist/esm/limel-dock-button.entry.js +6 -11
  272. package/dist/esm/limel-dock.entry.js +3 -3
  273. package/dist/esm/limel-drag-handle.entry.js +6 -6
  274. package/dist/esm/limel-dynamic-label.entry.js +1 -1
  275. package/dist/esm/limel-email-viewer.entry.js +11 -17
  276. package/dist/esm/limel-file-dropzone_2.entry.js +11 -12
  277. package/dist/esm/limel-file-viewer.entry.js +1098 -1146
  278. package/dist/esm/limel-file.entry.js +17 -16
  279. package/dist/esm/limel-flatpickr-adapter.entry.js +100 -94
  280. package/dist/esm/limel-flex-container.entry.js +2 -2
  281. package/dist/esm/limel-form.entry.js +65 -50
  282. package/dist/esm/limel-grid.entry.js +2 -2
  283. package/dist/esm/limel-header.entry.js +2 -2
  284. package/dist/esm/limel-help-content.entry.js +2 -2
  285. package/dist/esm/limel-help.entry.js +3 -3
  286. package/dist/esm/limel-helper-line_3.entry.js +14 -16
  287. package/dist/esm/limel-hotkey_4.entry.js +23 -23
  288. package/dist/esm/limel-icon-button.entry.js +4 -4
  289. package/dist/esm/limel-icon.entry.js +15 -13
  290. package/dist/esm/limel-info-tile.entry.js +10 -10
  291. package/dist/esm/limel-list-item.entry.js +10 -10
  292. package/dist/esm/limel-markdown.entry.js +25 -22
  293. package/dist/esm/limel-masonry-layout.entry.js +6 -5
  294. package/dist/esm/limel-menu-item-meta.entry.js +3 -3
  295. package/dist/esm/limel-pagination-jump.entry.js +18 -16
  296. package/dist/esm/limel-pagination.entry.js +10 -9
  297. package/dist/esm/limel-picker.entry.js +32 -30
  298. package/dist/esm/limel-popover_2.entry.js +26 -22
  299. package/dist/esm/limel-profile-picture.entry.js +12 -11
  300. package/dist/esm/limel-progress-flow-item.entry.js +1 -1
  301. package/dist/esm/limel-progress-flow.entry.js +11 -10
  302. package/dist/esm/limel-prosemirror-adapter.entry.js +475 -407
  303. package/dist/esm/limel-radio-button-group.entry.js +2 -2
  304. package/dist/esm/limel-radio-button.entry.js +3 -3
  305. package/dist/esm/limel-scroller.entry.js +178 -0
  306. package/dist/esm/limel-select.entry.js +20 -20
  307. package/dist/esm/limel-shortcut.entry.js +1 -1
  308. package/dist/esm/limel-slider.entry.js +18 -27
  309. package/dist/esm/limel-snackbar.entry.js +5 -5
  310. package/dist/esm/limel-split-button.entry.js +1 -1
  311. package/dist/esm/limel-switch.entry.js +3 -3
  312. package/dist/esm/limel-tab-bar.entry.js +235 -2036
  313. package/dist/esm/limel-tab-panel.entry.js +12 -9
  314. package/dist/esm/limel-table.entry.js +527 -106
  315. package/dist/esm/limel-text-editor-link-menu.entry.js +16 -15
  316. package/dist/esm/limel-text-editor.entry.js +3 -3
  317. package/dist/esm/loader.js +3 -3
  318. package/dist/esm/{make-enter-clickable-BgTwPGeH.js → make-enter-clickable-CIf8aGSd.js} +19 -12
  319. package/dist/esm/{markdown-exporter--3_MaqwD.js → markdown-exporter-DblYRMhY.js} +1 -1
  320. package/dist/esm/{markdown-parser-DCf-3dKZ.js → markdown-parser-CAPDx7i8.js} +24 -22
  321. package/dist/esm/{moment-DQRNe8qq.js → moment-_DadZLWp.js} +1062 -833
  322. package/dist/esm/{ponyfill-ChRGk668.js → ponyfill-6YuZiAPi.js} +1 -1
  323. package/dist/esm/{random-string-JbKhhoXs.js → random-string-BrjD-ITe.js} +1 -0
  324. package/dist/esm/{render-list-component-cicbMp0l.js → render-list-component-J1IzNpbv.js} +3 -5
  325. package/dist/esm/{sv-CY-6-yEp.js → sv-DpsDSi7k.js} +31 -3
  326. package/dist/esm/{translations-DMtX4tTX.js → translations-Y4i8PVc9.js} +5 -8
  327. package/dist/lime-elements/index.esm.js +1 -1
  328. package/dist/lime-elements/lime-elements.esm.js +1 -1
  329. package/dist/lime-elements/p-02a06cf7.entry.js +1 -0
  330. package/dist/lime-elements/{p-3916b316.entry.js → p-03cb609e.entry.js} +1 -1
  331. package/dist/lime-elements/p-05038bbb.entry.js +1 -0
  332. package/dist/lime-elements/{p-835149c4.entry.js → p-0d6925f4.entry.js} +1 -1
  333. package/dist/lime-elements/p-0e13ec91.entry.js +1 -0
  334. package/dist/lime-elements/p-0ece667e.entry.js +1 -0
  335. package/dist/lime-elements/{p-19344984.entry.js → p-107654bb.entry.js} +4 -4
  336. package/dist/lime-elements/p-120ca628.entry.js +1 -0
  337. package/dist/lime-elements/{p-BwJGg-WI.js → p-1CgnIGyd.js} +4 -4
  338. package/dist/lime-elements/p-22fd1c87.entry.js +1 -0
  339. package/dist/lime-elements/p-24yUSW40.js +1 -0
  340. package/dist/lime-elements/{p-f717cd7a.entry.js → p-271662d4.entry.js} +1 -1
  341. package/dist/lime-elements/{p-c2a60508.entry.js → p-29c73bdf.entry.js} +1 -1
  342. package/dist/lime-elements/{p-deceda00.entry.js → p-2a902e77.entry.js} +1 -1
  343. package/dist/lime-elements/{p-d0cec424.entry.js → p-2b033dfa.entry.js} +1 -1
  344. package/dist/lime-elements/{p-acba5700.entry.js → p-2b2253d4.entry.js} +1 -1
  345. package/dist/lime-elements/p-2e33d2a4.entry.js +1 -0
  346. package/dist/lime-elements/p-32a050a3.entry.js +1 -0
  347. package/dist/lime-elements/{p-3735111e.entry.js → p-3cfe0eaf.entry.js} +1 -1
  348. package/dist/lime-elements/{p-fbcd99a3.entry.js → p-3d3bdf45.entry.js} +1 -1
  349. package/dist/lime-elements/p-45461ec5.entry.js +1 -0
  350. package/dist/lime-elements/p-45c39fb4.entry.js +1 -0
  351. package/dist/lime-elements/p-45fde7a1.entry.js +1 -0
  352. package/dist/lime-elements/p-48afa6b7.entry.js +1 -0
  353. package/dist/lime-elements/{p-f04f7c8e.entry.js → p-4a88d365.entry.js} +1 -1
  354. package/dist/lime-elements/p-4b75e653.entry.js +1 -0
  355. package/dist/lime-elements/{p-5698e493.entry.js → p-4ecbc9f4.entry.js} +1 -1
  356. package/dist/lime-elements/{p-2e568c56.entry.js → p-54a9f48f.entry.js} +1 -1
  357. package/dist/lime-elements/{p-0fba64eb.entry.js → p-5df21b25.entry.js} +2 -2
  358. package/dist/lime-elements/p-5e448070.entry.js +1 -0
  359. package/dist/lime-elements/{p-408c4dcb.entry.js → p-5f5c6e7d.entry.js} +1 -1
  360. package/dist/lime-elements/{p-052c3bc6.entry.js → p-681cb6de.entry.js} +1 -1
  361. package/dist/lime-elements/{p-ChRGk668.js → p-6YuZiAPi.js} +3 -3
  362. package/dist/lime-elements/{p-90df3e1b.entry.js → p-6d9961f7.entry.js} +1 -1
  363. package/dist/lime-elements/p-74060535.entry.js +159 -0
  364. package/dist/lime-elements/{p-74bd0c1a.entry.js → p-7b4351f6.entry.js} +1 -1
  365. package/dist/lime-elements/{p-3fd7e8aa.entry.js → p-7eab1341.entry.js} +1 -1
  366. package/dist/lime-elements/p-7fa85785.entry.js +23 -0
  367. package/dist/lime-elements/{p-35fa1063.entry.js → p-85318636.entry.js} +1 -1
  368. package/dist/lime-elements/{p-4ffbfc79.entry.js → p-8ac79ef5.entry.js} +1 -1
  369. package/dist/lime-elements/{p-4902fb3f.entry.js → p-9218fa6a.entry.js} +1 -1
  370. package/dist/lime-elements/{p-38b09f87.entry.js → p-9415411e.entry.js} +1 -1
  371. package/dist/lime-elements/{p-be8610ff.entry.js → p-958396b5.entry.js} +1 -1
  372. package/dist/lime-elements/p-95ccd9e7.entry.js +1 -0
  373. package/dist/lime-elements/p-970e0810.entry.js +1 -0
  374. package/dist/lime-elements/{p-cb407bef.entry.js → p-9afa4721.entry.js} +1 -1
  375. package/dist/lime-elements/{p-54dcf46f.entry.js → p-9c8c2fb7.entry.js} +1 -1
  376. package/dist/lime-elements/p-9e084e7c.entry.js +1 -0
  377. package/dist/lime-elements/{p-B8hoCfhT.js → p-B3YP9GOq.js} +1 -1
  378. package/dist/lime-elements/{p-Dgcw_h7C.js → p-BQoih_t0.js} +1 -1
  379. package/dist/lime-elements/{p-Bnc9lzk2.js → p-BU9IJqli.js} +1 -1
  380. package/dist/lime-elements/{p-BN1-aIOw.js → p-BZXGwiAr.js} +1 -1
  381. package/dist/lime-elements/{p-CGVVDGcv.js → p-Bkvc4sus.js} +1 -1
  382. package/dist/lime-elements/{p-BPzhuHcl.js → p-Bvyt2bmV.js} +1 -1
  383. package/dist/lime-elements/{p-DZkKQUDM.js → p-C1FFnUvf.js} +3 -3
  384. package/dist/lime-elements/{p-BgTwPGeH.js → p-CIf8aGSd.js} +1 -1
  385. package/dist/lime-elements/{p-C3hECvXE.js → p-ChagAaNf.js} +1 -1
  386. package/dist/lime-elements/{p-C9yTLqR8.js → p-CmtleG1y.js} +1 -1
  387. package/dist/lime-elements/{p-C4_9qUMP.js → p-DQ5DmW_Y.js} +1 -1
  388. package/dist/lime-elements/p-DTcfed02.js +3 -0
  389. package/dist/lime-elements/{p-BY85K-4J.js → p-DqQOawxc.js} +1 -1
  390. package/dist/lime-elements/{p-CC4Usa-Q.js → p-I0PrvthC.js} +1 -1
  391. package/dist/lime-elements/p-N9vxZMhe.js +1 -0
  392. package/dist/lime-elements/{p-DsDkl4Sy.js → p-ZDFVISfu.js} +3 -3
  393. package/dist/lime-elements/p-a1c69e0c.entry.js +1 -0
  394. package/dist/lime-elements/{p-2daf0482.entry.js → p-a1d1470c.entry.js} +1 -1
  395. package/dist/lime-elements/{p-cef66e53.entry.js → p-a2e6f16e.entry.js} +1 -1
  396. package/dist/lime-elements/{p-36ce4fbc.entry.js → p-a42f8c2d.entry.js} +1 -1
  397. package/dist/lime-elements/p-a550ba18.entry.js +1 -0
  398. package/dist/lime-elements/{p-d146feda.entry.js → p-a65eb58e.entry.js} +1 -1
  399. package/dist/lime-elements/{p-03fb2603.entry.js → p-b22b52a1.entry.js} +1 -1
  400. package/dist/lime-elements/{p-c2a3ca7c.entry.js → p-b6d39581.entry.js} +1 -1
  401. package/dist/lime-elements/{p-8475a3b8.entry.js → p-c439b68b.entry.js} +1 -1
  402. package/dist/lime-elements/p-d19c7a3a.entry.js +1 -0
  403. package/dist/lime-elements/{p-d3bd4b80.entry.js → p-d1b7cc55.entry.js} +3 -3
  404. package/dist/lime-elements/{p-7cbf50fc.entry.js → p-d1e5dd12.entry.js} +1 -1
  405. package/dist/lime-elements/p-de4719a6.entry.js +1 -0
  406. package/dist/lime-elements/{p-b81a2728.entry.js → p-e02e2c5f.entry.js} +1 -1
  407. package/dist/lime-elements/{p-d351b9ae.entry.js → p-e6a34047.entry.js} +1 -1
  408. package/dist/lime-elements/p-eF09GxA_.js +1 -0
  409. package/dist/lime-elements/{p-8fa9c9ea.entry.js → p-ee719744.entry.js} +1 -1
  410. package/dist/lime-elements/p-f3cae1e7.entry.js +1 -0
  411. package/dist/lime-elements/{p-8115da75.entry.js → p-f4a0b1bc.entry.js} +1 -1
  412. package/dist/lime-elements/{p-4855dc9b.entry.js → p-f82f72e7.entry.js} +1 -1
  413. package/dist/lime-elements/{p-2d84ea04.entry.js → p-f97ec7a5.entry.js} +1 -1
  414. package/dist/lime-elements/{p-21109d9b.entry.js → p-fdd674fc.entry.js} +1 -1
  415. package/dist/lime-elements/{p-459eea13.entry.js → p-fdec09e9.entry.js} +1 -1
  416. package/dist/lime-elements/{p-2f57c3fa.entry.js → p-fe492ff3.entry.js} +1 -1
  417. package/dist/lime-elements/{p-65cded0e.entry.js → p-ff1a8b2e.entry.js} +1 -1
  418. package/dist/types/components/chip-set/chip-set-input-helpers.d.ts +1 -1
  419. package/dist/types/components/pagination/jump/pagination-jump.d.ts +1 -1
  420. package/dist/types/components/scroller/scroller.d.ts +67 -0
  421. package/dist/types/components/tab-bar/tab-bar.d.ts +23 -21
  422. package/dist/types/components.d.ts +132 -0
  423. package/dist/types/global/icon-cache/factory.d.ts +2 -2
  424. package/dist/types/global/translations.d.ts +2 -2
  425. package/dist/types/util/keyboard-navigation.d.ts +105 -0
  426. package/dist/types/util/keycodes.d.ts +2 -0
  427. package/package.json +12 -12
  428. package/dist/lime-elements/p-1e93473a.entry.js +0 -1
  429. package/dist/lime-elements/p-20658306.entry.js +0 -1
  430. package/dist/lime-elements/p-26c5c6b9.entry.js +0 -1
  431. package/dist/lime-elements/p-452b9b01.entry.js +0 -1
  432. package/dist/lime-elements/p-4aae63bd.entry.js +0 -1
  433. package/dist/lime-elements/p-507cc8a1.entry.js +0 -159
  434. package/dist/lime-elements/p-531b6a64.entry.js +0 -1
  435. package/dist/lime-elements/p-54793c06.entry.js +0 -1
  436. package/dist/lime-elements/p-5d974afa.entry.js +0 -1
  437. package/dist/lime-elements/p-66b125f2.entry.js +0 -1
  438. package/dist/lime-elements/p-7e212fa7.entry.js +0 -1
  439. package/dist/lime-elements/p-82696d24.entry.js +0 -1
  440. package/dist/lime-elements/p-9ac39039.entry.js +0 -1
  441. package/dist/lime-elements/p-9b631363.entry.js +0 -1
  442. package/dist/lime-elements/p-DQJU9gzh.js +0 -1
  443. package/dist/lime-elements/p-DpJgXIWf.js +0 -1
  444. package/dist/lime-elements/p-a1de9bbe.entry.js +0 -1
  445. package/dist/lime-elements/p-a71f6e87.entry.js +0 -67
  446. package/dist/lime-elements/p-bd7b3f8e.entry.js +0 -1
  447. package/dist/lime-elements/p-c72e5007.entry.js +0 -1
  448. package/dist/lime-elements/p-cafec335.entry.js +0 -1
  449. package/dist/lime-elements/p-d6dadc61.entry.js +0 -1
  450. package/dist/lime-elements/p-d93b7b9f.entry.js +0 -23
  451. package/dist/lime-elements/p-dc9cd793.entry.js +0 -1
  452. package/dist/lime-elements/p-dd62042a.entry.js +0 -1
  453. package/dist/lime-elements/p-u_sd2HMb.js +0 -1
  454. package/dist/lime-elements/p-zo6O9LC9.js +0 -3
  455. /package/dist/lime-elements/{p-JbKhhoXs.js → p-BrjD-ITe.js} +0 -0
  456. /package/dist/lime-elements/{p-BxrRWYts.js → p-DjmlD0Mw.js} +0 -0
  457. /package/dist/lime-elements/{p-BTSG--2-.js → p-Dv2HOgWN.js} +0 -0
@@ -1,10 +1,11 @@
1
- import { r as registerInstance, c as createEvent, h, a as getElement } from './index-Bnc9lzk2.js';
1
+ import { r as registerInstance, c as createEvent, h, a as getElement } from './index-BU9IJqli.js';
2
2
  import { g as getIconName, b as getIconColor } from './get-icon-props-CgNJbSP4.js';
3
+ import { A as ARROW_UP, b as ARROW_DOWN, H as HOME, c as END, d as ARROW_LEFT, e as ARROW_RIGHT } from './keycodes-DQ5DmW_Y.js';
3
4
  import { i as isEqual } from './isEqual-CE83yS8T.js';
4
- import { _ as __extends, a as __assign, f as __read, M as MDCFoundation, c as MDCComponent, m as matches, b as __values } from './ponyfill-ChRGk668.js';
5
- import { a as applyPassive, b as MDCRippleFoundation, M as MDCRipple } from './component-7QB0OUSF.js';
5
+ import { M as MDCRipple } from './component-CrjPGt1I.js';
6
6
  import { S as SetCache, c as cacheHas } from './_baseIsEqual-CyF4P8uM.js';
7
7
  import { a as arrayIncludes, b as baseRest, i as isArrayLikeObject, c as baseFlatten } from './isArrayLikeObject-CJB8HbtH.js';
8
+ import './ponyfill-6YuZiAPi.js';
8
9
  import './eq-CZ30nDJE.js';
9
10
  import './_getTag-BiAaLWvH.js';
10
11
  import './isObject-BJQylLSL.js';
@@ -97,1959 +98,173 @@ var difference = baseRest(function(array, values) {
97
98
  });
98
99
 
99
100
  /**
100
- * @license
101
- * Copyright 2018 Google Inc.
102
- *
103
- * Permission is hereby granted, free of charge, to any person obtaining a copy
104
- * of this software and associated documentation files (the "Software"), to deal
105
- * in the Software without restriction, including without limitation the rights
106
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
107
- * copies of the Software, and to permit persons to whom the Software is
108
- * furnished to do so, subject to the following conditions:
109
- *
110
- * The above copyright notice and this permission notice shall be included in
111
- * all copies or substantial portions of the Software.
112
- *
113
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
114
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
115
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
116
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
117
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
118
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
119
- * THE SOFTWARE.
120
- */
121
- var cssClasses$2 = {
122
- ANIMATING: 'mdc-tab-scroller--animating',
123
- SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll',
124
- SCROLL_TEST: 'mdc-tab-scroller__test',
125
- };
126
- var strings$4 = {
127
- AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
128
- CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content',
129
- };
130
-
131
- /**
132
- * @license
133
- * Copyright 2018 Google Inc.
134
- *
135
- * Permission is hereby granted, free of charge, to any person obtaining a copy
136
- * of this software and associated documentation files (the "Software"), to deal
137
- * in the Software without restriction, including without limitation the rights
138
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
139
- * copies of the Software, and to permit persons to whom the Software is
140
- * furnished to do so, subject to the following conditions:
141
- *
142
- * The above copyright notice and this permission notice shall be included in
143
- * all copies or substantial portions of the Software.
144
- *
145
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
146
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
147
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
148
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
149
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
150
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
151
- * THE SOFTWARE.
152
- */
153
- var MDCTabScrollerRTL = /** @class */ (function () {
154
- function MDCTabScrollerRTL(adapter) {
155
- this.adapter = adapter;
156
- }
157
- return MDCTabScrollerRTL;
158
- }());
159
-
160
- /**
161
- * @license
162
- * Copyright 2018 Google Inc.
163
- *
164
- * Permission is hereby granted, free of charge, to any person obtaining a copy
165
- * of this software and associated documentation files (the "Software"), to deal
166
- * in the Software without restriction, including without limitation the rights
167
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
168
- * copies of the Software, and to permit persons to whom the Software is
169
- * furnished to do so, subject to the following conditions:
170
- *
171
- * The above copyright notice and this permission notice shall be included in
172
- * all copies or substantial portions of the Software.
173
- *
174
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
176
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
177
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
179
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
180
- * THE SOFTWARE.
181
- */
182
- var MDCTabScrollerRTLDefault = /** @class */ (function (_super) {
183
- __extends(MDCTabScrollerRTLDefault, _super);
184
- function MDCTabScrollerRTLDefault() {
185
- return _super !== null && _super.apply(this, arguments) || this;
186
- }
187
- MDCTabScrollerRTLDefault.prototype.getScrollPositionRTL = function () {
188
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
189
- var right = this.calculateScrollEdges().right;
190
- // Scroll values on most browsers are ints instead of floats so we round
191
- return Math.round(right - currentScrollLeft);
192
- };
193
- MDCTabScrollerRTLDefault.prototype.scrollToRTL = function (scrollX) {
194
- var edges = this.calculateScrollEdges();
195
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
196
- var clampedScrollLeft = this.clampScrollValue(edges.right - scrollX);
197
- return {
198
- finalScrollPosition: clampedScrollLeft,
199
- scrollDelta: clampedScrollLeft - currentScrollLeft,
200
- };
201
- };
202
- MDCTabScrollerRTLDefault.prototype.incrementScrollRTL = function (scrollX) {
203
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
204
- var clampedScrollLeft = this.clampScrollValue(currentScrollLeft - scrollX);
205
- return {
206
- finalScrollPosition: clampedScrollLeft,
207
- scrollDelta: clampedScrollLeft - currentScrollLeft,
208
- };
209
- };
210
- MDCTabScrollerRTLDefault.prototype.getAnimatingScrollPosition = function (scrollX) {
211
- return scrollX;
212
- };
213
- MDCTabScrollerRTLDefault.prototype.calculateScrollEdges = function () {
214
- var contentWidth = this.adapter.getScrollContentOffsetWidth();
215
- var rootWidth = this.adapter.getScrollAreaOffsetWidth();
216
- return {
217
- left: 0,
218
- right: contentWidth - rootWidth,
219
- };
220
- };
221
- MDCTabScrollerRTLDefault.prototype.clampScrollValue = function (scrollX) {
222
- var edges = this.calculateScrollEdges();
223
- return Math.min(Math.max(edges.left, scrollX), edges.right);
224
- };
225
- return MDCTabScrollerRTLDefault;
226
- }(MDCTabScrollerRTL));
227
-
228
- /**
229
- * @license
230
- * Copyright 2018 Google Inc.
231
- *
232
- * Permission is hereby granted, free of charge, to any person obtaining a copy
233
- * of this software and associated documentation files (the "Software"), to deal
234
- * in the Software without restriction, including without limitation the rights
235
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
236
- * copies of the Software, and to permit persons to whom the Software is
237
- * furnished to do so, subject to the following conditions:
238
- *
239
- * The above copyright notice and this permission notice shall be included in
240
- * all copies or substantial portions of the Software.
241
- *
242
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
243
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
244
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
245
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
246
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
247
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
248
- * THE SOFTWARE.
249
- */
250
- var MDCTabScrollerRTLNegative = /** @class */ (function (_super) {
251
- __extends(MDCTabScrollerRTLNegative, _super);
252
- function MDCTabScrollerRTLNegative() {
253
- return _super !== null && _super.apply(this, arguments) || this;
254
- }
255
- MDCTabScrollerRTLNegative.prototype.getScrollPositionRTL = function (translateX) {
256
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
257
- return Math.round(translateX - currentScrollLeft);
258
- };
259
- MDCTabScrollerRTLNegative.prototype.scrollToRTL = function (scrollX) {
260
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
261
- var clampedScrollLeft = this.clampScrollValue(-scrollX);
262
- return {
263
- finalScrollPosition: clampedScrollLeft,
264
- scrollDelta: clampedScrollLeft - currentScrollLeft,
265
- };
266
- };
267
- MDCTabScrollerRTLNegative.prototype.incrementScrollRTL = function (scrollX) {
268
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
269
- var clampedScrollLeft = this.clampScrollValue(currentScrollLeft - scrollX);
270
- return {
271
- finalScrollPosition: clampedScrollLeft,
272
- scrollDelta: clampedScrollLeft - currentScrollLeft,
273
- };
274
- };
275
- MDCTabScrollerRTLNegative.prototype.getAnimatingScrollPosition = function (scrollX, translateX) {
276
- return scrollX - translateX;
277
- };
278
- MDCTabScrollerRTLNegative.prototype.calculateScrollEdges = function () {
279
- var contentWidth = this.adapter.getScrollContentOffsetWidth();
280
- var rootWidth = this.adapter.getScrollAreaOffsetWidth();
281
- return {
282
- left: rootWidth - contentWidth,
283
- right: 0,
284
- };
285
- };
286
- MDCTabScrollerRTLNegative.prototype.clampScrollValue = function (scrollX) {
287
- var edges = this.calculateScrollEdges();
288
- return Math.max(Math.min(edges.right, scrollX), edges.left);
289
- };
290
- return MDCTabScrollerRTLNegative;
291
- }(MDCTabScrollerRTL));
292
-
293
- /**
294
- * @license
295
- * Copyright 2018 Google Inc.
296
- *
297
- * Permission is hereby granted, free of charge, to any person obtaining a copy
298
- * of this software and associated documentation files (the "Software"), to deal
299
- * in the Software without restriction, including without limitation the rights
300
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
301
- * copies of the Software, and to permit persons to whom the Software is
302
- * furnished to do so, subject to the following conditions:
303
- *
304
- * The above copyright notice and this permission notice shall be included in
305
- * all copies or substantial portions of the Software.
306
- *
307
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
308
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
309
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
310
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
311
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
312
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
313
- * THE SOFTWARE.
314
- */
315
- var MDCTabScrollerRTLReverse = /** @class */ (function (_super) {
316
- __extends(MDCTabScrollerRTLReverse, _super);
317
- function MDCTabScrollerRTLReverse() {
318
- return _super !== null && _super.apply(this, arguments) || this;
319
- }
320
- MDCTabScrollerRTLReverse.prototype.getScrollPositionRTL = function (translateX) {
321
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
322
- // Scroll values on most browsers are ints instead of floats so we round
323
- return Math.round(currentScrollLeft - translateX);
324
- };
325
- MDCTabScrollerRTLReverse.prototype.scrollToRTL = function (scrollX) {
326
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
327
- var clampedScrollLeft = this.clampScrollValue(scrollX);
328
- return {
329
- finalScrollPosition: clampedScrollLeft,
330
- scrollDelta: currentScrollLeft - clampedScrollLeft,
331
- };
332
- };
333
- MDCTabScrollerRTLReverse.prototype.incrementScrollRTL = function (scrollX) {
334
- var currentScrollLeft = this.adapter.getScrollAreaScrollLeft();
335
- var clampedScrollLeft = this.clampScrollValue(currentScrollLeft + scrollX);
336
- return {
337
- finalScrollPosition: clampedScrollLeft,
338
- scrollDelta: currentScrollLeft - clampedScrollLeft,
339
- };
340
- };
341
- MDCTabScrollerRTLReverse.prototype.getAnimatingScrollPosition = function (scrollX, translateX) {
342
- return scrollX + translateX;
343
- };
344
- MDCTabScrollerRTLReverse.prototype.calculateScrollEdges = function () {
345
- var contentWidth = this.adapter.getScrollContentOffsetWidth();
346
- var rootWidth = this.adapter.getScrollAreaOffsetWidth();
347
- return {
348
- left: contentWidth - rootWidth,
349
- right: 0,
350
- };
351
- };
352
- MDCTabScrollerRTLReverse.prototype.clampScrollValue = function (scrollX) {
353
- var edges = this.calculateScrollEdges();
354
- return Math.min(Math.max(edges.right, scrollX), edges.left);
355
- };
356
- return MDCTabScrollerRTLReverse;
357
- }(MDCTabScrollerRTL));
358
-
359
- /**
360
- * @license
361
- * Copyright 2018 Google Inc.
362
- *
363
- * Permission is hereby granted, free of charge, to any person obtaining a copy
364
- * of this software and associated documentation files (the "Software"), to deal
365
- * in the Software without restriction, including without limitation the rights
366
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
367
- * copies of the Software, and to permit persons to whom the Software is
368
- * furnished to do so, subject to the following conditions:
369
- *
370
- * The above copyright notice and this permission notice shall be included in
371
- * all copies or substantial portions of the Software.
372
- *
373
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
374
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
375
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
376
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
377
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
378
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
379
- * THE SOFTWARE.
380
- */
381
- var MDCTabScrollerFoundation = /** @class */ (function (_super) {
382
- __extends(MDCTabScrollerFoundation, _super);
383
- function MDCTabScrollerFoundation(adapter) {
384
- var _this = _super.call(this, __assign(__assign({}, MDCTabScrollerFoundation.defaultAdapter), adapter)) || this;
385
- /**
386
- * Controls whether we should handle the transitionend and interaction events during the animation.
387
- */
388
- _this.isAnimating = false;
389
- return _this;
390
- }
391
- Object.defineProperty(MDCTabScrollerFoundation, "cssClasses", {
392
- get: function () {
393
- return cssClasses$2;
394
- },
395
- enumerable: false,
396
- configurable: true
397
- });
398
- Object.defineProperty(MDCTabScrollerFoundation, "strings", {
399
- get: function () {
400
- return strings$4;
401
- },
402
- enumerable: false,
403
- configurable: true
404
- });
405
- Object.defineProperty(MDCTabScrollerFoundation, "defaultAdapter", {
406
- get: function () {
407
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
408
- return {
409
- eventTargetMatchesSelector: function () { return false; },
410
- addClass: function () { return undefined; },
411
- removeClass: function () { return undefined; },
412
- addScrollAreaClass: function () { return undefined; },
413
- setScrollAreaStyleProperty: function () { return undefined; },
414
- setScrollContentStyleProperty: function () { return undefined; },
415
- getScrollContentStyleValue: function () { return ''; },
416
- setScrollAreaScrollLeft: function () { return undefined; },
417
- getScrollAreaScrollLeft: function () { return 0; },
418
- getScrollContentOffsetWidth: function () { return 0; },
419
- getScrollAreaOffsetWidth: function () { return 0; },
420
- computeScrollAreaClientRect: function () {
421
- return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });
422
- },
423
- computeScrollContentClientRect: function () {
424
- return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });
425
- },
426
- computeHorizontalScrollbarHeight: function () { return 0; },
427
- };
428
- // tslint:enable:object-literal-sort-keys
429
- },
430
- enumerable: false,
431
- configurable: true
432
- });
433
- MDCTabScrollerFoundation.prototype.init = function () {
434
- // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
435
- // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
436
- var horizontalScrollbarHeight = this.adapter.computeHorizontalScrollbarHeight();
437
- this.adapter.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
438
- this.adapter.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
439
- };
440
- /**
441
- * Computes the current visual scroll position
442
- */
443
- MDCTabScrollerFoundation.prototype.getScrollPosition = function () {
444
- if (this.isRTL()) {
445
- return this.computeCurrentScrollPositionRTL();
446
- }
447
- var currentTranslateX = this.calculateCurrentTranslateX();
448
- var scrollLeft = this.adapter.getScrollAreaScrollLeft();
449
- return scrollLeft - currentTranslateX;
450
- };
451
- /**
452
- * Handles interaction events that occur during transition
453
- */
454
- MDCTabScrollerFoundation.prototype.handleInteraction = function () {
455
- // Early exit if we aren't animating
456
- if (!this.isAnimating) {
457
- return;
458
- }
459
- // Prevent other event listeners from handling this event
460
- this.stopScrollAnimation();
461
- };
462
- /**
463
- * Handles the transitionend event
464
- */
465
- MDCTabScrollerFoundation.prototype.handleTransitionEnd = function (evt) {
466
- // Early exit if we aren't animating or the event was triggered by a different element.
467
- var evtTarget = evt.target;
468
- if (!this.isAnimating ||
469
- !this.adapter.eventTargetMatchesSelector(evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
470
- return;
471
- }
472
- this.isAnimating = false;
473
- this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
474
- };
475
- /**
476
- * Increment the scroll value by the scrollXIncrement using animation.
477
- * @param scrollXIncrement The value by which to increment the scroll position
478
- */
479
- MDCTabScrollerFoundation.prototype.incrementScroll = function (scrollXIncrement) {
480
- // Early exit for non-operational increment values
481
- if (scrollXIncrement === 0) {
482
- return;
483
- }
484
- this.animate(this.getIncrementScrollOperation(scrollXIncrement));
485
- };
486
- /**
487
- * Increment the scroll value by the scrollXIncrement without animation.
488
- * @param scrollXIncrement The value by which to increment the scroll position
489
- */
490
- MDCTabScrollerFoundation.prototype.incrementScrollImmediate = function (scrollXIncrement) {
491
- // Early exit for non-operational increment values
492
- if (scrollXIncrement === 0) {
493
- return;
494
- }
495
- var operation = this.getIncrementScrollOperation(scrollXIncrement);
496
- if (operation.scrollDelta === 0) {
497
- return;
498
- }
499
- this.stopScrollAnimation();
500
- this.adapter.setScrollAreaScrollLeft(operation.finalScrollPosition);
501
- };
502
- /**
503
- * Scrolls to the given scrollX value
504
- */
505
- MDCTabScrollerFoundation.prototype.scrollTo = function (scrollX) {
506
- if (this.isRTL()) {
507
- this.scrollToImplRTL(scrollX);
508
- return;
509
- }
510
- this.scrollToImpl(scrollX);
511
- };
512
- /**
513
- * @return Browser-specific {@link MDCTabScrollerRTL} instance.
514
- */
515
- MDCTabScrollerFoundation.prototype.getRTLScroller = function () {
516
- if (!this.rtlScrollerInstance) {
517
- this.rtlScrollerInstance = this.rtlScrollerFactory();
518
- }
519
- return this.rtlScrollerInstance;
520
- };
521
- /**
522
- * @return translateX value from a CSS matrix transform function string.
523
- */
524
- MDCTabScrollerFoundation.prototype.calculateCurrentTranslateX = function () {
525
- var transformValue = this.adapter.getScrollContentStyleValue('transform');
526
- // Early exit if no transform is present
527
- if (transformValue === 'none') {
528
- return 0;
529
- }
530
- // The transform value comes back as a matrix transformation in the form
531
- // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
532
- // we're going to grab all the parenthesized values, strip out tx, and
533
- // parse it.
534
- var match = /\((.+?)\)/.exec(transformValue);
535
- if (!match) {
536
- return 0;
537
- }
538
- var matrixParams = match[1];
539
- // tslint:disable-next-line:ban-ts-ignore "Unused vars" should be a linter warning, not a compiler error.
540
- // @ts-ignore These unused variables should retain their semantic names for clarity.
541
- var _a = __read(matrixParams.split(','), 6), tx = _a[4];
542
- return parseFloat(tx); // tslint:disable-line:ban
543
- };
544
- /**
545
- * Calculates a safe scroll value that is > 0 and < the max scroll value
546
- * @param scrollX The distance to scroll
547
- */
548
- MDCTabScrollerFoundation.prototype.clampScrollValue = function (scrollX) {
549
- var edges = this.calculateScrollEdges();
550
- return Math.min(Math.max(edges.left, scrollX), edges.right);
551
- };
552
- MDCTabScrollerFoundation.prototype.computeCurrentScrollPositionRTL = function () {
553
- var translateX = this.calculateCurrentTranslateX();
554
- return this.getRTLScroller().getScrollPositionRTL(translateX);
555
- };
556
- MDCTabScrollerFoundation.prototype.calculateScrollEdges = function () {
557
- var contentWidth = this.adapter.getScrollContentOffsetWidth();
558
- var rootWidth = this.adapter.getScrollAreaOffsetWidth();
559
- return {
560
- left: 0,
561
- right: contentWidth - rootWidth,
562
- };
563
- };
564
- /**
565
- * Internal scroll method
566
- * @param scrollX The new scroll position
567
- */
568
- MDCTabScrollerFoundation.prototype.scrollToImpl = function (scrollX) {
569
- var currentScrollX = this.getScrollPosition();
570
- var safeScrollX = this.clampScrollValue(scrollX);
571
- var scrollDelta = safeScrollX - currentScrollX;
572
- this.animate({
573
- finalScrollPosition: safeScrollX,
574
- scrollDelta: scrollDelta,
575
- });
576
- };
577
- /**
578
- * Internal RTL scroll method
579
- * @param scrollX The new scroll position
580
- */
581
- MDCTabScrollerFoundation.prototype.scrollToImplRTL = function (scrollX) {
582
- var animation = this.getRTLScroller().scrollToRTL(scrollX);
583
- this.animate(animation);
584
- };
585
- /**
586
- * Internal method to compute the increment scroll operation values.
587
- * @param scrollX The desired scroll position increment
588
- * @return MDCTabScrollerAnimation with the sanitized values for performing the scroll operation.
589
- */
590
- MDCTabScrollerFoundation.prototype.getIncrementScrollOperation = function (scrollX) {
591
- if (this.isRTL()) {
592
- return this.getRTLScroller().incrementScrollRTL(scrollX);
593
- }
594
- var currentScrollX = this.getScrollPosition();
595
- var targetScrollX = scrollX + currentScrollX;
596
- var safeScrollX = this.clampScrollValue(targetScrollX);
597
- var scrollDelta = safeScrollX - currentScrollX;
598
- return {
599
- finalScrollPosition: safeScrollX,
600
- scrollDelta: scrollDelta,
601
- };
602
- };
603
- /**
604
- * Animates the tab scrolling
605
- * @param animation The animation to apply
606
- */
607
- MDCTabScrollerFoundation.prototype.animate = function (animation) {
608
- var _this = this;
609
- // Early exit if translateX is 0, which means there's no animation to perform
610
- if (animation.scrollDelta === 0) {
611
- return;
612
- }
613
- this.stopScrollAnimation();
614
- // This animation uses the FLIP approach.
615
- // Read more here: https://aerotwist.com/blog/flip-your-animations/
616
- this.adapter.setScrollAreaScrollLeft(animation.finalScrollPosition);
617
- this.adapter.setScrollContentStyleProperty('transform', "translateX(" + animation.scrollDelta + "px)");
618
- // Force repaint
619
- this.adapter.computeScrollAreaClientRect();
620
- requestAnimationFrame(function () {
621
- _this.adapter.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
622
- _this.adapter.setScrollContentStyleProperty('transform', 'none');
623
- });
624
- this.isAnimating = true;
625
- };
626
- /**
627
- * Stops scroll animation
628
- */
629
- MDCTabScrollerFoundation.prototype.stopScrollAnimation = function () {
630
- this.isAnimating = false;
631
- var currentScrollPosition = this.getAnimatingScrollPosition();
632
- this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
633
- this.adapter.setScrollContentStyleProperty('transform', 'translateX(0px)');
634
- this.adapter.setScrollAreaScrollLeft(currentScrollPosition);
635
- };
636
- /**
637
- * Gets the current scroll position during animation
638
- */
639
- MDCTabScrollerFoundation.prototype.getAnimatingScrollPosition = function () {
640
- var currentTranslateX = this.calculateCurrentTranslateX();
641
- var scrollLeft = this.adapter.getScrollAreaScrollLeft();
642
- if (this.isRTL()) {
643
- return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
644
- }
645
- return scrollLeft - currentTranslateX;
646
- };
647
- /**
648
- * Determines the RTL Scroller to use
649
- */
650
- MDCTabScrollerFoundation.prototype.rtlScrollerFactory = function () {
651
- // Browsers have three different implementations of scrollLeft in RTL mode,
652
- // dependent on the browser. The behavior is based off the max LTR
653
- // scrollLeft value and 0.
654
- //
655
- // * Default scrolling in RTL *
656
- // - Left-most value: 0
657
- // - Right-most value: Max LTR scrollLeft value
658
- //
659
- // * Negative scrolling in RTL *
660
- // - Left-most value: Negated max LTR scrollLeft value
661
- // - Right-most value: 0
662
- //
663
- // * Reverse scrolling in RTL *
664
- // - Left-most value: Max LTR scrollLeft value
665
- // - Right-most value: 0
666
- //
667
- // We use those principles below to determine which RTL scrollLeft
668
- // behavior is implemented in the current browser.
669
- var initialScrollLeft = this.adapter.getScrollAreaScrollLeft();
670
- this.adapter.setScrollAreaScrollLeft(initialScrollLeft - 1);
671
- var newScrollLeft = this.adapter.getScrollAreaScrollLeft();
672
- // If the newScrollLeft value is negative,then we know that the browser has
673
- // implemented negative RTL scrolling, since all other implementations have
674
- // only positive values.
675
- if (newScrollLeft < 0) {
676
- // Undo the scrollLeft test check
677
- this.adapter.setScrollAreaScrollLeft(initialScrollLeft);
678
- return new MDCTabScrollerRTLNegative(this.adapter);
679
- }
680
- var rootClientRect = this.adapter.computeScrollAreaClientRect();
681
- var contentClientRect = this.adapter.computeScrollContentClientRect();
682
- var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
683
- // Undo the scrollLeft test check
684
- this.adapter.setScrollAreaScrollLeft(initialScrollLeft);
685
- // By calculating the clientRect of the root element and the clientRect of
686
- // the content element, we can determine how much the scroll value changed
687
- // when we performed the scrollLeft subtraction above.
688
- if (rightEdgeDelta === newScrollLeft) {
689
- return new MDCTabScrollerRTLReverse(this.adapter);
690
- }
691
- return new MDCTabScrollerRTLDefault(this.adapter);
692
- };
693
- MDCTabScrollerFoundation.prototype.isRTL = function () {
694
- return this.adapter.getScrollContentStyleValue('direction') === 'rtl';
695
- };
696
- return MDCTabScrollerFoundation;
697
- }(MDCFoundation));
698
-
699
- /**
700
- * @license
701
- * Copyright 2018 Google Inc.
702
- *
703
- * Permission is hereby granted, free of charge, to any person obtaining a copy
704
- * of this software and associated documentation files (the "Software"), to deal
705
- * in the Software without restriction, including without limitation the rights
706
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
707
- * copies of the Software, and to permit persons to whom the Software is
708
- * furnished to do so, subject to the following conditions:
709
- *
710
- * The above copyright notice and this permission notice shall be included in
711
- * all copies or substantial portions of the Software.
101
+ * Set a tabs `active` state to true in a list of tabs. The previous tab with
102
+ * `active` set to true will have it set to `false` instead.
712
103
  *
713
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
714
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
715
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
716
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
717
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
718
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
719
- * THE SOFTWARE.
720
- */
721
- /**
722
- * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
723
- */
724
- var horizontalScrollbarHeight_;
725
- /**
726
- * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
727
- * May return 0 (e.g. on OS X browsers under default configuration).
104
+ * @param tabs - list of tabs
105
+ * @param index - the index of the tab to set to active
106
+ * @returns a copy of the list of tabs with the changed tabs replaced
728
107
  */
729
- function computeHorizontalScrollbarHeight(documentObj, shouldCacheResult) {
730
- if (shouldCacheResult === void 0) { shouldCacheResult = true; }
731
- if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
732
- return horizontalScrollbarHeight_;
733
- }
734
- var el = documentObj.createElement('div');
735
- el.classList.add(cssClasses$2.SCROLL_TEST);
736
- documentObj.body.appendChild(el);
737
- var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
738
- documentObj.body.removeChild(el);
739
- if (shouldCacheResult) {
740
- horizontalScrollbarHeight_ = horizontalScrollbarHeight;
108
+ function setActiveTab(tabs, index) {
109
+ const oldSelectedTabIndex = tabs.findIndex((t) => t.active === true);
110
+ const result = [...tabs];
111
+ if (oldSelectedTabIndex !== -1) {
112
+ result[oldSelectedTabIndex] = Object.assign(Object.assign({}, tabs[oldSelectedTabIndex]), { active: false });
741
113
  }
742
- return horizontalScrollbarHeight;
114
+ result[index] = Object.assign(Object.assign({}, tabs[index]), { active: true });
115
+ return result;
743
116
  }
744
117
 
745
118
  /**
746
- * @license
747
- * Copyright 2018 Google Inc.
748
- *
749
- * Permission is hereby granted, free of charge, to any person obtaining a copy
750
- * of this software and associated documentation files (the "Software"), to deal
751
- * in the Software without restriction, including without limitation the rights
752
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
753
- * copies of the Software, and to permit persons to whom the Software is
754
- * furnished to do so, subject to the following conditions:
755
- *
756
- * The above copyright notice and this permission notice shall be included in
757
- * all copies or substantial portions of the Software.
758
- *
759
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
760
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
761
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
762
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
763
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
764
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
765
- * THE SOFTWARE.
766
- */
767
- var MDCTabScroller = /** @class */ (function (_super) {
768
- __extends(MDCTabScroller, _super);
769
- function MDCTabScroller() {
770
- return _super !== null && _super.apply(this, arguments) || this;
771
- }
772
- MDCTabScroller.attachTo = function (root) {
773
- return new MDCTabScroller(root);
774
- };
775
- // initialSyncWithDOM()
776
- MDCTabScroller.prototype.initialize = function () {
777
- this.area = this.root.querySelector(MDCTabScrollerFoundation.strings.AREA_SELECTOR);
778
- this.content = this.root.querySelector(MDCTabScrollerFoundation.strings.CONTENT_SELECTOR);
779
- };
780
- MDCTabScroller.prototype.initialSyncWithDOM = function () {
781
- var _this = this;
782
- this.handleInteraction = function () {
783
- _this.foundation.handleInteraction();
784
- };
785
- this.handleTransitionEnd = function (evt) {
786
- _this.foundation.handleTransitionEnd(evt);
787
- };
788
- this.area.addEventListener('wheel', this.handleInteraction, applyPassive());
789
- this.area.addEventListener('touchstart', this.handleInteraction, applyPassive());
790
- this.area.addEventListener('pointerdown', this.handleInteraction, applyPassive());
791
- this.area.addEventListener('mousedown', this.handleInteraction, applyPassive());
792
- this.area.addEventListener('keydown', this.handleInteraction, applyPassive());
793
- this.content.addEventListener('transitionend', this.handleTransitionEnd);
794
- };
795
- MDCTabScroller.prototype.destroy = function () {
796
- _super.prototype.destroy.call(this);
797
- this.area.removeEventListener('wheel', this.handleInteraction, applyPassive());
798
- this.area.removeEventListener('touchstart', this.handleInteraction, applyPassive());
799
- this.area.removeEventListener('pointerdown', this.handleInteraction, applyPassive());
800
- this.area.removeEventListener('mousedown', this.handleInteraction, applyPassive());
801
- this.area.removeEventListener('keydown', this.handleInteraction, applyPassive());
802
- this.content.removeEventListener('transitionend', this.handleTransitionEnd);
803
- };
804
- MDCTabScroller.prototype.getDefaultFoundation = function () {
805
- var _this = this;
806
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
807
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
808
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
809
- var adapter = {
810
- eventTargetMatchesSelector: function (evtTarget, selector) {
811
- return matches(evtTarget, selector);
812
- },
813
- addClass: function (className) {
814
- _this.root.classList.add(className);
815
- },
816
- removeClass: function (className) {
817
- _this.root.classList.remove(className);
818
- },
819
- addScrollAreaClass: function (className) {
820
- _this.area.classList.add(className);
821
- },
822
- setScrollAreaStyleProperty: function (prop, value) {
823
- _this.area.style.setProperty(prop, value);
824
- },
825
- setScrollContentStyleProperty: function (prop, value) {
826
- _this.content.style.setProperty(prop, value);
827
- },
828
- getScrollContentStyleValue: function (propName) {
829
- return window.getComputedStyle(_this.content).getPropertyValue(propName);
830
- },
831
- setScrollAreaScrollLeft: function (scrollX) { return _this.area.scrollLeft = scrollX; },
832
- getScrollAreaScrollLeft: function () { return _this.area.scrollLeft; },
833
- getScrollContentOffsetWidth: function () { return _this.content.offsetWidth; },
834
- getScrollAreaOffsetWidth: function () { return _this.area.offsetWidth; },
835
- computeScrollAreaClientRect: function () { return _this.area.getBoundingClientRect(); },
836
- computeScrollContentClientRect: function () {
837
- return _this.content.getBoundingClientRect();
838
- },
839
- computeHorizontalScrollbarHeight: function () {
840
- return computeHorizontalScrollbarHeight(document);
841
- },
842
- };
843
- // tslint:enable:object-literal-sort-keys
844
- return new MDCTabScrollerFoundation(adapter);
845
- };
846
- /**
847
- * Returns the current visual scroll position
848
- */
849
- MDCTabScroller.prototype.getScrollPosition = function () {
850
- return this.foundation.getScrollPosition();
851
- };
852
- /**
853
- * Returns the width of the scroll content
854
- */
855
- MDCTabScroller.prototype.getScrollContentWidth = function () {
856
- return this.content.offsetWidth;
857
- };
858
- /**
859
- * Increments the scroll value by the given amount
860
- * @param scrollXIncrement The pixel value by which to increment the scroll value
861
- */
862
- MDCTabScroller.prototype.incrementScroll = function (scrollXIncrement) {
863
- this.foundation.incrementScroll(scrollXIncrement);
864
- };
865
- /**
866
- * Scrolls to the given pixel position
867
- * @param scrollX The pixel value to scroll to
868
- */
869
- MDCTabScroller.prototype.scrollTo = function (scrollX) {
870
- this.foundation.scrollTo(scrollX);
871
- };
872
- return MDCTabScroller;
873
- }(MDCComponent));
874
-
875
- /**
876
- * @license
877
- * Copyright 2018 Google Inc.
878
- *
879
- * Permission is hereby granted, free of charge, to any person obtaining a copy
880
- * of this software and associated documentation files (the "Software"), to deal
881
- * in the Software without restriction, including without limitation the rights
882
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
883
- * copies of the Software, and to permit persons to whom the Software is
884
- * furnished to do so, subject to the following conditions:
885
- *
886
- * The above copyright notice and this permission notice shall be included in
887
- * all copies or substantial portions of the Software.
888
- *
889
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
890
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
891
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
892
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
893
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
894
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
895
- * THE SOFTWARE.
896
- */
897
- var cssClasses$1 = {
898
- ACTIVE: 'mdc-tab-indicator--active',
899
- FADE: 'mdc-tab-indicator--fade',
900
- NO_TRANSITION: 'mdc-tab-indicator--no-transition',
901
- };
902
- var strings$3 = {
903
- CONTENT_SELECTOR: '.mdc-tab-indicator__content',
904
- };
905
-
906
- /**
907
- * @license
908
- * Copyright 2018 Google Inc.
909
- *
910
- * Permission is hereby granted, free of charge, to any person obtaining a copy
911
- * of this software and associated documentation files (the "Software"), to deal
912
- * in the Software without restriction, including without limitation the rights
913
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
914
- * copies of the Software, and to permit persons to whom the Software is
915
- * furnished to do so, subject to the following conditions:
916
- *
917
- * The above copyright notice and this permission notice shall be included in
918
- * all copies or substantial portions of the Software.
919
- *
920
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
921
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
922
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
923
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
924
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
925
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
926
- * THE SOFTWARE.
119
+ * Returned when there is no item to move to.
927
120
  */
928
- var MDCTabIndicatorFoundation = /** @class */ (function (_super) {
929
- __extends(MDCTabIndicatorFoundation, _super);
930
- function MDCTabIndicatorFoundation(adapter) {
931
- return _super.call(this, __assign(__assign({}, MDCTabIndicatorFoundation.defaultAdapter), adapter)) || this;
932
- }
933
- Object.defineProperty(MDCTabIndicatorFoundation, "cssClasses", {
934
- get: function () {
935
- return cssClasses$1;
936
- },
937
- enumerable: false,
938
- configurable: true
939
- });
940
- Object.defineProperty(MDCTabIndicatorFoundation, "strings", {
941
- get: function () {
942
- return strings$3;
943
- },
944
- enumerable: false,
945
- configurable: true
946
- });
947
- Object.defineProperty(MDCTabIndicatorFoundation, "defaultAdapter", {
948
- get: function () {
949
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
950
- return {
951
- addClass: function () { return undefined; },
952
- removeClass: function () { return undefined; },
953
- computeContentClientRect: function () {
954
- return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });
955
- },
956
- setContentStyleProperty: function () { return undefined; },
957
- };
958
- // tslint:enable:object-literal-sort-keys
959
- },
960
- enumerable: false,
961
- configurable: true
962
- });
963
- MDCTabIndicatorFoundation.prototype.computeContentClientRect = function () {
964
- return this.adapter.computeContentClientRect();
965
- };
966
- return MDCTabIndicatorFoundation;
967
- }(MDCFoundation));
968
-
969
- /**
970
- * @license
971
- * Copyright 2018 Google Inc.
972
- *
973
- * Permission is hereby granted, free of charge, to any person obtaining a copy
974
- * of this software and associated documentation files (the "Software"), to deal
975
- * in the Software without restriction, including without limitation the rights
976
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
977
- * copies of the Software, and to permit persons to whom the Software is
978
- * furnished to do so, subject to the following conditions:
979
- *
980
- * The above copyright notice and this permission notice shall be included in
981
- * all copies or substantial portions of the Software.
982
- *
983
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
984
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
985
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
986
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
987
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
988
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
989
- * THE SOFTWARE.
990
- */
991
- /* istanbul ignore next: subclass is not a branch statement */
992
- var MDCFadingTabIndicatorFoundation = /** @class */ (function (_super) {
993
- __extends(MDCFadingTabIndicatorFoundation, _super);
994
- function MDCFadingTabIndicatorFoundation() {
995
- return _super !== null && _super.apply(this, arguments) || this;
996
- }
997
- MDCFadingTabIndicatorFoundation.prototype.activate = function () {
998
- this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);
999
- };
1000
- MDCFadingTabIndicatorFoundation.prototype.deactivate = function () {
1001
- this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);
1002
- };
1003
- return MDCFadingTabIndicatorFoundation;
1004
- }(MDCTabIndicatorFoundation));
1005
-
1006
- /**
1007
- * @license
1008
- * Copyright 2018 Google Inc.
1009
- *
1010
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1011
- * of this software and associated documentation files (the "Software"), to deal
1012
- * in the Software without restriction, including without limitation the rights
1013
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1014
- * copies of the Software, and to permit persons to whom the Software is
1015
- * furnished to do so, subject to the following conditions:
1016
- *
1017
- * The above copyright notice and this permission notice shall be included in
1018
- * all copies or substantial portions of the Software.
1019
- *
1020
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1021
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1022
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1023
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1024
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1025
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1026
- * THE SOFTWARE.
1027
- */
1028
- /* istanbul ignore next: subclass is not a branch statement */
1029
- var MDCSlidingTabIndicatorFoundation = /** @class */ (function (_super) {
1030
- __extends(MDCSlidingTabIndicatorFoundation, _super);
1031
- function MDCSlidingTabIndicatorFoundation() {
1032
- return _super !== null && _super.apply(this, arguments) || this;
1033
- }
1034
- MDCSlidingTabIndicatorFoundation.prototype.activate = function (previousIndicatorClientRect) {
1035
- // Early exit if no indicator is present to handle cases where an indicator
1036
- // may be activated without a prior indicator state
1037
- if (!previousIndicatorClientRect) {
1038
- this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);
1039
- return;
1040
- }
1041
- // This animation uses the FLIP approach. You can read more about it at the link below:
1042
- // https://aerotwist.com/blog/flip-your-animations/
1043
- // Calculate the dimensions based on the dimensions of the previous indicator
1044
- var currentClientRect = this.computeContentClientRect();
1045
- var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
1046
- var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
1047
- this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
1048
- this.adapter.setContentStyleProperty('transform', "translateX(" + xPosition + "px) scaleX(" + widthDelta + ")");
1049
- // Force repaint before updating classes and transform to ensure the transform properly takes effect
1050
- this.computeContentClientRect();
1051
- this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
1052
- this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);
1053
- this.adapter.setContentStyleProperty('transform', '');
1054
- };
1055
- MDCSlidingTabIndicatorFoundation.prototype.deactivate = function () {
1056
- this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);
1057
- };
1058
- return MDCSlidingTabIndicatorFoundation;
1059
- }(MDCTabIndicatorFoundation));
1060
-
1061
- /**
1062
- * @license
1063
- * Copyright 2018 Google Inc.
1064
- *
1065
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1066
- * of this software and associated documentation files (the "Software"), to deal
1067
- * in the Software without restriction, including without limitation the rights
1068
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1069
- * copies of the Software, and to permit persons to whom the Software is
1070
- * furnished to do so, subject to the following conditions:
1071
- *
1072
- * The above copyright notice and this permission notice shall be included in
1073
- * all copies or substantial portions of the Software.
1074
- *
1075
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1076
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1077
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1078
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1079
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1080
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1081
- * THE SOFTWARE.
1082
- */
1083
- var MDCTabIndicator = /** @class */ (function (_super) {
1084
- __extends(MDCTabIndicator, _super);
1085
- function MDCTabIndicator() {
1086
- return _super !== null && _super.apply(this, arguments) || this;
1087
- }
1088
- MDCTabIndicator.attachTo = function (root) {
1089
- return new MDCTabIndicator(root);
1090
- };
1091
- MDCTabIndicator.prototype.initialize = function () {
1092
- this.content = this.root.querySelector(MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR);
1093
- };
1094
- MDCTabIndicator.prototype.computeContentClientRect = function () {
1095
- return this.foundation.computeContentClientRect();
1096
- };
1097
- MDCTabIndicator.prototype.getDefaultFoundation = function () {
1098
- var _this = this;
1099
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
1100
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
1101
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1102
- var adapter = {
1103
- addClass: function (className) { return _this.root.classList.add(className); },
1104
- removeClass: function (className) { return _this.root.classList.remove(className); },
1105
- computeContentClientRect: function () { return _this.content.getBoundingClientRect(); },
1106
- setContentStyleProperty: function (prop, value) {
1107
- _this.content.style.setProperty(prop, value);
1108
- },
1109
- };
1110
- // tslint:enable:object-literal-sort-keys
1111
- if (this.root.classList.contains(MDCTabIndicatorFoundation.cssClasses.FADE)) {
1112
- return new MDCFadingTabIndicatorFoundation(adapter);
1113
- }
1114
- // Default to the sliding indicator
1115
- return new MDCSlidingTabIndicatorFoundation(adapter);
1116
- };
1117
- MDCTabIndicator.prototype.activate = function (previousIndicatorClientRect) {
1118
- this.foundation.activate(previousIndicatorClientRect);
1119
- };
1120
- MDCTabIndicator.prototype.deactivate = function () {
1121
- this.foundation.deactivate();
1122
- };
1123
- return MDCTabIndicator;
1124
- }(MDCComponent));
1125
-
1126
- /**
1127
- * @license
1128
- * Copyright 2018 Google Inc.
1129
- *
1130
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1131
- * of this software and associated documentation files (the "Software"), to deal
1132
- * in the Software without restriction, including without limitation the rights
1133
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1134
- * copies of the Software, and to permit persons to whom the Software is
1135
- * furnished to do so, subject to the following conditions:
1136
- *
1137
- * The above copyright notice and this permission notice shall be included in
1138
- * all copies or substantial portions of the Software.
1139
- *
1140
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1141
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1142
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1143
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1144
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1145
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1146
- * THE SOFTWARE.
1147
- */
1148
- var cssClasses = {
1149
- ACTIVE: 'mdc-tab--active',
1150
- };
1151
- var strings$2 = {
1152
- ARIA_SELECTED: 'aria-selected',
1153
- CONTENT_SELECTOR: '.mdc-tab__content',
1154
- INTERACTED_EVENT: 'MDCTab:interacted',
1155
- RIPPLE_SELECTOR: '.mdc-tab__ripple',
1156
- TABINDEX: 'tabIndex',
1157
- TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
121
+ const NO_NAVIGATION_TARGET = -1;
122
+ const MOVES = {
123
+ horizontal: new Map([
124
+ [ARROW_LEFT, 'previous'],
125
+ [ARROW_RIGHT, 'next'],
126
+ [HOME, 'first'],
127
+ [END, 'last'],
128
+ ]),
129
+ vertical: new Map([
130
+ [ARROW_UP, 'previous'],
131
+ [ARROW_DOWN, 'next'],
132
+ [HOME, 'first'],
133
+ [END, 'last'],
134
+ ]),
1158
135
  };
1159
-
1160
136
  /**
1161
- * @license
1162
- * Copyright 2018 Google Inc.
137
+ * Whether a keyboard event is one that moves between the items: an arrow key
138
+ * that goes along the orientation, or Home or End.
1163
139
  *
1164
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1165
- * of this software and associated documentation files (the "Software"), to deal
1166
- * in the Software without restriction, including without limitation the rights
1167
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1168
- * copies of the Software, and to permit persons to whom the Software is
1169
- * furnished to do so, subject to the following conditions:
140
+ * A key that is pressed with Alt, Ctrl or Cmd is not, since the browser puts
141
+ * those to its own use, such as going back with Alt and the left arrow. Shift
142
+ * is allowed.
1170
143
  *
1171
- * The above copyright notice and this permission notice shall be included in
1172
- * all copies or substantial portions of the Software.
144
+ * When this returns `true`, the component should prevent the default action
145
+ * of the event, so that the page does not scroll. Also when there turns out to
146
+ * be nowhere to move to.
1173
147
  *
1174
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1175
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1176
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1177
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1178
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1179
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1180
- * THE SOFTWARE.
148
+ * @param event - the keyboard event to inspect
149
+ * @param options - the same options that are used to move between the items.
150
+ * Only the orientation matters here.
151
+ * @returns `true` when the event is for moving between the items
1181
152
  */
1182
- var MDCTabFoundation = /** @class */ (function (_super) {
1183
- __extends(MDCTabFoundation, _super);
1184
- function MDCTabFoundation(adapter) {
1185
- var _this = _super.call(this, __assign(__assign({}, MDCTabFoundation.defaultAdapter), adapter)) || this;
1186
- _this.focusOnActivate = true;
1187
- return _this;
153
+ function isNavigationKey(event, options) {
154
+ if (event.altKey || event.ctrlKey || event.metaKey) {
155
+ return false;
1188
156
  }
1189
- Object.defineProperty(MDCTabFoundation, "cssClasses", {
1190
- get: function () {
1191
- return cssClasses;
1192
- },
1193
- enumerable: false,
1194
- configurable: true
1195
- });
1196
- Object.defineProperty(MDCTabFoundation, "strings", {
1197
- get: function () {
1198
- return strings$2;
1199
- },
1200
- enumerable: false,
1201
- configurable: true
1202
- });
1203
- Object.defineProperty(MDCTabFoundation, "defaultAdapter", {
1204
- get: function () {
1205
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1206
- return {
1207
- addClass: function () { return undefined; },
1208
- removeClass: function () { return undefined; },
1209
- hasClass: function () { return false; },
1210
- setAttr: function () { return undefined; },
1211
- activateIndicator: function () { return undefined; },
1212
- deactivateIndicator: function () { return undefined; },
1213
- notifyInteracted: function () { return undefined; },
1214
- getOffsetLeft: function () { return 0; },
1215
- getOffsetWidth: function () { return 0; },
1216
- getContentOffsetLeft: function () { return 0; },
1217
- getContentOffsetWidth: function () { return 0; },
1218
- focus: function () { return undefined; },
1219
- };
1220
- // tslint:enable:object-literal-sort-keys
1221
- },
1222
- enumerable: false,
1223
- configurable: true
1224
- });
1225
- MDCTabFoundation.prototype.handleClick = function () {
1226
- // It's up to the parent component to keep track of the active Tab and
1227
- // ensure we don't activate a Tab that's already active.
1228
- this.adapter.notifyInteracted();
1229
- };
1230
- MDCTabFoundation.prototype.isActive = function () {
1231
- return this.adapter.hasClass(cssClasses.ACTIVE);
1232
- };
1233
- /**
1234
- * Sets whether the tab should focus itself when activated
1235
- */
1236
- MDCTabFoundation.prototype.setFocusOnActivate = function (focusOnActivate) {
1237
- this.focusOnActivate = focusOnActivate;
1238
- };
1239
- /**
1240
- * Activates the Tab
1241
- */
1242
- MDCTabFoundation.prototype.activate = function (previousIndicatorClientRect) {
1243
- this.adapter.addClass(cssClasses.ACTIVE);
1244
- this.adapter.setAttr(strings$2.ARIA_SELECTED, 'true');
1245
- this.adapter.setAttr(strings$2.TABINDEX, '0');
1246
- this.adapter.activateIndicator(previousIndicatorClientRect);
1247
- if (this.focusOnActivate) {
1248
- this.adapter.focus();
1249
- }
1250
- };
1251
- /**
1252
- * Deactivates the Tab
1253
- */
1254
- MDCTabFoundation.prototype.deactivate = function () {
1255
- // Early exit
1256
- if (!this.isActive()) {
1257
- return;
1258
- }
1259
- this.adapter.removeClass(cssClasses.ACTIVE);
1260
- this.adapter.setAttr(strings$2.ARIA_SELECTED, 'false');
1261
- this.adapter.setAttr(strings$2.TABINDEX, '-1');
1262
- this.adapter.deactivateIndicator();
1263
- };
1264
- /**
1265
- * Returns the dimensions of the Tab
1266
- */
1267
- MDCTabFoundation.prototype.computeDimensions = function () {
1268
- var rootWidth = this.adapter.getOffsetWidth();
1269
- var rootLeft = this.adapter.getOffsetLeft();
1270
- var contentWidth = this.adapter.getContentOffsetWidth();
1271
- var contentLeft = this.adapter.getContentOffsetLeft();
1272
- return {
1273
- contentLeft: rootLeft + contentLeft,
1274
- contentRight: rootLeft + contentLeft + contentWidth,
1275
- rootLeft: rootLeft,
1276
- rootRight: rootLeft + rootWidth,
1277
- };
1278
- };
1279
- return MDCTabFoundation;
1280
- }(MDCFoundation));
1281
-
1282
- /**
1283
- * @license
1284
- * Copyright 2018 Google Inc.
1285
- *
1286
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1287
- * of this software and associated documentation files (the "Software"), to deal
1288
- * in the Software without restriction, including without limitation the rights
1289
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1290
- * copies of the Software, and to permit persons to whom the Software is
1291
- * furnished to do so, subject to the following conditions:
1292
- *
1293
- * The above copyright notice and this permission notice shall be included in
1294
- * all copies or substantial portions of the Software.
1295
- *
1296
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1297
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1298
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1299
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1300
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1301
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1302
- * THE SOFTWARE.
1303
- */
1304
- var MDCTab = /** @class */ (function (_super) {
1305
- __extends(MDCTab, _super);
1306
- function MDCTab() {
1307
- return _super !== null && _super.apply(this, arguments) || this;
1308
- }
1309
- MDCTab.attachTo = function (root) {
1310
- return new MDCTab(root);
1311
- };
1312
- MDCTab.prototype.initialize = function (rippleFactory, tabIndicatorFactory) {
1313
- if (rippleFactory === void 0) { rippleFactory = function (el, foundation) { return new MDCRipple(el, foundation); }; }
1314
- if (tabIndicatorFactory === void 0) { tabIndicatorFactory = function (el) { return new MDCTabIndicator(el); }; }
1315
- this.id = this.root.id;
1316
- var rippleFoundation = new MDCRippleFoundation(MDCRipple.createAdapter(this));
1317
- this.ripple = rippleFactory(this.root, rippleFoundation);
1318
- var tabIndicatorElement = this.root.querySelector(MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR);
1319
- this.tabIndicator = tabIndicatorFactory(tabIndicatorElement);
1320
- this.content = this.root.querySelector(MDCTabFoundation.strings.CONTENT_SELECTOR);
1321
- };
1322
- MDCTab.prototype.initialSyncWithDOM = function () {
1323
- var _this = this;
1324
- this.handleClick = function () {
1325
- _this.foundation.handleClick();
1326
- };
1327
- this.listen('click', this.handleClick);
1328
- };
1329
- MDCTab.prototype.destroy = function () {
1330
- this.unlisten('click', this.handleClick);
1331
- this.ripple.destroy();
1332
- _super.prototype.destroy.call(this);
1333
- };
1334
- MDCTab.prototype.getDefaultFoundation = function () {
1335
- var _this = this;
1336
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
1337
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
1338
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1339
- var adapter = {
1340
- setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); },
1341
- addClass: function (className) { return _this.root.classList.add(className); },
1342
- removeClass: function (className) { return _this.root.classList.remove(className); },
1343
- hasClass: function (className) { return _this.root.classList.contains(className); },
1344
- activateIndicator: function (previousIndicatorClientRect) {
1345
- _this.tabIndicator.activate(previousIndicatorClientRect);
1346
- },
1347
- deactivateIndicator: function () {
1348
- _this.tabIndicator.deactivate();
1349
- },
1350
- notifyInteracted: function () { return _this.emit(MDCTabFoundation.strings.INTERACTED_EVENT, { tabId: _this.id }, true /* bubble */); },
1351
- getOffsetLeft: function () { return _this.root.offsetLeft; },
1352
- getOffsetWidth: function () { return _this.root.offsetWidth; },
1353
- getContentOffsetLeft: function () { return _this.content.offsetLeft; },
1354
- getContentOffsetWidth: function () { return _this.content.offsetWidth; },
1355
- focus: function () { return _this.root.focus(); },
1356
- };
1357
- // tslint:enable:object-literal-sort-keys
1358
- return new MDCTabFoundation(adapter);
1359
- };
1360
- Object.defineProperty(MDCTab.prototype, "active", {
1361
- /**
1362
- * Getter for the active state of the tab
1363
- */
1364
- get: function () {
1365
- return this.foundation.isActive();
1366
- },
1367
- enumerable: false,
1368
- configurable: true
1369
- });
1370
- Object.defineProperty(MDCTab.prototype, "focusOnActivate", {
1371
- set: function (focusOnActivate) {
1372
- this.foundation.setFocusOnActivate(focusOnActivate);
1373
- },
1374
- enumerable: false,
1375
- configurable: true
1376
- });
1377
- /**
1378
- * Activates the tab
1379
- */
1380
- MDCTab.prototype.activate = function (computeIndicatorClientRect) {
1381
- this.foundation.activate(computeIndicatorClientRect);
1382
- };
1383
- /**
1384
- * Deactivates the tab
1385
- */
1386
- MDCTab.prototype.deactivate = function () {
1387
- this.foundation.deactivate();
1388
- };
1389
- /**
1390
- * Returns the indicator's client rect
1391
- */
1392
- MDCTab.prototype.computeIndicatorClientRect = function () {
1393
- return this.tabIndicator.computeContentClientRect();
1394
- };
1395
- MDCTab.prototype.computeDimensions = function () {
1396
- return this.foundation.computeDimensions();
1397
- };
1398
- /**
1399
- * Focuses the tab
1400
- */
1401
- MDCTab.prototype.focus = function () {
1402
- this.root.focus();
1403
- };
1404
- return MDCTab;
1405
- }(MDCComponent));
1406
-
157
+ return MOVES[options.orientation].has(event.key);
158
+ }
1407
159
  /**
1408
- * @license
1409
- * Copyright 2018 Google Inc.
1410
- *
1411
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1412
- * of this software and associated documentation files (the "Software"), to deal
1413
- * in the Software without restriction, including without limitation the rights
1414
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1415
- * copies of the Software, and to permit persons to whom the Software is
1416
- * furnished to do so, subject to the following conditions:
1417
- *
1418
- * The above copyright notice and this permission notice shall be included in
1419
- * all copies or substantial portions of the Software.
1420
- *
1421
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1422
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1423
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1424
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1425
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1426
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1427
- * THE SOFTWARE.
160
+ * Find the item that a key press moves to.
161
+ *
162
+ * - The arrow keys that go along the orientation move to the next and the
163
+ * previous item. At the ends they stop, or continue at the other end when
164
+ * `options.wrap` is set.
165
+ * - Home and End move to the first and the last item.
166
+ * - Items that cannot be moved to are skipped.
167
+ * - Without a current item, moving forward starts at the first item, and
168
+ * moving back at the last one.
169
+ *
170
+ * @param items - the items, in the order that they are laid out in. Only their
171
+ * number matters, unless `options.isDisabled` is given.
172
+ * @param key - the `key` of the keyboard event
173
+ * @param currentIndex - the index of the item to move from, usually the one
174
+ * that has focus. Anything outside `items` is treated as "no current item".
175
+ * @param options - which keys move, and how
176
+ * @returns the index of the item to move to. That is `currentIndex` itself
177
+ * when there is nowhere to go from there, since the end is reached and it does
178
+ * not wrap, or since it is the only item that can be moved to. It is
179
+ * `NO_NAVIGATION_TARGET` when the key does not move in this orientation, and
180
+ * when none of the items can be moved to.
1428
181
  */
1429
- var strings$1 = {
1430
- ARROW_LEFT_KEY: 'ArrowLeft',
1431
- ARROW_RIGHT_KEY: 'ArrowRight',
1432
- END_KEY: 'End',
1433
- ENTER_KEY: 'Enter',
1434
- HOME_KEY: 'Home',
1435
- SPACE_KEY: 'Space',
1436
- TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
1437
- TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
1438
- TAB_SELECTOR: '.mdc-tab',
1439
- };
1440
- var numbers = {
1441
- ARROW_LEFT_KEYCODE: 37,
1442
- ARROW_RIGHT_KEYCODE: 39,
1443
- END_KEYCODE: 35,
1444
- ENTER_KEYCODE: 13,
1445
- EXTRA_SCROLL_AMOUNT: 20,
1446
- HOME_KEYCODE: 36,
1447
- SPACE_KEYCODE: 32,
1448
- };
1449
-
182
+ function findNavigationTarget(items, key, currentIndex, options) {
183
+ const move = MOVES[options.orientation].get(key);
184
+ const count = items.length;
185
+ const canMoveTo = createReachableTest(items, options);
186
+ const first = findReachable(count, 0, 1, false, canMoveTo);
187
+ if (!move || first === NO_NAVIGATION_TARGET) {
188
+ return NO_NAVIGATION_TARGET;
189
+ }
190
+ if (move === 'first') {
191
+ return first;
192
+ }
193
+ const last = findReachable(count, count - 1, -1, false, canMoveTo);
194
+ if (move === 'last') {
195
+ return last;
196
+ }
197
+ if (!isWithin(currentIndex, count)) {
198
+ return move === 'next' ? first : last;
199
+ }
200
+ const step = move === 'next' ? 1 : -1;
201
+ const target = findReachable(count, currentIndex + step, step, Boolean(options.wrap), canMoveTo);
202
+ return target === NO_NAVIGATION_TARGET ? currentIndex : target;
203
+ }
1450
204
  /**
1451
- * @license
1452
- * Copyright 2018 Google Inc.
1453
- *
1454
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1455
- * of this software and associated documentation files (the "Software"), to deal
1456
- * in the Software without restriction, including without limitation the rights
1457
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1458
- * copies of the Software, and to permit persons to whom the Software is
1459
- * furnished to do so, subject to the following conditions:
1460
- *
1461
- * The above copyright notice and this permission notice shall be included in
1462
- * all copies or substantial portions of the Software.
1463
- *
1464
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1465
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1466
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1467
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1468
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1469
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1470
- * THE SOFTWARE.
205
+ * Find the item that should be in the tab order, which is the one that Tab
206
+ * lands on when it enters the group. The rest of the items are left out of the
207
+ * tab order, and are reached with the arrow keys.
208
+ *
209
+ * That is the preferred item, if it can be moved to. Otherwise the first item
210
+ * that can.
211
+ *
212
+ * @param items - the items, in the order that they are laid out in. Only their
213
+ * number matters, unless `options.isDisabled` is given.
214
+ * @param preferredIndex - the index of the item that should be in the tab
215
+ * order if possible. For a group with a selection that is the selected item,
216
+ * and otherwise the item that last had focus, which the component has to keep
217
+ * track of. Anything outside `items` means that there is no preference.
218
+ * @param options - the same options that are used to move between the items
219
+ * @returns the index of the item to put in the tab order, or
220
+ * `NO_NAVIGATION_TARGET` when none of the items can be moved to
1471
221
  */
1472
- var ACCEPTABLE_KEYS = new Set();
1473
- // IE11 has no support for new Set with iterable so we need to initialize this by hand
1474
- ACCEPTABLE_KEYS.add(strings$1.ARROW_LEFT_KEY);
1475
- ACCEPTABLE_KEYS.add(strings$1.ARROW_RIGHT_KEY);
1476
- ACCEPTABLE_KEYS.add(strings$1.END_KEY);
1477
- ACCEPTABLE_KEYS.add(strings$1.HOME_KEY);
1478
- ACCEPTABLE_KEYS.add(strings$1.ENTER_KEY);
1479
- ACCEPTABLE_KEYS.add(strings$1.SPACE_KEY);
1480
- var KEYCODE_MAP = new Map();
1481
- // IE11 has no support for new Map with iterable so we need to initialize this by hand
1482
- KEYCODE_MAP.set(numbers.ARROW_LEFT_KEYCODE, strings$1.ARROW_LEFT_KEY);
1483
- KEYCODE_MAP.set(numbers.ARROW_RIGHT_KEYCODE, strings$1.ARROW_RIGHT_KEY);
1484
- KEYCODE_MAP.set(numbers.END_KEYCODE, strings$1.END_KEY);
1485
- KEYCODE_MAP.set(numbers.HOME_KEYCODE, strings$1.HOME_KEY);
1486
- KEYCODE_MAP.set(numbers.ENTER_KEYCODE, strings$1.ENTER_KEY);
1487
- KEYCODE_MAP.set(numbers.SPACE_KEYCODE, strings$1.SPACE_KEY);
1488
- var MDCTabBarFoundation = /** @class */ (function (_super) {
1489
- __extends(MDCTabBarFoundation, _super);
1490
- function MDCTabBarFoundation(adapter) {
1491
- var _this = _super.call(this, __assign(__assign({}, MDCTabBarFoundation.defaultAdapter), adapter)) || this;
1492
- _this.useAutomaticActivation = false;
1493
- return _this;
222
+ function findTabStop(items, preferredIndex, options) {
223
+ const count = items.length;
224
+ const canMoveTo = createReachableTest(items, options);
225
+ if (isWithin(preferredIndex, count) && canMoveTo(preferredIndex)) {
226
+ return preferredIndex;
1494
227
  }
1495
- Object.defineProperty(MDCTabBarFoundation, "strings", {
1496
- get: function () {
1497
- return strings$1;
1498
- },
1499
- enumerable: false,
1500
- configurable: true
1501
- });
1502
- Object.defineProperty(MDCTabBarFoundation, "numbers", {
1503
- get: function () {
1504
- return numbers;
1505
- },
1506
- enumerable: false,
1507
- configurable: true
1508
- });
1509
- Object.defineProperty(MDCTabBarFoundation, "defaultAdapter", {
1510
- get: function () {
1511
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1512
- return {
1513
- scrollTo: function () { return undefined; },
1514
- incrementScroll: function () { return undefined; },
1515
- getScrollPosition: function () { return 0; },
1516
- getScrollContentWidth: function () { return 0; },
1517
- getOffsetWidth: function () { return 0; },
1518
- isRTL: function () { return false; },
1519
- setActiveTab: function () { return undefined; },
1520
- activateTabAtIndex: function () { return undefined; },
1521
- deactivateTabAtIndex: function () { return undefined; },
1522
- focusTabAtIndex: function () { return undefined; },
1523
- getTabIndicatorClientRectAtIndex: function () {
1524
- return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });
1525
- },
1526
- getTabDimensionsAtIndex: function () {
1527
- return ({ rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0 });
1528
- },
1529
- getPreviousActiveTabIndex: function () { return -1; },
1530
- getFocusedTabIndex: function () { return -1; },
1531
- getIndexOfTabById: function () { return -1; },
1532
- getTabListLength: function () { return 0; },
1533
- notifyTabActivated: function () { return undefined; },
1534
- };
1535
- // tslint:enable:object-literal-sort-keys
1536
- },
1537
- enumerable: false,
1538
- configurable: true
1539
- });
1540
- /**
1541
- * Switches between automatic and manual activation modes.
1542
- * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
1543
- */
1544
- MDCTabBarFoundation.prototype.setUseAutomaticActivation = function (useAutomaticActivation) {
1545
- this.useAutomaticActivation = useAutomaticActivation;
1546
- };
1547
- MDCTabBarFoundation.prototype.activateTab = function (index) {
1548
- var previousActiveIndex = this.adapter.getPreviousActiveTabIndex();
1549
- if (!this.indexIsInRange(index) || index === previousActiveIndex) {
1550
- return;
1551
- }
1552
- var previousClientRect;
1553
- if (previousActiveIndex !== -1) {
1554
- this.adapter.deactivateTabAtIndex(previousActiveIndex);
1555
- previousClientRect =
1556
- this.adapter.getTabIndicatorClientRectAtIndex(previousActiveIndex);
1557
- }
1558
- this.adapter.activateTabAtIndex(index, previousClientRect);
1559
- this.scrollIntoView(index);
1560
- this.adapter.notifyTabActivated(index);
1561
- };
1562
- MDCTabBarFoundation.prototype.handleKeyDown = function (evt) {
1563
- // Get the key from the event
1564
- var key = this.getKeyFromEvent(evt);
1565
- // Early exit if the event key isn't one of the keyboard navigation keys
1566
- if (key === undefined) {
1567
- return;
1568
- }
1569
- // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
1570
- if (!this.isActivationKey(key)) {
1571
- evt.preventDefault();
1572
- }
1573
- if (this.useAutomaticActivation) {
1574
- if (this.isActivationKey(key)) {
1575
- return;
1576
- }
1577
- var index = this.determineTargetFromKey(this.adapter.getPreviousActiveTabIndex(), key);
1578
- this.adapter.setActiveTab(index);
1579
- this.scrollIntoView(index);
1580
- }
1581
- else {
1582
- var focusedTabIndex = this.adapter.getFocusedTabIndex();
1583
- if (this.isActivationKey(key)) {
1584
- this.adapter.setActiveTab(focusedTabIndex);
1585
- }
1586
- else {
1587
- var index = this.determineTargetFromKey(focusedTabIndex, key);
1588
- this.adapter.focusTabAtIndex(index);
1589
- this.scrollIntoView(index);
1590
- }
1591
- }
1592
- };
1593
- /**
1594
- * Handles the MDCTab:interacted event
1595
- */
1596
- MDCTabBarFoundation.prototype.handleTabInteraction = function (evt) {
1597
- this.adapter.setActiveTab(this.adapter.getIndexOfTabById(evt.detail.tabId));
1598
- };
1599
- /**
1600
- * Scrolls the tab at the given index into view
1601
- * @param index The tab index to make visible
1602
- */
1603
- MDCTabBarFoundation.prototype.scrollIntoView = function (index) {
1604
- // Early exit if the index is out of range
1605
- if (!this.indexIsInRange(index)) {
1606
- return;
1607
- }
1608
- // Always scroll to 0 if scrolling to the 0th index
1609
- if (index === 0) {
1610
- this.adapter.scrollTo(0);
1611
- return;
1612
- }
1613
- // Always scroll to the max value if scrolling to the Nth index
1614
- // MDCTabScroller.scrollTo() will never scroll past the max possible value
1615
- if (index === this.adapter.getTabListLength() - 1) {
1616
- this.adapter.scrollTo(this.adapter.getScrollContentWidth());
1617
- return;
1618
- }
1619
- if (this.isRTL()) {
1620
- this.scrollIntoViewImplRTL(index);
1621
- return;
1622
- }
1623
- this.scrollIntoViewImpl(index);
1624
- };
1625
- /**
1626
- * Private method for determining the index of the destination tab based on what key was pressed
1627
- * @param origin The original index from which to determine the destination
1628
- * @param key The name of the key
1629
- */
1630
- MDCTabBarFoundation.prototype.determineTargetFromKey = function (origin, key) {
1631
- var isRTL = this.isRTL();
1632
- var maxIndex = this.adapter.getTabListLength() - 1;
1633
- var shouldGoToEnd = key === strings$1.END_KEY;
1634
- var shouldDecrement = key === strings$1.ARROW_LEFT_KEY && !isRTL || key === strings$1.ARROW_RIGHT_KEY && isRTL;
1635
- var shouldIncrement = key === strings$1.ARROW_RIGHT_KEY && !isRTL || key === strings$1.ARROW_LEFT_KEY && isRTL;
1636
- var index = origin;
1637
- if (shouldGoToEnd) {
1638
- index = maxIndex;
1639
- }
1640
- else if (shouldDecrement) {
1641
- index -= 1;
1642
- }
1643
- else if (shouldIncrement) {
1644
- index += 1;
1645
- }
1646
- else {
1647
- index = 0;
1648
- }
1649
- if (index < 0) {
1650
- index = maxIndex;
1651
- }
1652
- else if (index > maxIndex) {
1653
- index = 0;
1654
- }
1655
- return index;
1656
- };
1657
- /**
1658
- * Calculates the scroll increment that will make the tab at the given index visible
1659
- * @param index The index of the tab
1660
- * @param nextIndex The index of the next tab
1661
- * @param scrollPosition The current scroll position
1662
- * @param barWidth The width of the Tab Bar
1663
- */
1664
- MDCTabBarFoundation.prototype.calculateScrollIncrement = function (index, nextIndex, scrollPosition, barWidth) {
1665
- var nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);
1666
- var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
1667
- var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
1668
- var leftIncrement = relativeContentRight - numbers.EXTRA_SCROLL_AMOUNT;
1669
- var rightIncrement = relativeContentLeft + numbers.EXTRA_SCROLL_AMOUNT;
1670
- if (nextIndex < index) {
1671
- return Math.min(leftIncrement, 0);
1672
- }
1673
- return Math.max(rightIncrement, 0);
1674
- };
1675
- /**
1676
- * Calculates the scroll increment that will make the tab at the given index visible in RTL
1677
- * @param index The index of the tab
1678
- * @param nextIndex The index of the next tab
1679
- * @param scrollPosition The current scroll position
1680
- * @param barWidth The width of the Tab Bar
1681
- * @param scrollContentWidth The width of the scroll content
1682
- */
1683
- MDCTabBarFoundation.prototype.calculateScrollIncrementRTL = function (index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
1684
- var nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);
1685
- var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
1686
- var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
1687
- var leftIncrement = relativeContentRight + numbers.EXTRA_SCROLL_AMOUNT;
1688
- var rightIncrement = relativeContentLeft - numbers.EXTRA_SCROLL_AMOUNT;
1689
- if (nextIndex > index) {
1690
- return Math.max(leftIncrement, 0);
1691
- }
1692
- return Math.min(rightIncrement, 0);
1693
- };
1694
- /**
1695
- * Determines the index of the adjacent tab closest to either edge of the Tab Bar
1696
- * @param index The index of the tab
1697
- * @param tabDimensions The dimensions of the tab
1698
- * @param scrollPosition The current scroll position
1699
- * @param barWidth The width of the tab bar
1700
- */
1701
- MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdge = function (index, tabDimensions, scrollPosition, barWidth) {
1702
- /**
1703
- * Tabs are laid out in the Tab Scroller like this:
1704
- *
1705
- * Scroll Position
1706
- * +---+
1707
- * | | Bar Width
1708
- * | +-----------------------------------+
1709
- * | | |
1710
- * | V V
1711
- * | +-----------------------------------+
1712
- * V | Tab Scroller |
1713
- * +------------+--------------+-------------------+
1714
- * | Tab | Tab | Tab |
1715
- * +------------+--------------+-------------------+
1716
- * | |
1717
- * +-----------------------------------+
1718
- *
1719
- * To determine the next adjacent index, we look at the Tab root left and
1720
- * Tab root right, both relative to the scroll position. If the Tab root
1721
- * left is less than 0, then we know it's out of view to the left. If the
1722
- * Tab root right minus the bar width is greater than 0, we know the Tab is
1723
- * out of view to the right. From there, we either increment or decrement
1724
- * the index.
1725
- */
1726
- var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
1727
- var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
1728
- var relativeRootDelta = relativeRootLeft + relativeRootRight;
1729
- var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
1730
- var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
1731
- if (leftEdgeIsCloser) {
1732
- return index - 1;
1733
- }
1734
- if (rightEdgeIsCloser) {
1735
- return index + 1;
1736
- }
1737
- return -1;
1738
- };
1739
- /**
1740
- * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
1741
- * @param index The index of the tab
1742
- * @param tabDimensions The dimensions of the tab
1743
- * @param scrollPosition The current scroll position
1744
- * @param barWidth The width of the tab bar
1745
- * @param scrollContentWidth The width of the scroller content
1746
- */
1747
- MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdgeRTL = function (index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
1748
- var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
1749
- var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
1750
- var rootDelta = rootLeft + rootRight;
1751
- var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
1752
- var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
1753
- if (leftEdgeIsCloser) {
1754
- return index + 1;
1755
- }
1756
- if (rightEdgeIsCloser) {
1757
- return index - 1;
1758
- }
1759
- return -1;
1760
- };
1761
- /**
1762
- * Returns the key associated with a keydown event
1763
- * @param evt The keydown event
1764
- */
1765
- MDCTabBarFoundation.prototype.getKeyFromEvent = function (evt) {
1766
- if (ACCEPTABLE_KEYS.has(evt.key)) {
1767
- return evt.key;
1768
- }
1769
- return KEYCODE_MAP.get(evt.keyCode);
1770
- };
1771
- MDCTabBarFoundation.prototype.isActivationKey = function (key) {
1772
- return key === strings$1.SPACE_KEY || key === strings$1.ENTER_KEY;
1773
- };
1774
- /**
1775
- * Returns whether a given index is inclusively between the ends
1776
- * @param index The index to test
1777
- */
1778
- MDCTabBarFoundation.prototype.indexIsInRange = function (index) {
1779
- return index >= 0 && index < this.adapter.getTabListLength();
1780
- };
1781
- /**
1782
- * Returns the view's RTL property
1783
- */
1784
- MDCTabBarFoundation.prototype.isRTL = function () {
1785
- return this.adapter.isRTL();
1786
- };
1787
- /**
1788
- * Scrolls the tab at the given index into view for left-to-right user agents.
1789
- * @param index The index of the tab to scroll into view
1790
- */
1791
- MDCTabBarFoundation.prototype.scrollIntoViewImpl = function (index) {
1792
- var scrollPosition = this.adapter.getScrollPosition();
1793
- var barWidth = this.adapter.getOffsetWidth();
1794
- var tabDimensions = this.adapter.getTabDimensionsAtIndex(index);
1795
- var nextIndex = this.findAdjacentTabIndexClosestToEdge(index, tabDimensions, scrollPosition, barWidth);
1796
- if (!this.indexIsInRange(nextIndex)) {
1797
- return;
1798
- }
1799
- var scrollIncrement = this.calculateScrollIncrement(index, nextIndex, scrollPosition, barWidth);
1800
- this.adapter.incrementScroll(scrollIncrement);
1801
- };
1802
- /**
1803
- * Scrolls the tab at the given index into view in RTL
1804
- * @param index The tab index to make visible
1805
- */
1806
- MDCTabBarFoundation.prototype.scrollIntoViewImplRTL = function (index) {
1807
- var scrollPosition = this.adapter.getScrollPosition();
1808
- var barWidth = this.adapter.getOffsetWidth();
1809
- var tabDimensions = this.adapter.getTabDimensionsAtIndex(index);
1810
- var scrollWidth = this.adapter.getScrollContentWidth();
1811
- var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
1812
- if (!this.indexIsInRange(nextIndex)) {
1813
- return;
1814
- }
1815
- var scrollIncrement = this.calculateScrollIncrementRTL(index, nextIndex, scrollPosition, barWidth, scrollWidth);
1816
- this.adapter.incrementScroll(scrollIncrement);
1817
- };
1818
- return MDCTabBarFoundation;
1819
- }(MDCFoundation));
1820
-
228
+ return findReachable(count, 0, 1, false, canMoveTo);
229
+ }
230
+ function isWithin(index, count) {
231
+ return index >= 0 && index < count;
232
+ }
233
+ function createReachableTest(items, options) {
234
+ return (index) => { var _a; return !((_a = options === null || options === void 0 ? void 0 : options.isDisabled) === null || _a === void 0 ? void 0 : _a.call(options, items[index])); };
235
+ }
1821
236
  /**
1822
- * @license
1823
- * Copyright 2018 Google Inc.
1824
- *
1825
- * Permission is hereby granted, free of charge, to any person obtaining a copy
1826
- * of this software and associated documentation files (the "Software"), to deal
1827
- * in the Software without restriction, including without limitation the rights
1828
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1829
- * copies of the Software, and to permit persons to whom the Software is
1830
- * furnished to do so, subject to the following conditions:
1831
- *
1832
- * The above copyright notice and this permission notice shall be included in
1833
- * all copies or substantial portions of the Software.
1834
- *
1835
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1836
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1837
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1838
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1839
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1840
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1841
- * THE SOFTWARE.
237
+ * Look for an item that can be moved to, one item at a time.
238
+ *
239
+ * @param count - the number of items
240
+ * @param start - the index to start looking at
241
+ * @param step - the direction to look in, `1` for forward and `-1` for back
242
+ * @param wrap - whether to continue at the other end, instead of giving up at
243
+ * the end of the items. Every item is looked at once at most.
244
+ * @param canMoveTo - tells whether the item at an index can be moved to
245
+ * @returns the index of the first item that can be moved to, or
246
+ * `NO_NAVIGATION_TARGET` when there is none
1842
247
  */
1843
- var strings = MDCTabBarFoundation.strings;
1844
- var tabIdCounter = 0;
1845
- var MDCTabBar = /** @class */ (function (_super) {
1846
- __extends(MDCTabBar, _super);
1847
- function MDCTabBar() {
1848
- return _super !== null && _super.apply(this, arguments) || this;
1849
- }
1850
- MDCTabBar.attachTo = function (root) {
1851
- return new MDCTabBar(root);
1852
- };
1853
- Object.defineProperty(MDCTabBar.prototype, "focusOnActivate", {
1854
- set: function (focusOnActivate) {
1855
- var e_1, _a;
1856
- try {
1857
- for (var _b = __values(this.tabList), _c = _b.next(); !_c.done; _c = _b.next()) {
1858
- var tab = _c.value;
1859
- tab.focusOnActivate = focusOnActivate;
1860
- }
1861
- }
1862
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1863
- finally {
1864
- try {
1865
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1866
- }
1867
- finally { if (e_1) throw e_1.error; }
1868
- }
1869
- },
1870
- enumerable: false,
1871
- configurable: true
1872
- });
1873
- Object.defineProperty(MDCTabBar.prototype, "useAutomaticActivation", {
1874
- set: function (useAutomaticActivation) {
1875
- this.foundation.setUseAutomaticActivation(useAutomaticActivation);
1876
- },
1877
- enumerable: false,
1878
- configurable: true
1879
- });
1880
- MDCTabBar.prototype.initialize = function (tabFactory, tabScrollerFactory) {
1881
- if (tabFactory === void 0) { tabFactory = function (el) { return new MDCTab(el); }; }
1882
- if (tabScrollerFactory === void 0) { tabScrollerFactory = function (el) { return new MDCTabScroller(el); }; }
1883
- this.tabList = this.instantiateTabs(tabFactory);
1884
- this.tabScroller = this.instantiatetabScroller(tabScrollerFactory);
1885
- };
1886
- MDCTabBar.prototype.initialSyncWithDOM = function () {
1887
- var _this = this;
1888
- this.handleTabInteraction = function (evt) {
1889
- _this.foundation.handleTabInteraction(evt);
1890
- };
1891
- this.handleKeyDown = function (evt) {
1892
- _this.foundation.handleKeyDown(evt);
1893
- };
1894
- this.listen(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction);
1895
- this.listen('keydown', this.handleKeyDown);
1896
- for (var i = 0; i < this.tabList.length; i++) {
1897
- if (this.tabList[i].active) {
1898
- this.scrollIntoView(i);
1899
- break;
1900
- }
248
+ function findReachable(count, start, step, wrap, canMoveTo) {
249
+ for (let distance = 0; distance < count; distance += 1) {
250
+ const position = start + step * distance;
251
+ if (!wrap && !isWithin(position, count)) {
252
+ break;
1901
253
  }
1902
- };
1903
- MDCTabBar.prototype.destroy = function () {
1904
- var e_2, _a;
1905
- _super.prototype.destroy.call(this);
1906
- this.unlisten(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction);
1907
- this.unlisten('keydown', this.handleKeyDown);
1908
- try {
1909
- for (var _b = __values(this.tabList), _c = _b.next(); !_c.done; _c = _b.next()) {
1910
- var tab = _c.value;
1911
- tab.destroy();
1912
- }
254
+ const index = ((position % count) + count) % count;
255
+ if (canMoveTo(index)) {
256
+ return index;
1913
257
  }
1914
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1915
- finally {
1916
- try {
1917
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1918
- }
1919
- finally { if (e_2) throw e_2.error; }
1920
- }
1921
- if (this.tabScroller) {
1922
- this.tabScroller.destroy();
1923
- }
1924
- };
1925
- MDCTabBar.prototype.getDefaultFoundation = function () {
1926
- var _this = this;
1927
- // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
1928
- // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
1929
- // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1930
- var adapter = {
1931
- scrollTo: function (scrollX) {
1932
- _this.tabScroller.scrollTo(scrollX);
1933
- },
1934
- incrementScroll: function (scrollXIncrement) {
1935
- _this.tabScroller.incrementScroll(scrollXIncrement);
1936
- },
1937
- getScrollPosition: function () { return _this.tabScroller.getScrollPosition(); },
1938
- getScrollContentWidth: function () { return _this.tabScroller.getScrollContentWidth(); },
1939
- getOffsetWidth: function () { return _this.root.offsetWidth; },
1940
- isRTL: function () { return window.getComputedStyle(_this.root).getPropertyValue('direction') === 'rtl'; },
1941
- setActiveTab: function (index) {
1942
- _this.foundation.activateTab(index);
1943
- },
1944
- activateTabAtIndex: function (index, clientRect) {
1945
- _this.tabList[index].activate(clientRect);
1946
- },
1947
- deactivateTabAtIndex: function (index) {
1948
- _this.tabList[index].deactivate();
1949
- },
1950
- focusTabAtIndex: function (index) {
1951
- _this.tabList[index].focus();
1952
- },
1953
- getTabIndicatorClientRectAtIndex: function (index) {
1954
- return _this.tabList[index].computeIndicatorClientRect();
1955
- },
1956
- getTabDimensionsAtIndex: function (index) {
1957
- return _this.tabList[index].computeDimensions();
1958
- },
1959
- getPreviousActiveTabIndex: function () {
1960
- for (var i = 0; i < _this.tabList.length; i++) {
1961
- if (_this.tabList[i].active) {
1962
- return i;
1963
- }
1964
- }
1965
- return -1;
1966
- },
1967
- getFocusedTabIndex: function () {
1968
- var tabElements = _this.getTabElements();
1969
- var activeElement = document.activeElement;
1970
- return tabElements.indexOf(activeElement);
1971
- },
1972
- getIndexOfTabById: function (id) {
1973
- for (var i = 0; i < _this.tabList.length; i++) {
1974
- if (_this.tabList[i].id === id) {
1975
- return i;
1976
- }
1977
- }
1978
- return -1;
1979
- },
1980
- getTabListLength: function () { return _this.tabList.length; },
1981
- notifyTabActivated: function (index) { return _this.emit(strings.TAB_ACTIVATED_EVENT, { index: index }, true); },
1982
- };
1983
- // tslint:enable:object-literal-sort-keys
1984
- return new MDCTabBarFoundation(adapter);
1985
- };
1986
- /**
1987
- * Activates the tab at the given index
1988
- * @param index The index of the tab
1989
- */
1990
- MDCTabBar.prototype.activateTab = function (index) {
1991
- this.foundation.activateTab(index);
1992
- };
1993
- /**
1994
- * Scrolls the tab at the given index into view
1995
- * @param index THe index of the tab
1996
- */
1997
- MDCTabBar.prototype.scrollIntoView = function (index) {
1998
- this.foundation.scrollIntoView(index);
1999
- };
2000
- /**
2001
- * Returns all the tab elements in a nice clean array
2002
- */
2003
- MDCTabBar.prototype.getTabElements = function () {
2004
- return [].slice.call(this.root.querySelectorAll(strings.TAB_SELECTOR));
2005
- };
2006
- /**
2007
- * Instantiates tab components on all child tab elements
2008
- */
2009
- MDCTabBar.prototype.instantiateTabs = function (tabFactory) {
2010
- return this.getTabElements().map(function (el) {
2011
- el.id = el.id || "mdc-tab-" + ++tabIdCounter;
2012
- return tabFactory(el);
2013
- });
2014
- };
2015
- /**
2016
- * Instantiates tab scroller component on the child tab scroller element
2017
- */
2018
- MDCTabBar.prototype.instantiatetabScroller = function (tabScrollerFactory) {
2019
- var tabScrollerElement = this.root.querySelector(strings.TAB_SCROLLER_SELECTOR);
2020
- if (tabScrollerElement) {
2021
- return tabScrollerFactory(tabScrollerElement);
2022
- }
2023
- return null;
2024
- };
2025
- return MDCTabBar;
2026
- }(MDCComponent));
2027
-
2028
- /**
2029
- * Set a tabs `active` state to true in a list of tabs. The previous tab with
2030
- * `active` set to true will have it set to `false` instead.
2031
- *
2032
- * @param tabs - list of tabs
2033
- * @param index - the index of the tab to set to active
2034
- * @returns a copy of the list of tabs with the changed tabs replaced
2035
- */
2036
- function setActiveTab(tabs, index) {
2037
- const oldSelectedTabIndex = tabs.findIndex((t) => t.active === true);
2038
- const result = [...tabs];
2039
- if (oldSelectedTabIndex !== -1) {
2040
- result[oldSelectedTabIndex] = Object.assign(Object.assign({}, tabs[oldSelectedTabIndex]), { active: false });
2041
258
  }
2042
- result[index] = Object.assign(Object.assign({}, tabs[index]), { active: true });
2043
- return result;
259
+ return NO_NAVIGATION_TARGET;
2044
260
  }
2045
261
 
2046
- const tabBarCss = () => `@charset "UTF-8";.scroll-fade,.scroll-button{position:absolute;transition-property:transform;transition-duration:0.3s;transition-timing-function:ease-out}.scroll-fade{top:0;height:100%;width:4rem;pointer-events:none}.scroll-fade.left{transform:translate3d(-4rem, 0, 0);left:0;background:linear-gradient(270deg, rgba(var(--limel-tab-background-color), 0) 0%, rgba(var(--limel-tab-background-color), 0.8) 40%, rgba(var(--limel-tab-background-color), 0.8) 100%)}.scroll-fade.right{transform:translate3d(4rem, 0, 0);right:0;background:linear-gradient(90deg, rgba(var(--limel-tab-background-color), 0) 0%, rgba(var(--limel-tab-background-color), 0.8) 40%, rgba(var(--limel-tab-background-color), 0.8) 100%)}.scroll-button{display:flex;align-items:center;top:0;bottom:0}.scroll-button.left{transform:translate3d(-4rem, 0, 0);left:0.25rem}.scroll-button.right{transform:translate3d(4rem, 0, 0);right:0.25rem}.scroll-button:hover{transform:translate3d(0, 0, 0)}.scroll-button button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;display:flex;align-items:center;justify-content:center;width:1.25rem;height:calc(100% - 0.25rem * 2);border-radius:0.25rem}.scroll-button button:not(:disabled){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}.scroll-button button:not(:disabled):hover,.scroll-button button:not(:disabled):focus,.scroll-button button:not(:disabled):focus-visible{will-change:color, background-color, box-shadow, transform}.scroll-button button:not(:disabled):hover,.scroll-button button:not(:disabled):focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.scroll-button button:not(:disabled):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.scroll-button button:not(:disabled):hover,.scroll-button button:not(:disabled):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.scroll-button limel-icon{width:1rem}.mdc-tab-scroller{position:relative;overflow:hidden}.mdc-tab-scroller.can-scroll-left .scroll-fade.left,.mdc-tab-scroller.can-scroll-left .scroll-button.left,.mdc-tab-scroller.can-scroll-right .scroll-fade.right,.mdc-tab-scroller.can-scroll-right .scroll-button.right{transform:translate3d(0, 0, 0)}.mdc-tab-scroller.can-scroll-left:not(.can-scroll-right) .scroll-button.right,.mdc-tab-scroller.can-scroll-right:not(.can-scroll-left) .scroll-button.left{opacity:0.5;transition-delay:0.5s}.lime-hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.mdc-tab-scroller__scroll-content{padding:0.25rem var(--limel-tab-active-outer-edge-curve-size) 0 var(--limel-tab-active-outer-edge-curve-size);background-color:rgb(var(--limel-tab-background-color))}.mdc-tab-bar{width:100%}.mdc-tab{height:48px}.mdc-tab--stacked{height:72px}.mdc-tab-scroller.mdc-tab-scroller--animating .mdc-tab-scroller__scroll-content{transition:250ms transform cubic-bezier(0.4, 0, 0.2, 1)}.mdc-tab-scroller{overflow-y:hidden}.mdc-tab-scroller__test{position:absolute;top:-9999px;width:100px;height:100px;overflow-x:scroll}.mdc-tab-scroller__scroll-area{-webkit-overflow-scrolling:touch;display:flex;overflow-x:hidden}.mdc-tab-scroller__scroll-area::-webkit-scrollbar,.mdc-tab-scroller__test::-webkit-scrollbar{display:none}.mdc-tab-scroller__scroll-area--scroll{overflow-x:scroll}.mdc-tab-scroller__scroll-content{position:relative;display:flex;flex:1 0 auto;transform:none;will-change:transform}.mdc-tab-scroller--align-start .mdc-tab-scroller__scroll-content{justify-content:flex-start}.mdc-tab-scroller--align-end .mdc-tab-scroller__scroll-content{justify-content:flex-end}.mdc-tab-scroller--align-center .mdc-tab-scroller__scroll-content{justify-content:center}.mdc-tab-scroller--animating .mdc-tab-scroller__scroll-area{-webkit-overflow-scrolling:auto}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-tab-indicator .mdc-tab-indicator__content--icon{color:#018786;color:var(--mdc-theme-secondary, #018786)}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-top-width:2px}.mdc-tab-indicator .mdc-tab-indicator__content--icon{height:34px;font-size:34px}.mdc-tab-indicator{display:flex;position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;pointer-events:none;z-index:1}.mdc-tab-indicator__content{transform-origin:left;opacity:0}.mdc-tab-indicator__content--underline{align-self:flex-end;box-sizing:border-box;width:100%;border-top-style:solid}.mdc-tab-indicator__content--icon{align-self:center;margin:0 auto}.mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:1}.mdc-tab-indicator .mdc-tab-indicator__content{transition:250ms transform cubic-bezier(0.4, 0, 0.2, 1)}.mdc-tab-indicator--no-transition .mdc-tab-indicator__content{transition:none}.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition:150ms opacity linear}.mdc-tab-indicator--active.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition-delay:100ms}.mdc-tab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-tab .mdc-tab__text-label{color:rgba(0, 0, 0, 0.6)}.mdc-tab .mdc-tab__icon{color:rgba(0, 0, 0, 0.54);fill:currentColor}.mdc-tab{position:relative}.mdc-tab__content{position:relative}.mdc-tab__icon{width:24px;height:24px;font-size:24px}.mdc-tab--active .mdc-tab__text-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-tab--active .mdc-tab__icon{color:#6200ee;color:var(--mdc-theme-primary, #6200ee);fill:currentColor}.mdc-tab{background:none}.mdc-tab{min-width:90px;padding-right:24px;padding-left:24px;display:flex;flex:1 0 auto;justify-content:center;box-sizing:border-box;margin:0;padding-top:0;padding-bottom:0;border:none;outline:none;text-align:center;white-space:nowrap;cursor:pointer;-webkit-appearance:none;z-index:1}.mdc-tab::-moz-focus-inner{padding:0;border:0}.mdc-tab--min-width{flex:0 1 auto}.mdc-tab__content{display:flex;align-items:center;justify-content:center;height:inherit;pointer-events:none}.mdc-tab__text-label{transition:150ms color linear;display:inline-block;line-height:1;z-index:2}.mdc-tab__icon{transition:150ms color linear;z-index:2}.mdc-tab--stacked .mdc-tab__content{flex-direction:column;align-items:center;justify-content:center}.mdc-tab--stacked .mdc-tab__text-label{padding-top:6px;padding-bottom:4px}.mdc-tab--active .mdc-tab__text-label,.mdc-tab--active .mdc-tab__icon{transition-delay:100ms}.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label{padding-left:8px;padding-right:0}[dir=rtl] .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label,.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label[dir=rtl]{padding-left:0;padding-right:8px;}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-tab{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-tab .mdc-tab__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-tab .mdc-tab__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-tab.mdc-ripple-upgraded--unbounded .mdc-tab__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-tab.mdc-ripple-upgraded--foreground-activation .mdc-tab__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-tab.mdc-ripple-upgraded--foreground-deactivation .mdc-tab__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-tab:hover .mdc-tab__ripple::before,.mdc-tab.mdc-ripple-surface--hover .mdc-tab__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__ripple::before,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-tab:not(.mdc-ripple-upgraded) .mdc-tab__ripple::after{transition:opacity 150ms linear}.mdc-tab:not(.mdc-ripple-upgraded):active .mdc-tab__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab__ripple{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;will-change:transform, opacity}:host(limel-tab-bar){--limel-tab-background-color:var(--contrast-300);--limel-tab-border-radius:0.625rem;--limel-active-tab-background-color:var( --tab-panel-background-color, rgb(var(--contrast-100)) );--limel-tab-active-outer-edge-curve-size:0.75rem;--limel-tab-separator-width:0.125rem;--limel-tab-separator-background-color:rgb(var(--contrast-600));isolation:isolate;display:block;position:relative}:host(.has-tabs-with-equal-width) .mdc-tab{flex:1 0 auto}.mdc-tab{font-family:inherit;font-weight:400;letter-spacing:normal;font-size:var(--limel-theme-default-font-size);text-transform:none}.mdc-tab-indicator .mdc-tab-indicator__content{border:none}.mdc-tab__ripple{box-sizing:border-box;border-radius:var(--limel-tab-border-radius);border-style:solid;border-color:transparent;border-width:0.25rem;opacity:0.7}.mdc-tab__ripple:before,.mdc-tab__ripple:after{transition:background-color 0.5s ease}.mdc-tab{border-radius:0;padding-right:1rem;padding-left:1rem;min-width:2.5rem;background-color:transparent;flex:0 0 auto;height:2.5rem}.mdc-tab:not(.mdc-tab--active):after{content:"";display:block;background-color:var(--limel-tab-separator-background-color);width:var(--limel-tab-separator-width);height:1rem;margin:auto;position:absolute;top:0;bottom:0;border-radius:1rem;right:calc(-1 * var(--limel-tab-separator-width))}.mdc-tab:not(.mdc-tab--active):last-of-type:after{display:none}.mdc-tab .mdc-tab__icon{color:rgb(var(--contrast-800));margin-left:-0.25rem}.mdc-tab limel-badge{margin-right:-0.25rem;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.mdc-tab--active{border-radius:var(--limel-tab-border-radius) var(--limel-tab-border-radius) 0 0;background-color:var(--limel-active-tab-background-color);z-index:2}.mdc-tab--active:before,.mdc-tab--active:after{content:"";display:block;width:var(--limel-tab-active-outer-edge-curve-size);height:var(--limel-tab-active-outer-edge-curve-size);position:absolute;bottom:0;background-color:var(--limel-active-tab-background-color);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E")}.mdc-tab--active:before{left:calc(-1 * var(--limel-tab-active-outer-edge-curve-size));transform:rotateY(180deg)}.mdc-tab--active:after{right:calc(-1 * var(--limel-tab-active-outer-edge-curve-size))}.mdc-tab--active .mdc-ripple-upgraded--background-focused:before{background-color:transparent;transition:background-color 1s ease}.mdc-tab--active .mdc-tab__icon{color:var(--mdc-theme-primary)}.mdc-tab__content{gap:0.375rem}.mdc-tab .mdc-tab__text-label{transition:color 0.2s ease;padding-left:0 !important;color:var(--limel-theme-on-surface-color)}.mdc-tab:hover .mdc-tab__text-label{color:var(--limel-theme-text-primary-on-background-color)}.mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--lime-primary-color, var(--limel-theme-primary-color))}`;
262
+ const tabBarCss = () => `.mdc-tab-bar{width:100%}.mdc-tab{height:48px}.mdc-tab--stacked{height:72px}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-tab-indicator .mdc-tab-indicator__content--icon{color:#018786;color:var(--mdc-theme-secondary, #018786)}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-top-width:2px}.mdc-tab-indicator .mdc-tab-indicator__content--icon{height:34px;font-size:34px}.mdc-tab-indicator{display:flex;position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;pointer-events:none;z-index:1}.mdc-tab-indicator__content{transform-origin:left;opacity:0}.mdc-tab-indicator__content--underline{align-self:flex-end;box-sizing:border-box;width:100%;border-top-style:solid}.mdc-tab-indicator__content--icon{align-self:center;margin:0 auto}.mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:1}.mdc-tab-indicator .mdc-tab-indicator__content{transition:250ms transform cubic-bezier(0.4, 0, 0.2, 1)}.mdc-tab-indicator--no-transition .mdc-tab-indicator__content{transition:none}.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition:150ms opacity linear}.mdc-tab-indicator--active.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition-delay:100ms}.mdc-tab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-tab .mdc-tab__text-label{color:rgba(0, 0, 0, 0.6)}.mdc-tab .mdc-tab__icon{color:rgba(0, 0, 0, 0.54);fill:currentColor}.mdc-tab{position:relative}.mdc-tab__content{position:relative}.mdc-tab__icon{width:24px;height:24px;font-size:24px}.mdc-tab--active .mdc-tab__text-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-tab--active .mdc-tab__icon{color:#6200ee;color:var(--mdc-theme-primary, #6200ee);fill:currentColor}.mdc-tab{background:none}.mdc-tab{min-width:90px;padding-right:24px;padding-left:24px;display:flex;flex:1 0 auto;justify-content:center;box-sizing:border-box;margin:0;padding-top:0;padding-bottom:0;border:none;outline:none;text-align:center;white-space:nowrap;cursor:pointer;-webkit-appearance:none;z-index:1}.mdc-tab::-moz-focus-inner{padding:0;border:0}.mdc-tab--min-width{flex:0 1 auto}.mdc-tab__content{display:flex;align-items:center;justify-content:center;height:inherit;pointer-events:none}.mdc-tab__text-label{transition:150ms color linear;display:inline-block;line-height:1;z-index:2}.mdc-tab__icon{transition:150ms color linear;z-index:2}.mdc-tab--stacked .mdc-tab__content{flex-direction:column;align-items:center;justify-content:center}.mdc-tab--stacked .mdc-tab__text-label{padding-top:6px;padding-bottom:4px}.mdc-tab--active .mdc-tab__text-label,.mdc-tab--active .mdc-tab__icon{transition-delay:100ms}.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label{padding-left:8px;padding-right:0}[dir=rtl] .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label,.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label[dir=rtl]{padding-left:0;padding-right:8px;}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-tab{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-tab .mdc-tab__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-tab .mdc-tab__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-tab.mdc-ripple-upgraded--unbounded .mdc-tab__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-tab.mdc-ripple-upgraded--foreground-activation .mdc-tab__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-tab.mdc-ripple-upgraded--foreground-deactivation .mdc-tab__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-tab:hover .mdc-tab__ripple::before,.mdc-tab.mdc-ripple-surface--hover .mdc-tab__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__ripple::before,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-tab:not(.mdc-ripple-upgraded) .mdc-tab__ripple::after{transition:opacity 150ms linear}.mdc-tab:not(.mdc-ripple-upgraded):active .mdc-tab__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab__ripple{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;will-change:transform, opacity}:host(limel-tab-bar){--limel-tab-background-color:var(--contrast-300);--limel-tab-border-radius:0.625rem;--limel-active-tab-background-color:var( --tab-panel-background-color, rgb(var(--contrast-100)) );--limel-tab-active-outer-edge-curve-size:0.75rem;--limel-tab-separator-width:0.125rem;--limel-tab-separator-background-color:rgb(var(--contrast-600));isolation:isolate;display:block;position:relative}limel-scroller{--limel-scroller-fade-color:var(--limel-tab-background-color);--limel-scroller-content-padding:0.25rem var(--limel-tab-active-outer-edge-curve-size) 0;background-color:rgb(var(--limel-tab-background-color))}:host(.has-tabs-with-equal-width) .mdc-tab{flex:1 0 auto}.mdc-tab{font-family:inherit;font-weight:400;letter-spacing:normal;font-size:var(--limel-theme-default-font-size);text-transform:none}.mdc-tab-indicator .mdc-tab-indicator__content{border:none}.mdc-tab__ripple{box-sizing:border-box;border-radius:var(--limel-tab-border-radius);border-style:solid;border-color:transparent;border-width:0.25rem;opacity:0.7}.mdc-tab__ripple:before,.mdc-tab__ripple:after{transition:background-color 0.5s ease}.mdc-tab{border-radius:0;padding-right:1rem;padding-left:1rem;min-width:2.5rem;background-color:transparent;flex:0 0 auto;height:2.5rem}.mdc-tab:not(.mdc-tab--active):after{content:"";display:block;background-color:var(--limel-tab-separator-background-color);width:var(--limel-tab-separator-width);height:1rem;margin:auto;position:absolute;top:0;bottom:0;border-radius:1rem;right:calc(-1 * var(--limel-tab-separator-width))}.mdc-tab:not(.mdc-tab--active):last-of-type:after{display:none}.mdc-tab .mdc-tab__icon{color:rgb(var(--contrast-800));margin-left:-0.25rem}.mdc-tab limel-badge{margin-right:-0.25rem;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.mdc-tab--active{border-radius:var(--limel-tab-border-radius) var(--limel-tab-border-radius) 0 0;background-color:var(--limel-active-tab-background-color);z-index:2}.mdc-tab--active:before,.mdc-tab--active:after{content:"";display:block;width:var(--limel-tab-active-outer-edge-curve-size);height:var(--limel-tab-active-outer-edge-curve-size);position:absolute;bottom:0;background-color:var(--limel-active-tab-background-color);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E")}.mdc-tab--active:before{left:calc(-1 * var(--limel-tab-active-outer-edge-curve-size));transform:rotateY(180deg)}.mdc-tab--active:after{right:calc(-1 * var(--limel-tab-active-outer-edge-curve-size))}.mdc-tab--active .mdc-ripple-upgraded--background-focused:before{background-color:transparent;transition:background-color 1s ease}.mdc-tab--active .mdc-tab__icon{color:var(--mdc-theme-primary)}.mdc-tab__content{gap:0.375rem}.mdc-tab .mdc-tab__text-label{transition:color 0.2s ease;padding-left:0 !important;color:var(--limel-theme-on-surface-color)}.mdc-tab:hover .mdc-tab__text-label{color:var(--limel-theme-text-primary-on-background-color)}.mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--lime-primary-color, var(--limel-theme-primary-color))}`;
2047
263
 
2048
- const { TAB_ACTIVATED_EVENT } = strings$1;
2049
- const SCROLL_DISTANCE_ON_CLICK_PX = 150;
2050
- const HIDE_SCROLL_BUTTONS_WHEN_SCROLLED_LESS_THAN_PX = 40;
2051
- const TOTAL_WIDTH_PERCENTAGE = 100;
2052
- const OVERLAP_PERCENTAGE = 20;
264
+ const NAVIGATION = {
265
+ orientation: 'horizontal',
266
+ wrap: true,
267
+ };
2053
268
  const TabBar = class {
2054
269
  constructor(hostRef) {
2055
270
  registerInstance(this, hostRef);
@@ -2058,38 +273,34 @@ const TabBar = class {
2058
273
  * List of tabs to display
2059
274
  */
2060
275
  this.tabs = [];
2061
- this.canScrollLeft = false;
2062
- this.canScrollRight = false;
2063
- this.setupMdc = false;
2064
- this.handleTabActivated = this.handleTabActivated.bind(this);
2065
- this.handleScroll = this.handleScroll.bind(this);
2066
- this.handleLeftScrollClick = this.handleLeftScrollClick.bind(this);
2067
- this.handleRightScrollClick = this.handleRightScrollClick.bind(this);
2068
- this.renderTab = this.renderTab.bind(this);
2069
- }
2070
- connectedCallback() {
2071
- this.setup();
276
+ this.ripples = new Map();
277
+ this.hasLoaded = false;
278
+ this.handleKeyDown = this.handleKeyDown.bind(this);
279
+ }
280
+ async connectedCallback() {
281
+ // Connecting after the first render means that the bar was moved, which
282
+ // resets how far it is scrolled.
283
+ if (!this.hasLoaded) {
284
+ return;
285
+ }
286
+ this.updateRipples();
287
+ this.revealedTabId = undefined;
288
+ await this.revealActiveTab('auto');
2072
289
  }
2073
290
  componentDidLoad() {
2074
- this.setup();
291
+ this.hasLoaded = true;
2075
292
  this.triggerIconColorWarning();
2076
293
  }
2077
- componentDidUpdate() {
2078
- if (!this.setupMdc) {
2079
- return;
2080
- }
2081
- this.setup();
2082
- this.setupMdc = false;
294
+ async componentDidRender() {
295
+ this.updateRipples();
296
+ await this.revealActiveTab(this.hasLoaded ? undefined : 'auto');
2083
297
  }
2084
298
  disconnectedCallback() {
2085
- this.tearDown();
299
+ this.destroyRipples();
2086
300
  }
2087
301
  render() {
2088
- return (h("div", { key: 'b0a62a521861357770e12bc6183b9590c49760e0', class: "mdc-tab-bar", role: "tablist" }, h("div", { key: '97750d5ded531aee2fca5cd1f129fee4194b8f09', class: {
2089
- 'mdc-tab-scroller': true,
2090
- 'can-scroll-left': this.canScrollLeft,
2091
- 'can-scroll-right': this.canScrollRight,
2092
- } }, h("div", { key: '6547764cdcfc4f2f60e510863ede4d58d48b1b0e', class: "mdc-tab-scroller__scroll-area lime-hide-scrollbars" }, h("div", { key: 'b95453f5a1fe8b4aae7ebad439cfb795198623a8', class: "mdc-tab-scroller__scroll-content" }, this.tabs.map(this.renderTab))), h("div", { key: 'a4703fa681f371d69ab7a6994aa3457c803563bf', class: "scroll-fade left" }), h("div", { key: '6599c7035550249f81b5488deda63900363be953', class: "scroll-button left" }, h("button", { key: '09a0a7f41a8f0dfe458af7bb719aef0fb0e1b9d7', type: "button", tabindex: "-1", "aria-hidden": "true", disabled: !this.canScrollLeft, onClick: this.handleLeftScrollClick }, h("limel-icon", { key: 'dd5f4cf8562fd74148778d5414f98d4c1c949bd0', name: "angle_left" }))), h("div", { key: 'b380cf4e3679d35270453b6a8671e7de8d9a92a7', class: "scroll-fade right" }), h("div", { key: '3589c3bec4d29eee61da6bc0b293201412bd343f', class: "scroll-button right" }, h("button", { key: '8af680e4abefcf6920a602c269f9a937270d70f2', type: "button", tabindex: "-1", "aria-hidden": "true", disabled: !this.canScrollRight, onClick: this.handleRightScrollClick }, h("limel-icon", { key: 'be2dcc0f1ba494cce96eab05450ce8c9619981e0', name: "angle_right" }))))));
302
+ const tabStop = findTabStop(this.tabs, this.tabs.findIndex((tab) => tab.active), NAVIGATION);
303
+ return (h("div", { key: '7ab809d50e3605613f027a1782d54511e734de93', class: "mdc-tab-bar", role: "tablist", onKeyDown: this.handleKeyDown }, h("limel-scroller", { key: 'd6ac2c90e6da77a239292ac0e90288c3e70b62f8' }, this.tabs.map((tab, index) => this.renderTab(tab, index, index === tabStop)))));
2093
304
  }
2094
305
  tabsChanged(newTabs = [], oldTabs = []) {
2095
306
  const newIds = newTabs.map((tab) => tab.id);
@@ -2097,103 +308,91 @@ const TabBar = class {
2097
308
  if (isEqual(newIds, oldIds)) {
2098
309
  return;
2099
310
  }
2100
- this.setupMdc = true;
2101
- this.tearDown();
311
+ this.revealedTabId = undefined;
2102
312
  }
2103
- handleWindowResize() {
2104
- if (!this.scrollArea) {
2105
- return;
313
+ getTabElements() {
314
+ return [
315
+ ...this.host.shadowRoot.querySelectorAll('button[role="tab"]'),
316
+ ];
317
+ }
318
+ /**
319
+ * Gives every tab MDC's ripple, which is the feedback when a tab is
320
+ * pressed. Tabs that are gone lose theirs.
321
+ */
322
+ updateRipples() {
323
+ const tabs = this.getTabElements();
324
+ for (const [tab, ripple] of this.ripples) {
325
+ if (tabs.includes(tab)) {
326
+ continue;
327
+ }
328
+ ripple.destroy();
329
+ this.ripples.delete(tab);
330
+ }
331
+ for (const tab of tabs) {
332
+ if (!this.ripples.has(tab)) {
333
+ this.ripples.set(tab, new MDCRipple(tab));
334
+ }
2106
335
  }
2107
- this.handleScroll();
2108
336
  }
2109
- setup() {
2110
- const element = this.host.shadowRoot.querySelector('.mdc-tab-bar');
2111
- if (!element) {
2112
- return;
337
+ destroyRipples() {
338
+ for (const ripple of this.ripples.values()) {
339
+ ripple.destroy();
2113
340
  }
2114
- this.mdcTabBar = new MDCTabBar(element);
2115
- this.mdcTabBar.focusOnActivate = true;
2116
- this.mdcTabBar.useAutomaticActivation = true;
2117
- this.scrollArea = element.querySelector('.mdc-tab-scroller__scroll-area');
2118
- this.scrollContent = element.querySelector('.mdc-tab-scroller__scroll-content');
2119
- this.setupListeners();
2120
- // Use timeout to avoid Stencil warning about re-renders. /Ads
2121
- setTimeout(this.handleScroll, 0);
341
+ this.ripples.clear();
2122
342
  }
2123
- tearDown() {
2124
- if (this.scrollArea) {
2125
- this.scrollArea.removeEventListener('scroll', this.handleScroll);
343
+ /**
344
+ * A tab that is activated by the user has focus, and the scroller reveals
345
+ * what has focus. This is for a tab that becomes active without it.
346
+ *
347
+ * @param behavior - `auto` to jump to the tab. Leave it out to let the
348
+ * scroller glide there.
349
+ */
350
+ async revealActiveTab(behavior) {
351
+ const index = this.tabs.findIndex((tab) => tab.active);
352
+ if (index === -1) {
353
+ this.revealedTabId = undefined;
354
+ return;
355
+ }
356
+ if (this.tabs[index].id === this.revealedTabId) {
357
+ return;
2126
358
  }
2127
- if (this.mdcTabBar) {
2128
- this.mdcTabBar.unlisten(TAB_ACTIVATED_EVENT, this.handleTabActivated);
2129
- this.mdcTabBar.destroy();
359
+ this.revealedTabId = this.tabs[index].id;
360
+ const element = this.getTabElements()[index];
361
+ const scroller = this.host.shadowRoot.querySelector('limel-scroller');
362
+ if (!element || !scroller || element.matches(':focus')) {
363
+ return;
2130
364
  }
365
+ await scroller.componentOnReady();
366
+ await scroller.reveal(element, behavior);
2131
367
  }
2132
- setupListeners() {
2133
- this.mdcTabBar.listen(TAB_ACTIVATED_EVENT, this.handleTabActivated);
2134
- this.scrollArea.addEventListener('scroll', this.handleScroll, {
2135
- passive: true,
2136
- });
368
+ handleKeyDown(event) {
369
+ if (!isNavigationKey(event, NAVIGATION)) {
370
+ return;
371
+ }
372
+ event.preventDefault();
373
+ const current = this.getTabElements().indexOf(event.target);
374
+ this.activateTab(findNavigationTarget(this.tabs, event.key, current, NAVIGATION));
2137
375
  }
2138
- handleTabActivated(event) {
2139
- const index = event.detail.index;
376
+ activateTab(index) {
377
+ if (index === NO_NAVIGATION_TARGET) {
378
+ return;
379
+ }
380
+ // Not every browser focuses a button that is clicked, and a key can
381
+ // lead to the selected tab from another tab that has focus.
382
+ this.getTabElements()[index].focus();
383
+ if (index === this.tabs.findIndex((tab) => tab.active)) {
384
+ return;
385
+ }
2140
386
  const newTabs = setActiveTab(this.tabs, index);
2141
- difference(newTabs, this.tabs)
2142
- .sort(this.sortByInactive)
2143
- // eslint-disable-next-line unicorn/no-array-for-each
2144
- .forEach((tab) => {
387
+ const changedTabs = difference(newTabs, this.tabs).sort(this.sortByInactive);
388
+ for (const tab of changedTabs) {
2145
389
  this.changeTab.emit(tab);
2146
- });
390
+ }
2147
391
  this.tabs = newTabs;
2148
392
  }
2149
393
  sortByInactive(a, b) {
2150
394
  return Number(a.active) - Number(b.active);
2151
395
  }
2152
- handleScroll() {
2153
- const scrollLeft = this.scrollArea.scrollLeft;
2154
- const scrollRight = Math.floor(this.scrollContent.getBoundingClientRect().width -
2155
- this.scrollArea.getBoundingClientRect().width -
2156
- scrollLeft);
2157
- if (scrollLeft > HIDE_SCROLL_BUTTONS_WHEN_SCROLLED_LESS_THAN_PX) {
2158
- this.canScrollLeft = true;
2159
- }
2160
- else {
2161
- this.canScrollLeft = false;
2162
- }
2163
- if (scrollRight > HIDE_SCROLL_BUTTONS_WHEN_SCROLLED_LESS_THAN_PX) {
2164
- this.canScrollRight = true;
2165
- }
2166
- else {
2167
- this.canScrollRight = false;
2168
- }
2169
- }
2170
- handleLeftScrollClick() {
2171
- const scrollDistance = this.getScrollDistance();
2172
- this.scrollArea.scroll({
2173
- left: this.scrollArea.scrollLeft - scrollDistance,
2174
- behavior: 'smooth',
2175
- });
2176
- }
2177
- handleRightScrollClick() {
2178
- const scrollDistance = this.getScrollDistance();
2179
- this.scrollArea.scroll({
2180
- left: this.scrollArea.scrollLeft + scrollDistance,
2181
- behavior: 'smooth',
2182
- });
2183
- }
2184
- /**
2185
- * Calculates how far to scroll when navigation buttons are clicked.
2186
- * Returns the visible width minus an overlap percentage to maintain context.
2187
- * Falls back to the constant value if something goes wrong.
2188
- */
2189
- getScrollDistance() {
2190
- if (!this.scrollArea) {
2191
- return SCROLL_DISTANCE_ON_CLICK_PX;
2192
- }
2193
- const containerWidth = this.scrollArea.getBoundingClientRect().width;
2194
- const scrollDistance = containerWidth * (1 - OVERLAP_PERCENTAGE / TOTAL_WIDTH_PERCENTAGE);
2195
- return Math.max(scrollDistance, SCROLL_DISTANCE_ON_CLICK_PX);
2196
- }
2197
396
  renderIcon(tab) {
2198
397
  if (!tab.icon) {
2199
398
  return;
@@ -2206,11 +405,11 @@ const TabBar = class {
2206
405
  }
2207
406
  return (h("limel-icon", { class: "mdc-tab__icon", name: name, style: style, size: "small", "aria-hidden": "true" }));
2208
407
  }
2209
- renderTab(tab) {
408
+ renderTab(tab, index, isTabStop) {
2210
409
  return (h("button", { class: {
2211
410
  'mdc-tab': true,
2212
411
  'mdc-tab--active': !!tab.active,
2213
- }, role: "tab", "aria-selected": tab.active ? 'true' : 'false', tabindex: tab.active ? 0 : -1 }, h("span", { class: "mdc-tab__content" }, this.renderIcon(tab), h("span", { class: "mdc-tab__text-label" }, tab.text), tab.badge ? h("limel-badge", { label: tab.badge }) : ''), h("span", { class: {
412
+ }, role: "tab", "aria-selected": tab.active ? 'true' : 'false', tabindex: isTabStop ? 0 : -1, onClick: () => this.activateTab(index) }, h("span", { class: "mdc-tab__content" }, this.renderIcon(tab), h("span", { class: "mdc-tab__text-label" }, tab.text), tab.badge ? h("limel-badge", { label: tab.badge }) : ''), h("span", { class: {
2214
413
  'mdc-tab-indicator': true,
2215
414
  'mdc-tab-indicator--active': !!tab.active,
2216
415
  } }, h("span", { class: "mdc-tab-indicator__content mdc-tab-indicator__content--underline" })), h("span", { class: "mdc-tab__ripple" })));