@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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/{adapt-color-contrast-Beo1IEl_.js → adapt-color-contrast-h6iwOfZd.js} +1 -1
- package/dist/cjs/{checkbox.template-BPk8WkQF.js → checkbox.template-CoNVC4Nf.js} +2 -2
- package/dist/cjs/{component-CFk7Dfoi.js → component-Cz24PdGy.js} +3 -3
- package/dist/cjs/{component-BrNWuGdj.js → component-DNiVfYHV.js} +1 -1
- package/dist/cjs/{component-y8swlNNR.js → component-GW2n79GH.js} +1 -1
- package/dist/cjs/{component-UyqdiWGc.js → component-xiw46M1b.js} +1 -1
- package/dist/cjs/{files-DI4jItxi.js → files-DpGigQ8k.js} +1 -1
- package/dist/cjs/{format-bytes-CpUKKU86.js → format-bytes-WTHVI718.js} +1 -4
- package/dist/cjs/{hotkeys-BtR8uxvl.js → hotkeys-D761KWnZ.js} +1 -0
- package/dist/cjs/{image-resize-CG2fitJT.js → image-resize-JlRLB97I.js} +1 -0
- package/dist/cjs/{image.template-DY7qwbuy.js → image.template-DlF-f23b.js} +1 -1
- package/dist/cjs/{index--B6-r0uo.js → index-BlsqxTB1.js} +1 -7
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{keycodes-k-EdzcMX.js → keycodes-BQ_AERli.js} +4 -0
- package/dist/cjs/{language-CaqPKPyW.js → language-v-MMS6ym.js} +1 -1
- package/dist/cjs/lime-elements.cjs.js +2 -2
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +20 -18
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +5 -5
- package/dist/cjs/limel-badge.cjs.entry.js +3 -3
- package/dist/cjs/limel-banner.cjs.entry.js +2 -2
- package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +86 -86
- package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
- package/dist/cjs/limel-button.cjs.entry.js +4 -4
- package/dist/cjs/limel-callout.cjs.entry.js +6 -6
- package/dist/cjs/limel-card.cjs.entry.js +8 -7
- package/dist/cjs/limel-chart.cjs.entry.js +5 -5
- package/dist/cjs/limel-checkbox.cjs.entry.js +12 -10
- package/dist/cjs/limel-chip-set.cjs.entry.js +35 -44
- package/dist/cjs/limel-chip_2.cjs.entry.js +10 -10
- package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-diff.cjs.entry.js +25 -28
- package/dist/cjs/limel-code-editor.cjs.entry.js +17 -12
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +8 -8
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
- package/dist/cjs/limel-color-picker.cjs.entry.js +6 -5
- package/dist/cjs/limel-config.cjs.entry.js +3 -3
- package/dist/cjs/limel-date-picker.cjs.entry.js +12 -15
- package/dist/cjs/limel-dialog.cjs.entry.js +8 -11
- package/dist/cjs/limel-dock-button.cjs.entry.js +6 -11
- package/dist/cjs/limel-dock.cjs.entry.js +3 -3
- package/dist/cjs/limel-drag-handle.cjs.entry.js +6 -6
- package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +11 -17
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +11 -12
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1098 -1146
- package/dist/cjs/limel-file.cjs.entry.js +17 -16
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +100 -94
- package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +65 -50
- package/dist/cjs/limel-grid.cjs.entry.js +2 -2
- package/dist/cjs/limel-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-help-content.cjs.entry.js +2 -2
- package/dist/cjs/limel-help.cjs.entry.js +3 -3
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +14 -16
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +23 -23
- package/dist/cjs/limel-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/limel-icon.cjs.entry.js +15 -13
- package/dist/cjs/limel-info-tile.cjs.entry.js +10 -10
- package/dist/cjs/limel-list-item.cjs.entry.js +10 -10
- package/dist/cjs/limel-markdown.cjs.entry.js +25 -22
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +6 -5
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +3 -3
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +18 -16
- package/dist/cjs/limel-pagination.cjs.entry.js +10 -9
- package/dist/cjs/limel-picker.cjs.entry.js +32 -30
- package/dist/cjs/limel-popover_2.cjs.entry.js +26 -22
- package/dist/cjs/limel-profile-picture.cjs.entry.js +12 -11
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +11 -10
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +475 -407
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-scroller.cjs.entry.js +180 -0
- package/dist/cjs/limel-select.cjs.entry.js +20 -20
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +18 -27
- package/dist/cjs/limel-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +3 -3
- package/dist/cjs/limel-tab-bar.cjs.entry.js +235 -2036
- package/dist/cjs/limel-tab-panel.cjs.entry.js +12 -9
- package/dist/cjs/limel-table.cjs.entry.js +527 -106
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +16 -15
- package/dist/cjs/limel-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{make-enter-clickable-NuTMC9MU.js → make-enter-clickable-BZHEWIJD.js} +19 -12
- package/dist/cjs/{markdown-exporter-9p7d3Q76.js → markdown-exporter-C-UW43FF.js} +1 -1
- package/dist/cjs/{markdown-parser-Cgv5Y9Z4.js → markdown-parser-ssDij8_l.js} +24 -22
- package/dist/cjs/{moment-CqRdiK10.js → moment-Cfsz2WF1.js} +1062 -833
- package/dist/cjs/{ponyfill-BgIFyUG5.js → ponyfill-CHp7Zocr.js} +0 -1
- package/dist/cjs/{random-string-BTzDB2ee.js → random-string-CFCtFh5l.js} +1 -0
- package/dist/cjs/{render-list-component-5ZKWpCnM.js → render-list-component-BtAliHQp.js} +3 -5
- package/dist/cjs/{sv-BSR4W58y.js → sv-Co78RX70.js} +31 -3
- package/dist/cjs/{translations-DFFpR6AZ.js → translations-CNTWud2a.js} +5 -8
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +8 -7
- package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +6 -5
- package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +2 -2
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button-group/button-group.js +1 -1
- package/dist/collection/components/callout/callout.js +1 -1
- package/dist/collection/components/card/card.js +6 -5
- package/dist/collection/components/checkbox/checkbox.js +9 -7
- package/dist/collection/components/checkbox/checkbox.template.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip-set/chip-set-input-helpers.js +18 -21
- package/dist/collection/components/chip-set/chip-set.js +7 -13
- package/dist/collection/components/circular-progress/circular-progress.js +1 -1
- package/dist/collection/components/code-diff/code-diff.js +19 -22
- package/dist/collection/components/code-diff/diff-engine.js +2 -2
- package/dist/collection/components/code-editor/code-editor.js +8 -3
- package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
- package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
- package/dist/collection/components/color-picker/color-picker.js +5 -4
- package/dist/collection/components/config/config.js +2 -2
- package/dist/collection/components/date-picker/date-picker.js +3 -6
- package/dist/collection/components/date-picker/flatpickr-adapter/deferred-destroy.js +4 -3
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
- package/dist/collection/components/date-picker/pickers/month-picker.js +40 -36
- package/dist/collection/components/date-picker/pickers/quarter-picker.js +35 -30
- package/dist/collection/components/date-picker/pickers/year-picker.js +16 -20
- package/dist/collection/components/dialog/dialog.js +4 -7
- package/dist/collection/components/dock/dock-button/dock-button.js +4 -9
- package/dist/collection/components/dock/dock.js +2 -2
- package/dist/collection/components/drag-handle/drag-handle.js +1 -1
- package/dist/collection/components/email-viewer/email-loader.js +14 -10
- package/dist/collection/components/email-viewer/email-viewer.js +1 -1
- package/dist/collection/components/email-viewer/sanitize-email-html.js +1 -4
- package/dist/collection/components/email-viewer/split-email-address-list.js +4 -10
- package/dist/collection/components/file/file.js +11 -10
- package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
- package/dist/collection/components/file-input/file-input.js +7 -8
- package/dist/collection/components/file-viewer/file-viewer.js +12 -9
- package/dist/collection/components/flex-container/flex-container.js +1 -1
- package/dist/collection/components/form/fields/schema-field.js +1 -1
- package/dist/collection/components/form/form.js +2 -5
- package/dist/collection/components/form/form.test-schemas.js +8 -10
- package/dist/collection/components/form/templates/array-field.js +7 -9
- package/dist/collection/components/form/templates/common.js +19 -19
- package/dist/collection/components/form/templates/object-field.js +1 -1
- package/dist/collection/components/form/validation-display.js +2 -2
- package/dist/collection/components/form/validators/format.js +1 -0
- package/dist/collection/components/form/widgets/code-editor.js +6 -9
- package/dist/collection/components/form/widgets/date-picker.js +1 -3
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/help/help-content.js +1 -1
- package/dist/collection/components/help/help.js +2 -2
- package/dist/collection/components/helper-line/helper-line.js +3 -3
- package/dist/collection/components/hotkey/hotkey.js +1 -1
- package/dist/collection/components/icon/icon.js +11 -9
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +9 -9
- package/dist/collection/components/input-field/input-field.js +11 -11
- package/dist/collection/components/list/list-renderer.js +5 -7
- package/dist/collection/components/list/list.js +2 -2
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
- package/dist/collection/components/markdown/hydrate-custom-elements.js +6 -5
- package/dist/collection/components/markdown/image-intersection-observer.js +9 -8
- package/dist/collection/components/markdown/image-markdown-plugin.js +9 -7
- package/dist/collection/components/markdown/link-markdown-plugin.js +11 -10
- package/dist/collection/components/markdown/markdown.js +6 -5
- package/dist/collection/components/markdown/remove-empty-paragraphs-plugin.js +4 -5
- package/dist/collection/components/masonry-layout/masonry-layout.js +5 -4
- package/dist/collection/components/menu/menu.js +48 -46
- package/dist/collection/components/menu-list/menu-list-renderer.js +8 -8
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +6 -8
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/pagination/jump/pagination-jump.js +13 -11
- package/dist/collection/components/pagination/pagination.js +5 -4
- package/dist/collection/components/picker/picker.js +25 -23
- package/dist/collection/components/popover/popover.js +13 -10
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/contains.js +9 -8
- package/dist/collection/components/portal/portal.js +16 -16
- package/dist/collection/components/profile-picture/profile-picture.js +4 -3
- package/dist/collection/components/progress-flow/progress-flow.js +10 -9
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/scroller/scroller.css +317 -0
- package/dist/collection/components/scroller/scroller.js +284 -0
- package/dist/collection/components/select/select.js +13 -11
- package/dist/collection/components/select/select.template.js +1 -3
- package/dist/collection/components/slider/get-percentage-class.js +9 -18
- package/dist/collection/components/slider/slider.js +2 -2
- package/dist/collection/components/tab-bar/tab-bar.css +7 -289
- package/dist/collection/components/tab-bar/tab-bar.js +98 -128
- package/dist/collection/components/tab-panel/tab-panel.js +11 -8
- package/dist/collection/components/table/columns.js +1 -3
- package/dist/collection/components/table/element-pool.js +1 -1
- package/dist/collection/components/table/table-selection.js +6 -5
- package/dist/collection/components/table/table.css +15 -17
- package/dist/collection/components/table/table.js +44 -39
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +11 -10
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/list-utils.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js +6 -10
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +37 -40
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +2 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link/link-plugin.js +21 -20
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/menu-state-tracking-plugin.js +6 -5
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/trigger/factory-helpers/detect-trigger-removal.js +15 -14
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +40 -34
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/text-editor/utils/metadata-utils.js +1 -1
- package/dist/collection/components/text-editor/utils/plugin-factory.js +3 -3
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/global/icon-cache/factory.js +2 -3
- package/dist/collection/global/icon-cache/in-memory-icon-cache.js +2 -0
- package/dist/collection/global/translations.js +1 -3
- package/dist/collection/translations/fr.js +3 -3
- package/dist/collection/util/adapt-color-contrast.js +1 -1
- package/dist/collection/util/files.js +1 -1
- package/dist/collection/util/format-bytes.js +1 -4
- package/dist/collection/util/hotkeys.js +1 -0
- package/dist/collection/util/image-resize.js +1 -0
- package/dist/collection/util/keyboard-navigation.js +144 -0
- package/dist/collection/util/keycodes.js +2 -0
- package/dist/collection/util/language.js +1 -1
- package/dist/collection/util/make-enter-clickable.js +19 -12
- package/dist/collection/util/random-string.js +1 -0
- package/dist/collection/util/render-list-component.js +2 -4
- package/dist/esm/{adapt-color-contrast-Dgcw_h7C.js → adapt-color-contrast-BQoih_t0.js} +1 -1
- package/dist/esm/{checkbox.template-Cx_3u92S.js → checkbox.template-IDyv2bgn.js} +2 -2
- package/dist/esm/{component-wGVqvUmL.js → component-CVihTrav.js} +3 -3
- package/dist/esm/{component-7QB0OUSF.js → component-CrjPGt1I.js} +1 -1
- package/dist/esm/{component-D4qgwaTf.js → component-CyFeUQ0l.js} +1 -1
- package/dist/esm/{component-B2Vy44Z3.js → component-kP1jCDLp.js} +1 -1
- package/dist/esm/{files-DnkFEKoB.js → files-CKnLqPDj.js} +1 -1
- package/dist/esm/{format-bytes-u_sd2HMb.js → format-bytes-24yUSW40.js} +1 -4
- package/dist/esm/{hotkeys-BxrRWYts.js → hotkeys-DjmlD0Mw.js} +1 -0
- package/dist/esm/{image-resize-BTSG--2-.js → image-resize-Dv2HOgWN.js} +1 -0
- package/dist/esm/{image.template-wqMwmOF-.js → image.template-BGjw97m_.js} +1 -1
- package/dist/esm/{index-Bnc9lzk2.js → index-BU9IJqli.js} +1 -7
- package/dist/esm/index.js +1 -1
- package/dist/esm/{keycodes-C4_9qUMP.js → keycodes-DQ5DmW_Y.js} +3 -1
- package/dist/esm/{language-C3hECvXE.js → language-ChagAaNf.js} +1 -1
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
- package/dist/esm/limel-action-bar_3.entry.js +20 -18
- package/dist/esm/limel-ai-avatar.entry.js +5 -5
- package/dist/esm/limel-badge.entry.js +3 -3
- package/dist/esm/limel-banner.entry.js +2 -2
- package/dist/esm/limel-breadcrumbs_6.entry.js +86 -86
- package/dist/esm/limel-button-group.entry.js +3 -3
- package/dist/esm/limel-button.entry.js +4 -4
- package/dist/esm/limel-callout.entry.js +6 -6
- package/dist/esm/limel-card.entry.js +8 -7
- package/dist/esm/limel-chart.entry.js +5 -5
- package/dist/esm/limel-checkbox.entry.js +12 -10
- package/dist/esm/limel-chip-set.entry.js +35 -44
- package/dist/esm/limel-chip_2.entry.js +10 -10
- package/dist/esm/limel-circular-progress.entry.js +2 -2
- package/dist/esm/limel-code-diff.entry.js +25 -28
- package/dist/esm/limel-code-editor.entry.js +17 -12
- package/dist/esm/limel-collapsible-section.entry.js +8 -8
- package/dist/esm/limel-color-picker-palette.entry.js +3 -3
- package/dist/esm/limel-color-picker.entry.js +6 -5
- package/dist/esm/limel-config.entry.js +3 -3
- package/dist/esm/limel-date-picker.entry.js +12 -15
- package/dist/esm/limel-dialog.entry.js +8 -11
- package/dist/esm/limel-dock-button.entry.js +6 -11
- package/dist/esm/limel-dock.entry.js +3 -3
- package/dist/esm/limel-drag-handle.entry.js +6 -6
- package/dist/esm/limel-dynamic-label.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +11 -17
- package/dist/esm/limel-file-dropzone_2.entry.js +11 -12
- package/dist/esm/limel-file-viewer.entry.js +1098 -1146
- package/dist/esm/limel-file.entry.js +17 -16
- package/dist/esm/limel-flatpickr-adapter.entry.js +100 -94
- package/dist/esm/limel-flex-container.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +65 -50
- package/dist/esm/limel-grid.entry.js +2 -2
- package/dist/esm/limel-header.entry.js +2 -2
- package/dist/esm/limel-help-content.entry.js +2 -2
- package/dist/esm/limel-help.entry.js +3 -3
- package/dist/esm/limel-helper-line_3.entry.js +14 -16
- package/dist/esm/limel-hotkey_4.entry.js +23 -23
- package/dist/esm/limel-icon-button.entry.js +4 -4
- package/dist/esm/limel-icon.entry.js +15 -13
- package/dist/esm/limel-info-tile.entry.js +10 -10
- package/dist/esm/limel-list-item.entry.js +10 -10
- package/dist/esm/limel-markdown.entry.js +25 -22
- package/dist/esm/limel-masonry-layout.entry.js +6 -5
- package/dist/esm/limel-menu-item-meta.entry.js +3 -3
- package/dist/esm/limel-pagination-jump.entry.js +18 -16
- package/dist/esm/limel-pagination.entry.js +10 -9
- package/dist/esm/limel-picker.entry.js +32 -30
- package/dist/esm/limel-popover_2.entry.js +26 -22
- package/dist/esm/limel-profile-picture.entry.js +12 -11
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +11 -10
- package/dist/esm/limel-prosemirror-adapter.entry.js +475 -407
- package/dist/esm/limel-radio-button-group.entry.js +2 -2
- package/dist/esm/limel-radio-button.entry.js +3 -3
- package/dist/esm/limel-scroller.entry.js +178 -0
- package/dist/esm/limel-select.entry.js +20 -20
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +18 -27
- package/dist/esm/limel-snackbar.entry.js +5 -5
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js +3 -3
- package/dist/esm/limel-tab-bar.entry.js +235 -2036
- package/dist/esm/limel-tab-panel.entry.js +12 -9
- package/dist/esm/limel-table.entry.js +527 -106
- package/dist/esm/limel-text-editor-link-menu.entry.js +16 -15
- package/dist/esm/limel-text-editor.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{make-enter-clickable-BgTwPGeH.js → make-enter-clickable-CIf8aGSd.js} +19 -12
- package/dist/esm/{markdown-exporter--3_MaqwD.js → markdown-exporter-DblYRMhY.js} +1 -1
- package/dist/esm/{markdown-parser-DCf-3dKZ.js → markdown-parser-CAPDx7i8.js} +24 -22
- package/dist/esm/{moment-DQRNe8qq.js → moment-_DadZLWp.js} +1062 -833
- package/dist/esm/{ponyfill-ChRGk668.js → ponyfill-6YuZiAPi.js} +1 -1
- package/dist/esm/{random-string-JbKhhoXs.js → random-string-BrjD-ITe.js} +1 -0
- package/dist/esm/{render-list-component-cicbMp0l.js → render-list-component-J1IzNpbv.js} +3 -5
- package/dist/esm/{sv-CY-6-yEp.js → sv-DpsDSi7k.js} +31 -3
- package/dist/esm/{translations-DMtX4tTX.js → translations-Y4i8PVc9.js} +5 -8
- package/dist/lime-elements/index.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-02a06cf7.entry.js +1 -0
- package/dist/lime-elements/{p-3916b316.entry.js → p-03cb609e.entry.js} +1 -1
- package/dist/lime-elements/p-05038bbb.entry.js +1 -0
- package/dist/lime-elements/{p-835149c4.entry.js → p-0d6925f4.entry.js} +1 -1
- package/dist/lime-elements/p-0e13ec91.entry.js +1 -0
- package/dist/lime-elements/p-0ece667e.entry.js +1 -0
- package/dist/lime-elements/{p-19344984.entry.js → p-107654bb.entry.js} +4 -4
- package/dist/lime-elements/p-120ca628.entry.js +1 -0
- package/dist/lime-elements/{p-BwJGg-WI.js → p-1CgnIGyd.js} +4 -4
- package/dist/lime-elements/p-22fd1c87.entry.js +1 -0
- package/dist/lime-elements/p-24yUSW40.js +1 -0
- package/dist/lime-elements/{p-f717cd7a.entry.js → p-271662d4.entry.js} +1 -1
- package/dist/lime-elements/{p-c2a60508.entry.js → p-29c73bdf.entry.js} +1 -1
- package/dist/lime-elements/{p-deceda00.entry.js → p-2a902e77.entry.js} +1 -1
- package/dist/lime-elements/{p-d0cec424.entry.js → p-2b033dfa.entry.js} +1 -1
- package/dist/lime-elements/{p-acba5700.entry.js → p-2b2253d4.entry.js} +1 -1
- package/dist/lime-elements/p-2e33d2a4.entry.js +1 -0
- package/dist/lime-elements/p-32a050a3.entry.js +1 -0
- package/dist/lime-elements/{p-3735111e.entry.js → p-3cfe0eaf.entry.js} +1 -1
- package/dist/lime-elements/{p-fbcd99a3.entry.js → p-3d3bdf45.entry.js} +1 -1
- package/dist/lime-elements/p-45461ec5.entry.js +1 -0
- package/dist/lime-elements/p-45c39fb4.entry.js +1 -0
- package/dist/lime-elements/p-45fde7a1.entry.js +1 -0
- package/dist/lime-elements/p-48afa6b7.entry.js +1 -0
- package/dist/lime-elements/{p-f04f7c8e.entry.js → p-4a88d365.entry.js} +1 -1
- package/dist/lime-elements/p-4b75e653.entry.js +1 -0
- package/dist/lime-elements/{p-5698e493.entry.js → p-4ecbc9f4.entry.js} +1 -1
- package/dist/lime-elements/{p-2e568c56.entry.js → p-54a9f48f.entry.js} +1 -1
- package/dist/lime-elements/{p-0fba64eb.entry.js → p-5df21b25.entry.js} +2 -2
- package/dist/lime-elements/p-5e448070.entry.js +1 -0
- package/dist/lime-elements/{p-408c4dcb.entry.js → p-5f5c6e7d.entry.js} +1 -1
- package/dist/lime-elements/{p-052c3bc6.entry.js → p-681cb6de.entry.js} +1 -1
- package/dist/lime-elements/{p-ChRGk668.js → p-6YuZiAPi.js} +3 -3
- package/dist/lime-elements/{p-90df3e1b.entry.js → p-6d9961f7.entry.js} +1 -1
- package/dist/lime-elements/p-74060535.entry.js +159 -0
- package/dist/lime-elements/{p-74bd0c1a.entry.js → p-7b4351f6.entry.js} +1 -1
- package/dist/lime-elements/{p-3fd7e8aa.entry.js → p-7eab1341.entry.js} +1 -1
- package/dist/lime-elements/p-7fa85785.entry.js +23 -0
- package/dist/lime-elements/{p-35fa1063.entry.js → p-85318636.entry.js} +1 -1
- package/dist/lime-elements/{p-4ffbfc79.entry.js → p-8ac79ef5.entry.js} +1 -1
- package/dist/lime-elements/{p-4902fb3f.entry.js → p-9218fa6a.entry.js} +1 -1
- package/dist/lime-elements/{p-38b09f87.entry.js → p-9415411e.entry.js} +1 -1
- package/dist/lime-elements/{p-be8610ff.entry.js → p-958396b5.entry.js} +1 -1
- package/dist/lime-elements/p-95ccd9e7.entry.js +1 -0
- package/dist/lime-elements/p-970e0810.entry.js +1 -0
- package/dist/lime-elements/{p-cb407bef.entry.js → p-9afa4721.entry.js} +1 -1
- package/dist/lime-elements/{p-54dcf46f.entry.js → p-9c8c2fb7.entry.js} +1 -1
- package/dist/lime-elements/p-9e084e7c.entry.js +1 -0
- package/dist/lime-elements/{p-B8hoCfhT.js → p-B3YP9GOq.js} +1 -1
- package/dist/lime-elements/{p-Dgcw_h7C.js → p-BQoih_t0.js} +1 -1
- package/dist/lime-elements/{p-Bnc9lzk2.js → p-BU9IJqli.js} +1 -1
- package/dist/lime-elements/{p-BN1-aIOw.js → p-BZXGwiAr.js} +1 -1
- package/dist/lime-elements/{p-CGVVDGcv.js → p-Bkvc4sus.js} +1 -1
- package/dist/lime-elements/{p-BPzhuHcl.js → p-Bvyt2bmV.js} +1 -1
- package/dist/lime-elements/{p-DZkKQUDM.js → p-C1FFnUvf.js} +3 -3
- package/dist/lime-elements/{p-BgTwPGeH.js → p-CIf8aGSd.js} +1 -1
- package/dist/lime-elements/{p-C3hECvXE.js → p-ChagAaNf.js} +1 -1
- package/dist/lime-elements/{p-C9yTLqR8.js → p-CmtleG1y.js} +1 -1
- package/dist/lime-elements/{p-C4_9qUMP.js → p-DQ5DmW_Y.js} +1 -1
- package/dist/lime-elements/p-DTcfed02.js +3 -0
- package/dist/lime-elements/{p-BY85K-4J.js → p-DqQOawxc.js} +1 -1
- package/dist/lime-elements/{p-CC4Usa-Q.js → p-I0PrvthC.js} +1 -1
- package/dist/lime-elements/p-N9vxZMhe.js +1 -0
- package/dist/lime-elements/{p-DsDkl4Sy.js → p-ZDFVISfu.js} +3 -3
- package/dist/lime-elements/p-a1c69e0c.entry.js +1 -0
- package/dist/lime-elements/{p-2daf0482.entry.js → p-a1d1470c.entry.js} +1 -1
- package/dist/lime-elements/{p-cef66e53.entry.js → p-a2e6f16e.entry.js} +1 -1
- package/dist/lime-elements/{p-36ce4fbc.entry.js → p-a42f8c2d.entry.js} +1 -1
- package/dist/lime-elements/p-a550ba18.entry.js +1 -0
- package/dist/lime-elements/{p-d146feda.entry.js → p-a65eb58e.entry.js} +1 -1
- package/dist/lime-elements/{p-03fb2603.entry.js → p-b22b52a1.entry.js} +1 -1
- package/dist/lime-elements/{p-c2a3ca7c.entry.js → p-b6d39581.entry.js} +1 -1
- package/dist/lime-elements/{p-8475a3b8.entry.js → p-c439b68b.entry.js} +1 -1
- package/dist/lime-elements/p-d19c7a3a.entry.js +1 -0
- package/dist/lime-elements/{p-d3bd4b80.entry.js → p-d1b7cc55.entry.js} +3 -3
- package/dist/lime-elements/{p-7cbf50fc.entry.js → p-d1e5dd12.entry.js} +1 -1
- package/dist/lime-elements/p-de4719a6.entry.js +1 -0
- package/dist/lime-elements/{p-b81a2728.entry.js → p-e02e2c5f.entry.js} +1 -1
- package/dist/lime-elements/{p-d351b9ae.entry.js → p-e6a34047.entry.js} +1 -1
- package/dist/lime-elements/p-eF09GxA_.js +1 -0
- package/dist/lime-elements/{p-8fa9c9ea.entry.js → p-ee719744.entry.js} +1 -1
- package/dist/lime-elements/p-f3cae1e7.entry.js +1 -0
- package/dist/lime-elements/{p-8115da75.entry.js → p-f4a0b1bc.entry.js} +1 -1
- package/dist/lime-elements/{p-4855dc9b.entry.js → p-f82f72e7.entry.js} +1 -1
- package/dist/lime-elements/{p-2d84ea04.entry.js → p-f97ec7a5.entry.js} +1 -1
- package/dist/lime-elements/{p-21109d9b.entry.js → p-fdd674fc.entry.js} +1 -1
- package/dist/lime-elements/{p-459eea13.entry.js → p-fdec09e9.entry.js} +1 -1
- package/dist/lime-elements/{p-2f57c3fa.entry.js → p-fe492ff3.entry.js} +1 -1
- package/dist/lime-elements/{p-65cded0e.entry.js → p-ff1a8b2e.entry.js} +1 -1
- package/dist/types/components/chip-set/chip-set-input-helpers.d.ts +1 -1
- package/dist/types/components/pagination/jump/pagination-jump.d.ts +1 -1
- package/dist/types/components/scroller/scroller.d.ts +67 -0
- package/dist/types/components/tab-bar/tab-bar.d.ts +23 -21
- package/dist/types/components.d.ts +132 -0
- package/dist/types/global/icon-cache/factory.d.ts +2 -2
- package/dist/types/global/translations.d.ts +2 -2
- package/dist/types/util/keyboard-navigation.d.ts +105 -0
- package/dist/types/util/keycodes.d.ts +2 -0
- package/package.json +12 -12
- package/dist/lime-elements/p-1e93473a.entry.js +0 -1
- package/dist/lime-elements/p-20658306.entry.js +0 -1
- package/dist/lime-elements/p-26c5c6b9.entry.js +0 -1
- package/dist/lime-elements/p-452b9b01.entry.js +0 -1
- package/dist/lime-elements/p-4aae63bd.entry.js +0 -1
- package/dist/lime-elements/p-507cc8a1.entry.js +0 -159
- package/dist/lime-elements/p-531b6a64.entry.js +0 -1
- package/dist/lime-elements/p-54793c06.entry.js +0 -1
- package/dist/lime-elements/p-5d974afa.entry.js +0 -1
- package/dist/lime-elements/p-66b125f2.entry.js +0 -1
- package/dist/lime-elements/p-7e212fa7.entry.js +0 -1
- package/dist/lime-elements/p-82696d24.entry.js +0 -1
- package/dist/lime-elements/p-9ac39039.entry.js +0 -1
- package/dist/lime-elements/p-9b631363.entry.js +0 -1
- package/dist/lime-elements/p-DQJU9gzh.js +0 -1
- package/dist/lime-elements/p-DpJgXIWf.js +0 -1
- package/dist/lime-elements/p-a1de9bbe.entry.js +0 -1
- package/dist/lime-elements/p-a71f6e87.entry.js +0 -67
- package/dist/lime-elements/p-bd7b3f8e.entry.js +0 -1
- package/dist/lime-elements/p-c72e5007.entry.js +0 -1
- package/dist/lime-elements/p-cafec335.entry.js +0 -1
- package/dist/lime-elements/p-d6dadc61.entry.js +0 -1
- package/dist/lime-elements/p-d93b7b9f.entry.js +0 -23
- package/dist/lime-elements/p-dc9cd793.entry.js +0 -1
- package/dist/lime-elements/p-dd62042a.entry.js +0 -1
- package/dist/lime-elements/p-u_sd2HMb.js +0 -1
- package/dist/lime-elements/p-zo6O9LC9.js +0 -3
- /package/dist/lime-elements/{p-JbKhhoXs.js → p-BrjD-ITe.js} +0 -0
- /package/dist/lime-elements/{p-BxrRWYts.js → p-DjmlD0Mw.js} +0 -0
- /package/dist/lime-elements/{p-BTSG--2-.js → p-Dv2HOgWN.js} +0 -0
|
@@ -3,43 +3,34 @@
|
|
|
3
3
|
* @param value
|
|
4
4
|
*/
|
|
5
5
|
export function getPercentageClass(value) {
|
|
6
|
-
const tenPercent = 0.1;
|
|
7
|
-
const twentyPercent = 0.2;
|
|
8
|
-
const thirtyPercent = 0.3;
|
|
9
|
-
const fortyPercent = 0.4;
|
|
10
|
-
const fiftyPercent = 0.5;
|
|
11
|
-
const sixtyPercent = 0.6;
|
|
12
|
-
const seventyPercent = 0.7;
|
|
13
|
-
const eightyPercent = 0.8;
|
|
14
|
-
const ninetyPercent = 0.9;
|
|
15
6
|
if (value === 0) {
|
|
16
7
|
return 'percent-0';
|
|
17
8
|
}
|
|
18
|
-
if (value <
|
|
9
|
+
if (value < 0.1) {
|
|
19
10
|
return 'percent-0-10';
|
|
20
11
|
}
|
|
21
|
-
if (value <
|
|
12
|
+
if (value < 0.2) {
|
|
22
13
|
return 'percent-10-20';
|
|
23
14
|
}
|
|
24
|
-
if (value <
|
|
15
|
+
if (value < 0.3) {
|
|
25
16
|
return 'percent-20-30';
|
|
26
17
|
}
|
|
27
|
-
if (value <
|
|
18
|
+
if (value < 0.4) {
|
|
28
19
|
return 'percent-30-40';
|
|
29
20
|
}
|
|
30
|
-
if (value <
|
|
21
|
+
if (value < 0.5) {
|
|
31
22
|
return 'percent-40-50';
|
|
32
23
|
}
|
|
33
|
-
if (value <
|
|
24
|
+
if (value < 0.6) {
|
|
34
25
|
return 'percent-50-60';
|
|
35
26
|
}
|
|
36
|
-
if (value <
|
|
27
|
+
if (value < 0.7) {
|
|
37
28
|
return 'percent-60-70';
|
|
38
29
|
}
|
|
39
|
-
if (value <
|
|
30
|
+
if (value < 0.8) {
|
|
40
31
|
return 'percent-70-80';
|
|
41
32
|
}
|
|
42
|
-
if (value <
|
|
33
|
+
if (value < 0.9) {
|
|
43
34
|
return 'percent-80-90';
|
|
44
35
|
}
|
|
45
36
|
return 'percent-90-100';
|
|
@@ -277,8 +277,8 @@ export class Slider {
|
|
|
277
277
|
: undefined, ref: (el) => {
|
|
278
278
|
this.inputElement = el;
|
|
279
279
|
}, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }, inputProps)), h("div", { key: 'c287ade5d57268fbf3d0a203f4f94363709dcb74', class: "track" }, h("div", { key: 'd65e20a0bd2da417a797be2501f70860cae04857', class: "active" }), this.renderStepDots(min, max)), h("div", { key: '72e6bf77fddaf64fcde86455bfddd1122a8f174c', class: "thumb" }, h("div", { key: '2066f97938cff1b20ffa0aad2e3c4803a5a2f6f9', class: "knob" }), h("div", { key: 'abd8845bf4d52faeffd1a4f25ca2068a8062bc09', class: "indicator", "aria-hidden": "true" }, this.isUnset
|
|
280
|
-
? '\
|
|
281
|
-
: this.displayValue))), h("div", { key: '
|
|
280
|
+
? '\u{2194}\u{FE0E}'
|
|
281
|
+
: this.displayValue))), h("div", { key: '231a0836f6487fd99fb2aa60d075ad8d21a4ce10', class: "range-labels" }, h("span", { key: '966e8f9241124e9c61da1558ccb04ccb1cf0c402', class: "min" }, this.multiplyByFactor(this.valuemin), this.unit), h("span", { key: '427e6ff5bd7d894da16a6b9b006fd0e1a44f9348', class: "max" }, this.multiplyByFactor(this.valuemax), this.unit)))), this.renderClearButton(), this.renderHelperLine()));
|
|
282
282
|
}
|
|
283
283
|
watchValue() {
|
|
284
284
|
this.syncStateFromValue();
|
|
@@ -1,216 +1,3 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
/**
|
|
3
|
-
* Note! This file is forwarded via `src/style/exports.scss`
|
|
4
|
-
* and exposed to consumers through the root `index.scss`.
|
|
5
|
-
*
|
|
6
|
-
* Consumers import it using:
|
|
7
|
-
* `@use '@limetech/lime-elements' as lime-elements;`
|
|
8
|
-
*
|
|
9
|
-
* Legacy import paths (`dist/scss/mixins`) are maintained
|
|
10
|
-
* for backward compatibility via copy rules in the Stencil config.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Neutralizes the user-agent styles that browsers apply to `<button>` elements
|
|
14
|
-
* (their default background, border, padding, font, etc.), without stripping
|
|
15
|
-
* the useful defaults that `all: unset;` would also remove
|
|
16
|
-
* (such as `display`, `cursor`, and focus behavior).
|
|
17
|
-
*
|
|
18
|
-
* Prefer this mixin over `all: unset;` on `<button>` elements, then layer
|
|
19
|
-
* the styling you want on top — often one of the `is-*-clickable` mixins.
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* This mixin will mask out the content that is close to
|
|
26
|
-
* the edges of a scrollable area.
|
|
27
|
-
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
28
|
-
* as an argument for `$direction`.
|
|
29
|
-
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
30
|
-
* as an argument for `$direction`.
|
|
31
|
-
*
|
|
32
|
-
* For the visual effect to work smoothly, we need to make sure that
|
|
33
|
-
* the size of the fade-out edge effect is the same as the
|
|
34
|
-
* internal paddings of the scrollable area. Otherwise, content of a
|
|
35
|
-
* scrollable area that does not have a padding will fade out before
|
|
36
|
-
* any scrolling has been done.
|
|
37
|
-
* This is why this mixin already adds paddings, which automatically
|
|
38
|
-
* default to the size of the fade-out effect.
|
|
39
|
-
* This size defaults to `1rem`, but to override the size use
|
|
40
|
-
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
41
|
-
* when `vertically` argument is set, and use
|
|
42
|
-
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
43
|
-
* when `horizontally` argument is set.
|
|
44
|
-
* Of course you can also programmatically increase and decrease the
|
|
45
|
-
* size of these variables for each edge, based on the amount of
|
|
46
|
-
* scrolling that has been done by the user. In this case, make sure
|
|
47
|
-
* to add a custom padding where the mixin is used, to override
|
|
48
|
-
* the paddings that are automatically added by the mixin in the
|
|
49
|
-
* compiled CSS code.
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* This mixin will add an animated underline to the bottom of an `a` elements.
|
|
53
|
-
* Note that you may need to add `all: unset;` –depending on your use case–
|
|
54
|
-
* before using this mixin.
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* This mixin creates a cross-browser font stack.
|
|
58
|
-
* - `sans-serif` can be used for the UI of the components.
|
|
59
|
-
* - `monospace` can be used for code.
|
|
60
|
-
*
|
|
61
|
-
* ⚠️ If we change the font stacks, we need to update
|
|
62
|
-
* 1. the consumer documentation in `README.md`, and
|
|
63
|
-
* 2. the CSS variables of `--kompendium-example-font-family`
|
|
64
|
-
* in the `<style>` tag of `index.html`.
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* This mixin is a hack, using old CSS syntax
|
|
68
|
-
* to enable you to truncate a piece of text,
|
|
69
|
-
* after a certain number of lines.
|
|
70
|
-
*/
|
|
71
|
-
/**
|
|
72
|
-
* This mixin will add a chessboard background pattern,
|
|
73
|
-
* typically used to visualize transparency.
|
|
74
|
-
*/
|
|
75
|
-
/**
|
|
76
|
-
* Make a container resizable by the user.
|
|
77
|
-
* This is used in the documentations and examples
|
|
78
|
-
* of some components, to demonstrate how the component
|
|
79
|
-
* behaves in a resizable container.
|
|
80
|
-
*/
|
|
81
|
-
/**
|
|
82
|
-
* Drag to reorder mixins
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* The breakpoints below are used to create responsive designs
|
|
86
|
-
* in Lime's products. Therefore, they are here to get distributed
|
|
87
|
-
* to all components in other private repos, which rely on this `mixins`
|
|
88
|
-
* file, to create consistent styles.
|
|
89
|
-
*
|
|
90
|
-
* :::important
|
|
91
|
-
* In very rare cases you should used media queries!
|
|
92
|
-
* Nowadays, there are many better ways of achieving responsive design
|
|
93
|
-
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
94
|
-
* :::
|
|
95
|
-
*/
|
|
96
|
-
/**
|
|
97
|
-
* Media query mixins for responsive design based on screen width.
|
|
98
|
-
* Note that these mixins do not detect the device type!
|
|
99
|
-
*/
|
|
100
|
-
.scroll-fade,
|
|
101
|
-
.scroll-button {
|
|
102
|
-
position: absolute;
|
|
103
|
-
transition-property: transform;
|
|
104
|
-
transition-duration: 0.3s;
|
|
105
|
-
transition-timing-function: ease-out;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.scroll-fade {
|
|
109
|
-
top: 0;
|
|
110
|
-
height: 100%;
|
|
111
|
-
width: 4rem;
|
|
112
|
-
pointer-events: none;
|
|
113
|
-
}
|
|
114
|
-
.scroll-fade.left {
|
|
115
|
-
transform: translate3d(-4rem, 0, 0);
|
|
116
|
-
left: 0;
|
|
117
|
-
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%);
|
|
118
|
-
}
|
|
119
|
-
.scroll-fade.right {
|
|
120
|
-
transform: translate3d(4rem, 0, 0);
|
|
121
|
-
right: 0;
|
|
122
|
-
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%);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.scroll-button {
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
top: 0;
|
|
129
|
-
bottom: 0;
|
|
130
|
-
}
|
|
131
|
-
.scroll-button.left {
|
|
132
|
-
transform: translate3d(-4rem, 0, 0);
|
|
133
|
-
left: 0.25rem;
|
|
134
|
-
}
|
|
135
|
-
.scroll-button.right {
|
|
136
|
-
transform: translate3d(4rem, 0, 0);
|
|
137
|
-
right: 0.25rem;
|
|
138
|
-
}
|
|
139
|
-
.scroll-button:hover {
|
|
140
|
-
transform: translate3d(0, 0, 0);
|
|
141
|
-
}
|
|
142
|
-
.scroll-button button {
|
|
143
|
-
appearance: none;
|
|
144
|
-
background: none;
|
|
145
|
-
border: none;
|
|
146
|
-
padding: 0;
|
|
147
|
-
margin: 0;
|
|
148
|
-
font: inherit;
|
|
149
|
-
color: inherit;
|
|
150
|
-
text-align: inherit;
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
justify-content: center;
|
|
154
|
-
width: 1.25rem;
|
|
155
|
-
height: calc(100% - 0.25rem * 2);
|
|
156
|
-
border-radius: 0.25rem;
|
|
157
|
-
}
|
|
158
|
-
.scroll-button button:not(:disabled) {
|
|
159
|
-
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);
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
color: var(--limel-theme-on-surface-color);
|
|
162
|
-
background-color: var(--lime-elevated-surface-background-color);
|
|
163
|
-
box-shadow: var(--button-shadow-normal);
|
|
164
|
-
}
|
|
165
|
-
.scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):focus, .scroll-button button:not(:disabled):focus-visible {
|
|
166
|
-
will-change: color, background-color, box-shadow, transform;
|
|
167
|
-
}
|
|
168
|
-
.scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):focus-visible {
|
|
169
|
-
transform: translate3d(0, -0.04rem, 0);
|
|
170
|
-
color: var(--limel-theme-on-surface-color);
|
|
171
|
-
background-color: var(--lime-elevated-surface-background-color);
|
|
172
|
-
box-shadow: var(--button-shadow-hovered);
|
|
173
|
-
}
|
|
174
|
-
.scroll-button button:not(:disabled):active {
|
|
175
|
-
--limel-clickable-transform-timing-function: cubic-bezier(
|
|
176
|
-
0.83,
|
|
177
|
-
-0.15,
|
|
178
|
-
0.49,
|
|
179
|
-
1.16
|
|
180
|
-
);
|
|
181
|
-
transform: translate3d(0, 0.05rem, 0);
|
|
182
|
-
box-shadow: var(--button-shadow-pressed);
|
|
183
|
-
}
|
|
184
|
-
.scroll-button button:not(:disabled):hover, .scroll-button button:not(:disabled):active {
|
|
185
|
-
--limel-clickable-transition-speed: 0.2s;
|
|
186
|
-
--limel-clickable-transform-speed: 0.16s;
|
|
187
|
-
}
|
|
188
|
-
.scroll-button limel-icon {
|
|
189
|
-
width: 1rem;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.mdc-tab-scroller {
|
|
193
|
-
position: relative;
|
|
194
|
-
overflow: hidden;
|
|
195
|
-
}
|
|
196
|
-
.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 {
|
|
197
|
-
transform: translate3d(0, 0, 0);
|
|
198
|
-
}
|
|
199
|
-
.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 {
|
|
200
|
-
opacity: 0.5;
|
|
201
|
-
transition-delay: 0.5s;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.lime-hide-scrollbars {
|
|
205
|
-
scrollbar-width: none;
|
|
206
|
-
-ms-overflow-style: none;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.mdc-tab-scroller__scroll-content {
|
|
210
|
-
padding: 0.25rem var(--limel-tab-active-outer-edge-curve-size) 0 var(--limel-tab-active-outer-edge-curve-size);
|
|
211
|
-
background-color: rgb(var(--limel-tab-background-color));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
1
|
/**
|
|
215
2
|
* @license
|
|
216
3
|
* Copyright 2018 Google Inc.
|
|
@@ -245,82 +32,6 @@
|
|
|
245
32
|
height: 72px;
|
|
246
33
|
}
|
|
247
34
|
|
|
248
|
-
/**
|
|
249
|
-
* @license
|
|
250
|
-
* Copyright 2018 Google Inc.
|
|
251
|
-
*
|
|
252
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
253
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
254
|
-
* in the Software without restriction, including without limitation the rights
|
|
255
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
256
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
257
|
-
* furnished to do so, subject to the following conditions:
|
|
258
|
-
*
|
|
259
|
-
* The above copyright notice and this permission notice shall be included in
|
|
260
|
-
* all copies or substantial portions of the Software.
|
|
261
|
-
*
|
|
262
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
263
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
264
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
265
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
266
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
267
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
268
|
-
* THE SOFTWARE.
|
|
269
|
-
*/
|
|
270
|
-
.mdc-tab-scroller.mdc-tab-scroller--animating .mdc-tab-scroller__scroll-content {
|
|
271
|
-
transition: 250ms transform cubic-bezier(0.4, 0, 0.2, 1);
|
|
272
|
-
}
|
|
273
|
-
.mdc-tab-scroller {
|
|
274
|
-
overflow-y: hidden;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.mdc-tab-scroller__test {
|
|
278
|
-
position: absolute;
|
|
279
|
-
top: -9999px;
|
|
280
|
-
width: 100px;
|
|
281
|
-
height: 100px;
|
|
282
|
-
overflow-x: scroll;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.mdc-tab-scroller__scroll-area {
|
|
286
|
-
-webkit-overflow-scrolling: touch;
|
|
287
|
-
display: flex;
|
|
288
|
-
overflow-x: hidden;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.mdc-tab-scroller__scroll-area::-webkit-scrollbar,
|
|
292
|
-
.mdc-tab-scroller__test::-webkit-scrollbar {
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.mdc-tab-scroller__scroll-area--scroll {
|
|
297
|
-
overflow-x: scroll;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.mdc-tab-scroller__scroll-content {
|
|
301
|
-
position: relative;
|
|
302
|
-
display: flex;
|
|
303
|
-
flex: 1 0 auto;
|
|
304
|
-
transform: none;
|
|
305
|
-
will-change: transform;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.mdc-tab-scroller--align-start .mdc-tab-scroller__scroll-content {
|
|
309
|
-
justify-content: flex-start;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.mdc-tab-scroller--align-end .mdc-tab-scroller__scroll-content {
|
|
313
|
-
justify-content: flex-end;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.mdc-tab-scroller--align-center .mdc-tab-scroller__scroll-content {
|
|
317
|
-
justify-content: center;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.mdc-tab-scroller--animating .mdc-tab-scroller__scroll-area {
|
|
321
|
-
-webkit-overflow-scrolling: auto;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
35
|
/**
|
|
325
36
|
* @license
|
|
326
37
|
* Copyright 2018 Google Inc.
|
|
@@ -693,6 +404,13 @@
|
|
|
693
404
|
position: relative;
|
|
694
405
|
}
|
|
695
406
|
|
|
407
|
+
limel-scroller {
|
|
408
|
+
--limel-scroller-fade-color: var(--limel-tab-background-color);
|
|
409
|
+
--limel-scroller-content-padding: 0.25rem
|
|
410
|
+
var(--limel-tab-active-outer-edge-curve-size) 0;
|
|
411
|
+
background-color: rgb(var(--limel-tab-background-color));
|
|
412
|
+
}
|
|
413
|
+
|
|
696
414
|
:host(.has-tabs-with-equal-width) .mdc-tab {
|
|
697
415
|
flex: 1 0 auto;
|
|
698
416
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
|
-
import {
|
|
3
|
-
import { strings } from "@material/tab-bar/constants";
|
|
2
|
+
import { MDCRipple } from "@material/ripple";
|
|
4
3
|
import { isEqual, difference } from "lodash-es";
|
|
5
4
|
import { setActiveTab } from "./tabs";
|
|
6
5
|
import { getIconColor, getIconName } from "../icon/get-icon-props";
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { findNavigationTarget, findTabStop, isNavigationKey, NO_NAVIGATION_TARGET, } from "../../util/keyboard-navigation";
|
|
7
|
+
const NAVIGATION = {
|
|
8
|
+
orientation: 'horizontal',
|
|
9
|
+
wrap: true,
|
|
10
|
+
};
|
|
12
11
|
/**
|
|
13
12
|
* Tabs are great to organize information hierarchically in the interface and divide it into distinct categories. Using tabs, you can create groups of content that are related and at the same level in the hierarchy.
|
|
14
13
|
* :::warning
|
|
@@ -17,6 +16,8 @@ const OVERLAP_PERCENTAGE = 20;
|
|
|
17
16
|
* :::
|
|
18
17
|
* An exception for using tab bars in a high level of hierarchy is their usage in modals. This is because modals are perceived as a separate place and not a part of the current context. Therefore you can use tab bars in a modal to group and organize its content.
|
|
19
18
|
* A tab bar can contain an unlimited number of tabs. However, depending on the device width and width of the tabs, the number of tabs that are visible at the same time will vary. When there is limited horizontal space, the component shows a left-arrow and/or right-arrow button, which scrolls and reveals the additional tabs. The tab bar can also be swiped left and right on a touch-device.
|
|
19
|
+
* The arrows are only a shortcut for people who use a mouse or a touch screen. Screen readers do not announce them, and the Tab key skips them. People who use a keyboard or a screen reader move between the tabs, and the tab bar keeps the selected tab in view.
|
|
20
|
+
* The left and right arrow keys move to the previous and the next tab, and select it. Home and End move to the first and the last tab. Moving past the last tab continues at the first one, and the other way around. The Tab key moves on to what comes after the tab bar, and moving back with Shift and Tab lands on the selected tab, or on the first tab when none is selected.
|
|
20
21
|
* :::tip Other things to consider
|
|
21
22
|
* Never divide the content of a tab using a nested tab bar.
|
|
22
23
|
* Never place two tab bars within the same screen.
|
|
@@ -35,38 +36,34 @@ export class TabBar {
|
|
|
35
36
|
* List of tabs to display
|
|
36
37
|
*/
|
|
37
38
|
this.tabs = [];
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.handleTabActivated = this.handleTabActivated.bind(this);
|
|
42
|
-
this.handleScroll = this.handleScroll.bind(this);
|
|
43
|
-
this.handleLeftScrollClick = this.handleLeftScrollClick.bind(this);
|
|
44
|
-
this.handleRightScrollClick = this.handleRightScrollClick.bind(this);
|
|
45
|
-
this.renderTab = this.renderTab.bind(this);
|
|
39
|
+
this.ripples = new Map();
|
|
40
|
+
this.hasLoaded = false;
|
|
41
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
46
42
|
}
|
|
47
|
-
connectedCallback() {
|
|
48
|
-
|
|
43
|
+
async connectedCallback() {
|
|
44
|
+
// Connecting after the first render means that the bar was moved, which
|
|
45
|
+
// resets how far it is scrolled.
|
|
46
|
+
if (!this.hasLoaded) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.updateRipples();
|
|
50
|
+
this.revealedTabId = undefined;
|
|
51
|
+
await this.revealActiveTab('auto');
|
|
49
52
|
}
|
|
50
53
|
componentDidLoad() {
|
|
51
|
-
this.
|
|
54
|
+
this.hasLoaded = true;
|
|
52
55
|
this.triggerIconColorWarning();
|
|
53
56
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
this.setup();
|
|
59
|
-
this.setupMdc = false;
|
|
57
|
+
async componentDidRender() {
|
|
58
|
+
this.updateRipples();
|
|
59
|
+
await this.revealActiveTab(this.hasLoaded ? undefined : 'auto');
|
|
60
60
|
}
|
|
61
61
|
disconnectedCallback() {
|
|
62
|
-
this.
|
|
62
|
+
this.destroyRipples();
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'can-scroll-left': this.canScrollLeft,
|
|
68
|
-
'can-scroll-right': this.canScrollRight,
|
|
69
|
-
} }, 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" }))))));
|
|
65
|
+
const tabStop = findTabStop(this.tabs, this.tabs.findIndex((tab) => tab.active), NAVIGATION);
|
|
66
|
+
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)))));
|
|
70
67
|
}
|
|
71
68
|
tabsChanged(newTabs = [], oldTabs = []) {
|
|
72
69
|
const newIds = newTabs.map((tab) => tab.id);
|
|
@@ -74,103 +71,91 @@ export class TabBar {
|
|
|
74
71
|
if (isEqual(newIds, oldIds)) {
|
|
75
72
|
return;
|
|
76
73
|
}
|
|
77
|
-
this.
|
|
78
|
-
this.tearDown();
|
|
74
|
+
this.revealedTabId = undefined;
|
|
79
75
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
getTabElements() {
|
|
77
|
+
return [
|
|
78
|
+
...this.host.shadowRoot.querySelectorAll('button[role="tab"]'),
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Gives every tab MDC's ripple, which is the feedback when a tab is
|
|
83
|
+
* pressed. Tabs that are gone lose theirs.
|
|
84
|
+
*/
|
|
85
|
+
updateRipples() {
|
|
86
|
+
const tabs = this.getTabElements();
|
|
87
|
+
for (const [tab, ripple] of this.ripples) {
|
|
88
|
+
if (tabs.includes(tab)) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
ripple.destroy();
|
|
92
|
+
this.ripples.delete(tab);
|
|
93
|
+
}
|
|
94
|
+
for (const tab of tabs) {
|
|
95
|
+
if (!this.ripples.has(tab)) {
|
|
96
|
+
this.ripples.set(tab, new MDCRipple(tab));
|
|
97
|
+
}
|
|
83
98
|
}
|
|
84
|
-
this.handleScroll();
|
|
85
99
|
}
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
return;
|
|
100
|
+
destroyRipples() {
|
|
101
|
+
for (const ripple of this.ripples.values()) {
|
|
102
|
+
ripple.destroy();
|
|
90
103
|
}
|
|
91
|
-
this.
|
|
92
|
-
this.mdcTabBar.focusOnActivate = true;
|
|
93
|
-
this.mdcTabBar.useAutomaticActivation = true;
|
|
94
|
-
this.scrollArea = element.querySelector('.mdc-tab-scroller__scroll-area');
|
|
95
|
-
this.scrollContent = element.querySelector('.mdc-tab-scroller__scroll-content');
|
|
96
|
-
this.setupListeners();
|
|
97
|
-
// Use timeout to avoid Stencil warning about re-renders. /Ads
|
|
98
|
-
setTimeout(this.handleScroll, 0);
|
|
104
|
+
this.ripples.clear();
|
|
99
105
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
/**
|
|
107
|
+
* A tab that is activated by the user has focus, and the scroller reveals
|
|
108
|
+
* what has focus. This is for a tab that becomes active without it.
|
|
109
|
+
*
|
|
110
|
+
* @param behavior - `auto` to jump to the tab. Leave it out to let the
|
|
111
|
+
* scroller glide there.
|
|
112
|
+
*/
|
|
113
|
+
async revealActiveTab(behavior) {
|
|
114
|
+
const index = this.tabs.findIndex((tab) => tab.active);
|
|
115
|
+
if (index === -1) {
|
|
116
|
+
this.revealedTabId = undefined;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (this.tabs[index].id === this.revealedTabId) {
|
|
120
|
+
return;
|
|
103
121
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
this.revealedTabId = this.tabs[index].id;
|
|
123
|
+
const element = this.getTabElements()[index];
|
|
124
|
+
const scroller = this.host.shadowRoot.querySelector('limel-scroller');
|
|
125
|
+
if (!element || !scroller || element.matches(':focus')) {
|
|
126
|
+
return;
|
|
107
127
|
}
|
|
128
|
+
await scroller.componentOnReady();
|
|
129
|
+
await scroller.reveal(element, behavior);
|
|
108
130
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
131
|
+
handleKeyDown(event) {
|
|
132
|
+
if (!isNavigationKey(event, NAVIGATION)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
const current = this.getTabElements().indexOf(event.target);
|
|
137
|
+
this.activateTab(findNavigationTarget(this.tabs, event.key, current, NAVIGATION));
|
|
114
138
|
}
|
|
115
|
-
|
|
116
|
-
|
|
139
|
+
activateTab(index) {
|
|
140
|
+
if (index === NO_NAVIGATION_TARGET) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
// Not every browser focuses a button that is clicked, and a key can
|
|
144
|
+
// lead to the selected tab from another tab that has focus.
|
|
145
|
+
this.getTabElements()[index].focus();
|
|
146
|
+
if (index === this.tabs.findIndex((tab) => tab.active)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
117
149
|
const newTabs = setActiveTab(this.tabs, index);
|
|
118
|
-
difference(newTabs, this.tabs)
|
|
119
|
-
|
|
120
|
-
// eslint-disable-next-line unicorn/no-array-for-each
|
|
121
|
-
.forEach((tab) => {
|
|
150
|
+
const changedTabs = difference(newTabs, this.tabs).sort(this.sortByInactive);
|
|
151
|
+
for (const tab of changedTabs) {
|
|
122
152
|
this.changeTab.emit(tab);
|
|
123
|
-
}
|
|
153
|
+
}
|
|
124
154
|
this.tabs = newTabs;
|
|
125
155
|
}
|
|
126
156
|
sortByInactive(a, b) {
|
|
127
157
|
return Number(a.active) - Number(b.active);
|
|
128
158
|
}
|
|
129
|
-
handleScroll() {
|
|
130
|
-
const scrollLeft = this.scrollArea.scrollLeft;
|
|
131
|
-
const scrollRight = Math.floor(this.scrollContent.getBoundingClientRect().width -
|
|
132
|
-
this.scrollArea.getBoundingClientRect().width -
|
|
133
|
-
scrollLeft);
|
|
134
|
-
if (scrollLeft > HIDE_SCROLL_BUTTONS_WHEN_SCROLLED_LESS_THAN_PX) {
|
|
135
|
-
this.canScrollLeft = true;
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.canScrollLeft = false;
|
|
139
|
-
}
|
|
140
|
-
if (scrollRight > HIDE_SCROLL_BUTTONS_WHEN_SCROLLED_LESS_THAN_PX) {
|
|
141
|
-
this.canScrollRight = true;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
this.canScrollRight = false;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
handleLeftScrollClick() {
|
|
148
|
-
const scrollDistance = this.getScrollDistance();
|
|
149
|
-
this.scrollArea.scroll({
|
|
150
|
-
left: this.scrollArea.scrollLeft - scrollDistance,
|
|
151
|
-
behavior: 'smooth',
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
handleRightScrollClick() {
|
|
155
|
-
const scrollDistance = this.getScrollDistance();
|
|
156
|
-
this.scrollArea.scroll({
|
|
157
|
-
left: this.scrollArea.scrollLeft + scrollDistance,
|
|
158
|
-
behavior: 'smooth',
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Calculates how far to scroll when navigation buttons are clicked.
|
|
163
|
-
* Returns the visible width minus an overlap percentage to maintain context.
|
|
164
|
-
* Falls back to the constant value if something goes wrong.
|
|
165
|
-
*/
|
|
166
|
-
getScrollDistance() {
|
|
167
|
-
if (!this.scrollArea) {
|
|
168
|
-
return SCROLL_DISTANCE_ON_CLICK_PX;
|
|
169
|
-
}
|
|
170
|
-
const containerWidth = this.scrollArea.getBoundingClientRect().width;
|
|
171
|
-
const scrollDistance = containerWidth * (1 - OVERLAP_PERCENTAGE / TOTAL_WIDTH_PERCENTAGE);
|
|
172
|
-
return Math.max(scrollDistance, SCROLL_DISTANCE_ON_CLICK_PX);
|
|
173
|
-
}
|
|
174
159
|
renderIcon(tab) {
|
|
175
160
|
if (!tab.icon) {
|
|
176
161
|
return;
|
|
@@ -183,11 +168,11 @@ export class TabBar {
|
|
|
183
168
|
}
|
|
184
169
|
return (h("limel-icon", { class: "mdc-tab__icon", name: name, style: style, size: "small", "aria-hidden": "true" }));
|
|
185
170
|
}
|
|
186
|
-
renderTab(tab) {
|
|
171
|
+
renderTab(tab, index, isTabStop) {
|
|
187
172
|
return (h("button", { class: {
|
|
188
173
|
'mdc-tab': true,
|
|
189
174
|
'mdc-tab--active': !!tab.active,
|
|
190
|
-
}, role: "tab", "aria-selected": tab.active ? 'true' : 'false', tabindex:
|
|
175
|
+
}, 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: {
|
|
191
176
|
'mdc-tab-indicator': true,
|
|
192
177
|
'mdc-tab-indicator--active': !!tab.active,
|
|
193
178
|
} }, h("span", { class: "mdc-tab-indicator__content mdc-tab-indicator__content--underline" })), h("span", { class: "mdc-tab__ripple" })));
|
|
@@ -238,12 +223,6 @@ export class TabBar {
|
|
|
238
223
|
}
|
|
239
224
|
};
|
|
240
225
|
}
|
|
241
|
-
static get states() {
|
|
242
|
-
return {
|
|
243
|
-
"canScrollLeft": {},
|
|
244
|
-
"canScrollRight": {}
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
226
|
static get events() {
|
|
248
227
|
return [{
|
|
249
228
|
"method": "changeTab",
|
|
@@ -276,13 +255,4 @@ export class TabBar {
|
|
|
276
255
|
"methodName": "tabsChanged"
|
|
277
256
|
}];
|
|
278
257
|
}
|
|
279
|
-
static get listeners() {
|
|
280
|
-
return [{
|
|
281
|
-
"name": "resize",
|
|
282
|
-
"method": "handleWindowResize",
|
|
283
|
-
"target": "window",
|
|
284
|
-
"capture": false,
|
|
285
|
-
"passive": true
|
|
286
|
-
}];
|
|
287
|
-
}
|
|
288
258
|
}
|