@covalent/components 6.0.1 → 6.0.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/action-ribbon.mjs +9 -7
- package/alert.mjs +13 -11
- package/app-shell.mjs +10 -4
- package/aria-property.mjs +41 -0
- package/base-element.mjs +28 -0
- package/button.mjs +180 -13
- package/card.mjs +3 -3
- package/check-list-item.mjs +92 -14
- package/checkbox.mjs +26 -14
- package/circular-progress.mjs +144 -10
- package/class-map.mjs +62 -0
- package/code-snippet.mjs +6 -5
- package/covalent.mjs +2 -2
- package/covalent.umd.js +3339 -137
- package/dialog.mjs +750 -15
- package/directive-helpers.mjs +11 -0
- package/drawer.mjs +26 -15
- package/empty-state.mjs +4 -4
- package/event-options.mjs +14 -0
- package/form-element.mjs +50 -0
- package/foundation.mjs +152 -0
- package/foundation2.mjs +60 -0
- package/icon-button.mjs +130 -15
- package/icon-check-toggle.mjs +18 -8
- package/icon-radio-toggle.mjs +29 -18
- package/icon.mjs +19 -13
- package/if-defined.mjs +10 -0
- package/inert.esm.mjs +640 -0
- package/linear-progress.mjs +178 -15
- package/list-expansion.mjs +33 -22
- package/list-item.mjs +19 -20
- package/list.mjs +26 -13
- package/menu.mjs +32 -13
- package/mwc-checkbox-base.mjs +198 -0
- package/mwc-checkbox.css.mjs +10 -0
- package/mwc-drawer-base.mjs +335 -0
- package/mwc-icon.mjs +26 -0
- package/mwc-line-ripple-directive.mjs +653 -0
- package/mwc-list-base.mjs +840 -0
- package/mwc-list-item-base.mjs +202 -0
- package/mwc-list-item.css.mjs +17 -0
- package/mwc-menu-base.mjs +1145 -0
- package/mwc-radio-base.mjs +528 -0
- package/mwc-radio.css.mjs +10 -0
- package/mwc-slider.css.mjs +956 -0
- package/mwc-tab-base.mjs +694 -0
- package/mwc-top-app-bar-base.mjs +380 -0
- package/nav-list-item.mjs +28 -20
- package/observer.mjs +32 -0
- package/package.json +9 -2
- package/property.mjs +20 -0
- package/query-assigned-elements.mjs +615 -0
- package/query-assigned-nodes.mjs +17 -0
- package/query.mjs +25 -0
- package/radio-list-item.mjs +93 -12
- package/radio.mjs +28 -15
- package/ripple-handlers.mjs +761 -0
- package/select.mjs +1257 -15
- package/side-sheet.mjs +21 -16
- package/slider-range.mjs +438 -11
- package/slider.mjs +253 -13
- package/snackbar.mjs +456 -15
- package/src/action-ribbon/action-ribbon-base.d.ts +30 -0
- package/src/action-ribbon/action-ribbon-base.d.ts.map +1 -0
- package/src/action-ribbon/action-ribbon.d.ts +15 -0
- package/src/action-ribbon/action-ribbon.d.ts.map +1 -0
- package/src/alert/alert-base.d.ts +31 -0
- package/src/alert/alert-base.d.ts.map +1 -0
- package/src/alert/alert.d.ts +15 -0
- package/src/alert/alert.d.ts.map +1 -0
- package/src/app-shell/app-shell.d.ts +26 -0
- package/src/app-shell/app-shell.d.ts.map +1 -0
- package/src/button/button.d.ts +10 -0
- package/src/button/button.d.ts.map +1 -0
- package/src/card/card-base.d.ts +25 -0
- package/src/card/card-base.d.ts.map +1 -0
- package/src/card/card.d.ts +10 -0
- package/src/card/card.d.ts.map +1 -0
- package/src/checkbox/checkbox.d.ts +10 -0
- package/src/checkbox/checkbox.d.ts.map +1 -0
- package/src/chips/chip-base.d.ts +52 -0
- package/src/chips/chip-base.d.ts.map +1 -0
- package/src/chips/chip-set-base.d.ts +33 -0
- package/src/chips/chip-set-base.d.ts.map +1 -0
- package/src/chips/chip-set.d.ts +15 -0
- package/src/chips/chip-set.d.ts.map +1 -0
- package/src/chips/chip.d.ts +15 -0
- package/src/chips/chip.d.ts.map +1 -0
- package/src/chips/foundation.d.ts +60 -0
- package/src/chips/foundation.d.ts.map +1 -0
- package/src/circular-progress/circular-progress.d.ts +10 -0
- package/src/circular-progress/circular-progress.d.ts.map +1 -0
- package/src/code-snippet/code-snippet.d.ts +21 -0
- package/src/code-snippet/code-snippet.d.ts.map +1 -0
- package/src/dialog/dialog.d.ts +10 -0
- package/src/dialog/dialog.d.ts.map +1 -0
- package/src/drawer/drawer.d.ts +10 -0
- package/src/drawer/drawer.d.ts.map +1 -0
- package/src/empty-state/empty-state.d.ts +16 -0
- package/src/empty-state/empty-state.d.ts.map +1 -0
- package/src/formfield/formfield.d.ts +10 -0
- package/src/formfield/formfield.d.ts.map +1 -0
- package/src/icon/icon.d.ts +10 -0
- package/src/icon/icon.d.ts.map +1 -0
- package/src/icon-button/icon-button.d.ts +10 -0
- package/src/icon-button/icon-button.d.ts.map +1 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts +15 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts.map +1 -0
- package/src/icon-radio/icon-radio-toggle.d.ts +14 -0
- package/src/icon-radio/icon-radio-toggle.d.ts.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/linear-progress/linear-progress.d.ts +10 -0
- package/src/linear-progress/linear-progress.d.ts.map +1 -0
- package/src/list/check-list-item.d.ts +10 -0
- package/src/list/check-list-item.d.ts.map +1 -0
- package/src/list/list-expansion.d.ts +18 -0
- package/src/list/list-expansion.d.ts.map +1 -0
- package/src/list/list-item.d.ts +12 -0
- package/src/list/list-item.d.ts.map +1 -0
- package/src/list/list.d.ts +10 -0
- package/src/list/list.d.ts.map +1 -0
- package/src/list/nav-list-item.d.ts +12 -0
- package/src/list/nav-list-item.d.ts.map +1 -0
- package/src/list/radio-list-item.d.ts +10 -0
- package/src/list/radio-list-item.d.ts.map +1 -0
- package/src/menu/menu.d.ts +10 -0
- package/src/menu/menu.d.ts.map +1 -0
- package/src/radio/radio.d.ts +10 -0
- package/src/radio/radio.d.ts.map +1 -0
- package/src/select/select.d.ts +10 -0
- package/src/select/select.d.ts.map +1 -0
- package/src/side-sheet/side-sheet.d.ts +18 -0
- package/src/side-sheet/side-sheet.d.ts.map +1 -0
- package/src/slider/slider-range.d.ts +10 -0
- package/src/slider/slider-range.d.ts.map +1 -0
- package/src/slider/slider.d.ts +10 -0
- package/src/slider/slider.d.ts.map +1 -0
- package/src/snackbar/snackbar.d.ts +10 -0
- package/src/snackbar/snackbar.d.ts.map +1 -0
- package/src/status-header/status-header-base.d.ts +9 -0
- package/src/status-header/status-header-base.d.ts.map +1 -0
- package/src/status-header/status-header-item.d.ts +17 -0
- package/src/status-header/status-header-item.d.ts.map +1 -0
- package/src/status-header/status-header.d.ts +15 -0
- package/src/status-header/status-header.d.ts.map +1 -0
- package/src/switch/switch.d.ts +10 -0
- package/src/switch/switch.d.ts.map +1 -0
- package/src/tab/tab-bar.d.ts +10 -0
- package/src/tab/tab-bar.d.ts.map +1 -0
- package/src/tab/tab.d.ts +10 -0
- package/src/tab/tab.d.ts.map +1 -0
- package/src/text-lockup/text-lockup.d.ts +17 -0
- package/src/text-lockup/text-lockup.d.ts.map +1 -0
- package/src/textarea/textarea.d.ts +10 -0
- package/src/textarea/textarea.d.ts.map +1 -0
- package/src/textfield/textfield.d.ts +10 -0
- package/src/textfield/textfield.d.ts.map +1 -0
- package/src/toolbar/toolbar.d.ts +10 -0
- package/src/toolbar/toolbar.d.ts.map +1 -0
- package/src/tooltip/tooltip.d.ts +27 -0
- package/src/tooltip/tooltip.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts +10 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar.d.ts +10 -0
- package/src/top-app-bar/top-app-bar.d.ts.map +1 -0
- package/src/tree-list/tree-list-item.d.ts +16 -0
- package/src/tree-list/tree-list-item.d.ts.map +1 -0
- package/src/tree-list/tree-list.d.ts +11 -0
- package/src/tree-list/tree-list.d.ts.map +1 -0
- package/src/typography/typography.d.ts +12 -0
- package/src/typography/typography.d.ts.map +1 -0
- package/state.mjs +12 -0
- package/status-header-item.mjs +16 -16
- package/status-header.mjs +5 -5
- package/style-map.mjs +40 -0
- package/switch.mjs +531 -15
- package/tab-bar.mjs +1030 -13
- package/tab.mjs +29 -15
- package/text-lockup.mjs +8 -8
- package/textarea.mjs +111 -16
- package/textfield.mjs +34 -18
- package/textfield2.mjs +929 -2
- package/toolbar.mjs +8 -3
- package/tooltip.mjs +1153 -96
- package/top-app-bar-fixed.mjs +78 -18
- package/top-app-bar.mjs +19 -15
- package/top-app-bar2.mjs +9 -2
- package/tree-list-item.mjs +3 -3
- package/tree-list.mjs +6 -7
- package/tslib.es6.mjs +82 -0
- package/typography.mjs +8 -8
- package/utils.mjs +52 -0
package/tab-bar.mjs
CHANGED
@@ -1,17 +1,1034 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
import { b as u, _ as g, a as S, e as P } from "./tslib.es6.mjs";
|
2
|
+
import { i as R, e as x, y as I } from "./query-assigned-elements.mjs";
|
3
|
+
import { T as O } from "./mwc-tab-base.mjs";
|
4
|
+
import { B as w } from "./base-element.mjs";
|
5
|
+
import { e as D } from "./event-options.mjs";
|
6
|
+
import { i as b } from "./query.mjs";
|
7
|
+
import { a as M } from "./utils.mjs";
|
8
|
+
import { o as K } from "./observer.mjs";
|
9
|
+
import { e as W } from "./property.mjs";
|
10
|
+
import "./class-map.mjs";
|
11
|
+
import "./ripple-handlers.mjs";
|
12
|
+
import "./state.mjs";
|
13
|
+
import "./style-map.mjs";
|
14
|
+
/**
|
15
|
+
* @license
|
16
|
+
* Copyright 2021 Google LLC
|
17
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
18
|
+
*/
|
19
|
+
const F = R`.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}.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);position:relative}.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.mdc-ripple-upgraded--background-focused.mdc-tab--active .mdc-tab__focus-ring,.mdc-tab:not(.mdc-ripple-upgraded):focus.mdc-tab--active .mdc-tab__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:8px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc( 100% + -12px );width:calc( 100% + -8px );margin-top:-2px;z-index:2}@media screen and (forced-colors: active){.mdc-tab.mdc-ripple-upgraded--background-focused.mdc-tab--active .mdc-tab__focus-ring,.mdc-tab:not(.mdc-ripple-upgraded):focus.mdc-tab--active .mdc-tab__focus-ring{border-color:CanvasText}}.mdc-tab.mdc-ripple-upgraded--background-focused.mdc-tab--active .mdc-tab__focus-ring::after,.mdc-tab:not(.mdc-ripple-upgraded):focus.mdc-tab--active .mdc-tab__focus-ring::after{content:"";border:2px solid transparent;border-radius:10px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-tab.mdc-ripple-upgraded--background-focused.mdc-tab--active .mdc-tab__focus-ring::after,.mdc-tab:not(.mdc-ripple-upgraded):focus.mdc-tab--active .mdc-tab__focus-ring::after{border-color:CanvasText}}.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__focus-ring,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:8px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc( 100% + -8px );width:calc( 100% + -8px );z-index:2}@media screen and (forced-colors: active){.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__focus-ring,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__focus-ring{border-color:CanvasText}}.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__focus-ring::after,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__focus-ring::after{content:"";border:2px solid transparent;border-radius:10px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__focus-ring::after,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__focus-ring::after{border-color:CanvasText}}.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{outline:none;flex:1 0 auto;display:flex;justify-content:center;-webkit-tap-highlight-color:transparent}.mdc-tab{height:var(--mdc-tab-height, 48px);margin-left:0;margin-right:0;padding-right:var(--mdc-tab-horizontal-padding, 24px);padding-left:var(--mdc-tab-horizontal-padding, 24px)}.mdc-tab--stacked{height:var(--mdc-tab-stacked-height, 72px)}.mdc-tab::-moz-focus-inner{border:0}.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}.mdc-tab:not(.mdc-tab--active) .mdc-tab__text-label{color:var(--mdc-tab-text-label-color-default, rgba(0, 0, 0, 0.6))}.mdc-tab:not(.mdc-tab--active) .mdc-tab__icon{color:var(--mdc-tab-color-default, rgba(0, 0, 0, 0.54))}`;
|
20
|
+
/**
|
21
|
+
* @license
|
22
|
+
* Copyright 2018 Google LLC
|
23
|
+
* SPDX-License-Identifier: Apache-2.0
|
24
|
+
*/
|
25
|
+
let y = class extends O {
|
8
26
|
};
|
9
|
-
|
27
|
+
y.styles = [F];
|
28
|
+
y = u([
|
29
|
+
x("mwc-tab")
|
30
|
+
], y);
|
31
|
+
/**
|
32
|
+
* @license
|
33
|
+
* Copyright 2018 Google Inc.
|
34
|
+
*
|
35
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
36
|
+
* of this software and associated documentation files (the "Software"), to deal
|
37
|
+
* in the Software without restriction, including without limitation the rights
|
38
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
39
|
+
* copies of the Software, and to permit persons to whom the Software is
|
40
|
+
* furnished to do so, subject to the following conditions:
|
41
|
+
*
|
42
|
+
* The above copyright notice and this permission notice shall be included in
|
43
|
+
* all copies or substantial portions of the Software.
|
44
|
+
*
|
45
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
46
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
47
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
48
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
49
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
50
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
51
|
+
* THE SOFTWARE.
|
52
|
+
*/
|
53
|
+
function k(o, e) {
|
54
|
+
var t = o.matches || o.webkitMatchesSelector || o.msMatchesSelector;
|
55
|
+
return t.call(o, e);
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* @license
|
59
|
+
* Copyright 2016 Google Inc.
|
60
|
+
*
|
61
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
62
|
+
* of this software and associated documentation files (the "Software"), to deal
|
63
|
+
* in the Software without restriction, including without limitation the rights
|
64
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
65
|
+
* copies of the Software, and to permit persons to whom the Software is
|
66
|
+
* furnished to do so, subject to the following conditions:
|
67
|
+
*
|
68
|
+
* The above copyright notice and this permission notice shall be included in
|
69
|
+
* all copies or substantial portions of the Software.
|
70
|
+
*
|
71
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
72
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
73
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
74
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
75
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
76
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
77
|
+
* THE SOFTWARE.
|
78
|
+
*/
|
79
|
+
var Y = (
|
80
|
+
/** @class */
|
81
|
+
function() {
|
82
|
+
function o(e) {
|
83
|
+
e === void 0 && (e = {}), this.adapter = e;
|
84
|
+
}
|
85
|
+
return Object.defineProperty(o, "cssClasses", {
|
86
|
+
get: function() {
|
87
|
+
return {};
|
88
|
+
},
|
89
|
+
enumerable: !1,
|
90
|
+
configurable: !0
|
91
|
+
}), Object.defineProperty(o, "strings", {
|
92
|
+
get: function() {
|
93
|
+
return {};
|
94
|
+
},
|
95
|
+
enumerable: !1,
|
96
|
+
configurable: !0
|
97
|
+
}), Object.defineProperty(o, "numbers", {
|
98
|
+
get: function() {
|
99
|
+
return {};
|
100
|
+
},
|
101
|
+
enumerable: !1,
|
102
|
+
configurable: !0
|
103
|
+
}), Object.defineProperty(o, "defaultAdapter", {
|
104
|
+
get: function() {
|
105
|
+
return {};
|
106
|
+
},
|
107
|
+
enumerable: !1,
|
108
|
+
configurable: !0
|
109
|
+
}), o.prototype.init = function() {
|
110
|
+
}, o.prototype.destroy = function() {
|
111
|
+
}, o;
|
112
|
+
}()
|
113
|
+
);
|
114
|
+
/**
|
115
|
+
* @license
|
116
|
+
* Copyright 2018 Google Inc.
|
117
|
+
*
|
118
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
119
|
+
* of this software and associated documentation files (the "Software"), to deal
|
120
|
+
* in the Software without restriction, including without limitation the rights
|
121
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
122
|
+
* copies of the Software, and to permit persons to whom the Software is
|
123
|
+
* furnished to do so, subject to the following conditions:
|
124
|
+
*
|
125
|
+
* The above copyright notice and this permission notice shall be included in
|
126
|
+
* all copies or substantial portions of the Software.
|
127
|
+
*
|
128
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
129
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
130
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
131
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
132
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
133
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
134
|
+
* THE SOFTWARE.
|
135
|
+
*/
|
136
|
+
var z = {
|
137
|
+
ANIMATING: "mdc-tab-scroller--animating",
|
138
|
+
SCROLL_AREA_SCROLL: "mdc-tab-scroller__scroll-area--scroll",
|
139
|
+
SCROLL_TEST: "mdc-tab-scroller__test"
|
140
|
+
}, N = {
|
141
|
+
AREA_SELECTOR: ".mdc-tab-scroller__scroll-area",
|
142
|
+
CONTENT_SELECTOR: ".mdc-tab-scroller__scroll-content"
|
10
143
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
144
|
+
/**
|
145
|
+
* @license
|
146
|
+
* Copyright 2018 Google Inc.
|
147
|
+
*
|
148
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
149
|
+
* of this software and associated documentation files (the "Software"), to deal
|
150
|
+
* in the Software without restriction, including without limitation the rights
|
151
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
152
|
+
* copies of the Software, and to permit persons to whom the Software is
|
153
|
+
* furnished to do so, subject to the following conditions:
|
154
|
+
*
|
155
|
+
* The above copyright notice and this permission notice shall be included in
|
156
|
+
* all copies or substantial portions of the Software.
|
157
|
+
*
|
158
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
159
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
160
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
161
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
162
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
163
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
164
|
+
* THE SOFTWARE.
|
165
|
+
*/
|
166
|
+
var C = (
|
167
|
+
/** @class */
|
168
|
+
function() {
|
169
|
+
function o(e) {
|
170
|
+
this.adapter = e;
|
171
|
+
}
|
172
|
+
return o;
|
173
|
+
}()
|
174
|
+
);
|
175
|
+
/**
|
176
|
+
* @license
|
177
|
+
* Copyright 2018 Google Inc.
|
178
|
+
*
|
179
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
180
|
+
* of this software and associated documentation files (the "Software"), to deal
|
181
|
+
* in the Software without restriction, including without limitation the rights
|
182
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
183
|
+
* copies of the Software, and to permit persons to whom the Software is
|
184
|
+
* furnished to do so, subject to the following conditions:
|
185
|
+
*
|
186
|
+
* The above copyright notice and this permission notice shall be included in
|
187
|
+
* all copies or substantial portions of the Software.
|
188
|
+
*
|
189
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
190
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
191
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
192
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
193
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
194
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
195
|
+
* THE SOFTWARE.
|
196
|
+
*/
|
197
|
+
var V = (
|
198
|
+
/** @class */
|
199
|
+
function(o) {
|
200
|
+
g(e, o);
|
201
|
+
function e() {
|
202
|
+
return o !== null && o.apply(this, arguments) || this;
|
203
|
+
}
|
204
|
+
return e.prototype.getScrollPositionRTL = function() {
|
205
|
+
var t = this.adapter.getScrollAreaScrollLeft(), r = this.calculateScrollEdges().right;
|
206
|
+
return Math.round(r - t);
|
207
|
+
}, e.prototype.scrollToRTL = function(t) {
|
208
|
+
var r = this.calculateScrollEdges(), a = this.adapter.getScrollAreaScrollLeft(), n = this.clampScrollValue(r.right - t);
|
209
|
+
return {
|
210
|
+
finalScrollPosition: n,
|
211
|
+
scrollDelta: n - a
|
212
|
+
};
|
213
|
+
}, e.prototype.incrementScrollRTL = function(t) {
|
214
|
+
var r = this.adapter.getScrollAreaScrollLeft(), a = this.clampScrollValue(r - t);
|
215
|
+
return {
|
216
|
+
finalScrollPosition: a,
|
217
|
+
scrollDelta: a - r
|
218
|
+
};
|
219
|
+
}, e.prototype.getAnimatingScrollPosition = function(t) {
|
220
|
+
return t;
|
221
|
+
}, e.prototype.calculateScrollEdges = function() {
|
222
|
+
var t = this.adapter.getScrollContentOffsetWidth(), r = this.adapter.getScrollAreaOffsetWidth();
|
223
|
+
return {
|
224
|
+
left: 0,
|
225
|
+
right: t - r
|
226
|
+
};
|
227
|
+
}, e.prototype.clampScrollValue = function(t) {
|
228
|
+
var r = this.calculateScrollEdges();
|
229
|
+
return Math.min(Math.max(r.left, t), r.right);
|
230
|
+
}, e;
|
231
|
+
}(C)
|
232
|
+
);
|
233
|
+
/**
|
234
|
+
* @license
|
235
|
+
* Copyright 2018 Google Inc.
|
236
|
+
*
|
237
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
238
|
+
* of this software and associated documentation files (the "Software"), to deal
|
239
|
+
* in the Software without restriction, including without limitation the rights
|
240
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
241
|
+
* copies of the Software, and to permit persons to whom the Software is
|
242
|
+
* furnished to do so, subject to the following conditions:
|
243
|
+
*
|
244
|
+
* The above copyright notice and this permission notice shall be included in
|
245
|
+
* all copies or substantial portions of the Software.
|
246
|
+
*
|
247
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
248
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
249
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
250
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
251
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
252
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
253
|
+
* THE SOFTWARE.
|
254
|
+
*/
|
255
|
+
var j = (
|
256
|
+
/** @class */
|
257
|
+
function(o) {
|
258
|
+
g(e, o);
|
259
|
+
function e() {
|
260
|
+
return o !== null && o.apply(this, arguments) || this;
|
261
|
+
}
|
262
|
+
return e.prototype.getScrollPositionRTL = function(t) {
|
263
|
+
var r = this.adapter.getScrollAreaScrollLeft();
|
264
|
+
return Math.round(t - r);
|
265
|
+
}, e.prototype.scrollToRTL = function(t) {
|
266
|
+
var r = this.adapter.getScrollAreaScrollLeft(), a = this.clampScrollValue(-t);
|
267
|
+
return {
|
268
|
+
finalScrollPosition: a,
|
269
|
+
scrollDelta: a - r
|
270
|
+
};
|
271
|
+
}, e.prototype.incrementScrollRTL = function(t) {
|
272
|
+
var r = this.adapter.getScrollAreaScrollLeft(), a = this.clampScrollValue(r - t);
|
273
|
+
return {
|
274
|
+
finalScrollPosition: a,
|
275
|
+
scrollDelta: a - r
|
276
|
+
};
|
277
|
+
}, e.prototype.getAnimatingScrollPosition = function(t, r) {
|
278
|
+
return t - r;
|
279
|
+
}, e.prototype.calculateScrollEdges = function() {
|
280
|
+
var t = this.adapter.getScrollContentOffsetWidth(), r = this.adapter.getScrollAreaOffsetWidth();
|
281
|
+
return {
|
282
|
+
left: r - t,
|
283
|
+
right: 0
|
284
|
+
};
|
285
|
+
}, e.prototype.clampScrollValue = function(t) {
|
286
|
+
var r = this.calculateScrollEdges();
|
287
|
+
return Math.max(Math.min(r.right, t), r.left);
|
288
|
+
}, e;
|
289
|
+
}(C)
|
290
|
+
);
|
291
|
+
/**
|
292
|
+
* @license
|
293
|
+
* Copyright 2018 Google Inc.
|
294
|
+
*
|
295
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
296
|
+
* of this software and associated documentation files (the "Software"), to deal
|
297
|
+
* in the Software without restriction, including without limitation the rights
|
298
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
299
|
+
* copies of the Software, and to permit persons to whom the Software is
|
300
|
+
* furnished to do so, subject to the following conditions:
|
301
|
+
*
|
302
|
+
* The above copyright notice and this permission notice shall be included in
|
303
|
+
* all copies or substantial portions of the Software.
|
304
|
+
*
|
305
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
306
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
307
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
308
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
309
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
310
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
311
|
+
* THE SOFTWARE.
|
312
|
+
*/
|
313
|
+
var H = (
|
314
|
+
/** @class */
|
315
|
+
function(o) {
|
316
|
+
g(e, o);
|
317
|
+
function e() {
|
318
|
+
return o !== null && o.apply(this, arguments) || this;
|
319
|
+
}
|
320
|
+
return e.prototype.getScrollPositionRTL = function(t) {
|
321
|
+
var r = this.adapter.getScrollAreaScrollLeft();
|
322
|
+
return Math.round(r - t);
|
323
|
+
}, e.prototype.scrollToRTL = function(t) {
|
324
|
+
var r = this.adapter.getScrollAreaScrollLeft(), a = this.clampScrollValue(t);
|
325
|
+
return {
|
326
|
+
finalScrollPosition: a,
|
327
|
+
scrollDelta: r - a
|
328
|
+
};
|
329
|
+
}, e.prototype.incrementScrollRTL = function(t) {
|
330
|
+
var r = this.adapter.getScrollAreaScrollLeft(), a = this.clampScrollValue(r + t);
|
331
|
+
return {
|
332
|
+
finalScrollPosition: a,
|
333
|
+
scrollDelta: r - a
|
334
|
+
};
|
335
|
+
}, e.prototype.getAnimatingScrollPosition = function(t, r) {
|
336
|
+
return t + r;
|
337
|
+
}, e.prototype.calculateScrollEdges = function() {
|
338
|
+
var t = this.adapter.getScrollContentOffsetWidth(), r = this.adapter.getScrollAreaOffsetWidth();
|
339
|
+
return {
|
340
|
+
left: t - r,
|
341
|
+
right: 0
|
342
|
+
};
|
343
|
+
}, e.prototype.clampScrollValue = function(t) {
|
344
|
+
var r = this.calculateScrollEdges();
|
345
|
+
return Math.min(Math.max(r.right, t), r.left);
|
346
|
+
}, e;
|
347
|
+
}(C)
|
348
|
+
);
|
349
|
+
/**
|
350
|
+
* @license
|
351
|
+
* Copyright 2018 Google Inc.
|
352
|
+
*
|
353
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
354
|
+
* of this software and associated documentation files (the "Software"), to deal
|
355
|
+
* in the Software without restriction, including without limitation the rights
|
356
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
357
|
+
* copies of the Software, and to permit persons to whom the Software is
|
358
|
+
* furnished to do so, subject to the following conditions:
|
359
|
+
*
|
360
|
+
* The above copyright notice and this permission notice shall be included in
|
361
|
+
* all copies or substantial portions of the Software.
|
362
|
+
*
|
363
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
364
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
365
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
366
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
367
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
368
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
369
|
+
* THE SOFTWARE.
|
370
|
+
*/
|
371
|
+
var B = (
|
372
|
+
/** @class */
|
373
|
+
function(o) {
|
374
|
+
g(e, o);
|
375
|
+
function e(t) {
|
376
|
+
var r = o.call(this, S(S({}, e.defaultAdapter), t)) || this;
|
377
|
+
return r.isAnimating = !1, r;
|
378
|
+
}
|
379
|
+
return Object.defineProperty(e, "cssClasses", {
|
380
|
+
get: function() {
|
381
|
+
return z;
|
382
|
+
},
|
383
|
+
enumerable: !1,
|
384
|
+
configurable: !0
|
385
|
+
}), Object.defineProperty(e, "strings", {
|
386
|
+
get: function() {
|
387
|
+
return N;
|
388
|
+
},
|
389
|
+
enumerable: !1,
|
390
|
+
configurable: !0
|
391
|
+
}), Object.defineProperty(e, "defaultAdapter", {
|
392
|
+
get: function() {
|
393
|
+
return {
|
394
|
+
eventTargetMatchesSelector: function() {
|
395
|
+
return !1;
|
396
|
+
},
|
397
|
+
addClass: function() {
|
398
|
+
},
|
399
|
+
removeClass: function() {
|
400
|
+
},
|
401
|
+
addScrollAreaClass: function() {
|
402
|
+
},
|
403
|
+
setScrollAreaStyleProperty: function() {
|
404
|
+
},
|
405
|
+
setScrollContentStyleProperty: function() {
|
406
|
+
},
|
407
|
+
getScrollContentStyleValue: function() {
|
408
|
+
return "";
|
409
|
+
},
|
410
|
+
setScrollAreaScrollLeft: function() {
|
411
|
+
},
|
412
|
+
getScrollAreaScrollLeft: function() {
|
413
|
+
return 0;
|
414
|
+
},
|
415
|
+
getScrollContentOffsetWidth: function() {
|
416
|
+
return 0;
|
417
|
+
},
|
418
|
+
getScrollAreaOffsetWidth: function() {
|
419
|
+
return 0;
|
420
|
+
},
|
421
|
+
computeScrollAreaClientRect: function() {
|
422
|
+
return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
423
|
+
},
|
424
|
+
computeScrollContentClientRect: function() {
|
425
|
+
return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
426
|
+
},
|
427
|
+
computeHorizontalScrollbarHeight: function() {
|
428
|
+
return 0;
|
429
|
+
}
|
430
|
+
};
|
431
|
+
},
|
432
|
+
enumerable: !1,
|
433
|
+
configurable: !0
|
434
|
+
}), e.prototype.init = function() {
|
435
|
+
var t = this.adapter.computeHorizontalScrollbarHeight();
|
436
|
+
this.adapter.setScrollAreaStyleProperty("margin-bottom", -t + "px"), this.adapter.addScrollAreaClass(e.cssClasses.SCROLL_AREA_SCROLL);
|
437
|
+
}, e.prototype.getScrollPosition = function() {
|
438
|
+
if (this.isRTL())
|
439
|
+
return this.computeCurrentScrollPositionRTL();
|
440
|
+
var t = this.calculateCurrentTranslateX(), r = this.adapter.getScrollAreaScrollLeft();
|
441
|
+
return r - t;
|
442
|
+
}, e.prototype.handleInteraction = function() {
|
443
|
+
this.isAnimating && this.stopScrollAnimation();
|
444
|
+
}, e.prototype.handleTransitionEnd = function(t) {
|
445
|
+
var r = t.target;
|
446
|
+
!this.isAnimating || !this.adapter.eventTargetMatchesSelector(r, e.strings.CONTENT_SELECTOR) || (this.isAnimating = !1, this.adapter.removeClass(e.cssClasses.ANIMATING));
|
447
|
+
}, e.prototype.incrementScroll = function(t) {
|
448
|
+
t !== 0 && this.animate(this.getIncrementScrollOperation(t));
|
449
|
+
}, e.prototype.incrementScrollImmediate = function(t) {
|
450
|
+
if (t !== 0) {
|
451
|
+
var r = this.getIncrementScrollOperation(t);
|
452
|
+
r.scrollDelta !== 0 && (this.stopScrollAnimation(), this.adapter.setScrollAreaScrollLeft(r.finalScrollPosition));
|
453
|
+
}
|
454
|
+
}, e.prototype.scrollTo = function(t) {
|
455
|
+
if (this.isRTL()) {
|
456
|
+
this.scrollToImplRTL(t);
|
457
|
+
return;
|
458
|
+
}
|
459
|
+
this.scrollToImpl(t);
|
460
|
+
}, e.prototype.getRTLScroller = function() {
|
461
|
+
return this.rtlScrollerInstance || (this.rtlScrollerInstance = this.rtlScrollerFactory()), this.rtlScrollerInstance;
|
462
|
+
}, e.prototype.calculateCurrentTranslateX = function() {
|
463
|
+
var t = this.adapter.getScrollContentStyleValue("transform");
|
464
|
+
if (t === "none")
|
465
|
+
return 0;
|
466
|
+
var r = /\((.+?)\)/.exec(t);
|
467
|
+
if (!r)
|
468
|
+
return 0;
|
469
|
+
var a = r[1], n = P(a.split(","), 6);
|
470
|
+
n[0], n[1], n[2], n[3];
|
471
|
+
var i = n[4];
|
472
|
+
return n[5], parseFloat(i);
|
473
|
+
}, e.prototype.clampScrollValue = function(t) {
|
474
|
+
var r = this.calculateScrollEdges();
|
475
|
+
return Math.min(Math.max(r.left, t), r.right);
|
476
|
+
}, e.prototype.computeCurrentScrollPositionRTL = function() {
|
477
|
+
var t = this.calculateCurrentTranslateX();
|
478
|
+
return this.getRTLScroller().getScrollPositionRTL(t);
|
479
|
+
}, e.prototype.calculateScrollEdges = function() {
|
480
|
+
var t = this.adapter.getScrollContentOffsetWidth(), r = this.adapter.getScrollAreaOffsetWidth();
|
481
|
+
return {
|
482
|
+
left: 0,
|
483
|
+
right: t - r
|
484
|
+
};
|
485
|
+
}, e.prototype.scrollToImpl = function(t) {
|
486
|
+
var r = this.getScrollPosition(), a = this.clampScrollValue(t), n = a - r;
|
487
|
+
this.animate({
|
488
|
+
finalScrollPosition: a,
|
489
|
+
scrollDelta: n
|
490
|
+
});
|
491
|
+
}, e.prototype.scrollToImplRTL = function(t) {
|
492
|
+
var r = this.getRTLScroller().scrollToRTL(t);
|
493
|
+
this.animate(r);
|
494
|
+
}, e.prototype.getIncrementScrollOperation = function(t) {
|
495
|
+
if (this.isRTL())
|
496
|
+
return this.getRTLScroller().incrementScrollRTL(t);
|
497
|
+
var r = this.getScrollPosition(), a = t + r, n = this.clampScrollValue(a), i = n - r;
|
498
|
+
return {
|
499
|
+
finalScrollPosition: n,
|
500
|
+
scrollDelta: i
|
501
|
+
};
|
502
|
+
}, e.prototype.animate = function(t) {
|
503
|
+
var r = this;
|
504
|
+
t.scrollDelta !== 0 && (this.stopScrollAnimation(), this.adapter.setScrollAreaScrollLeft(t.finalScrollPosition), this.adapter.setScrollContentStyleProperty("transform", "translateX(" + t.scrollDelta + "px)"), this.adapter.computeScrollAreaClientRect(), requestAnimationFrame(function() {
|
505
|
+
r.adapter.addClass(e.cssClasses.ANIMATING), r.adapter.setScrollContentStyleProperty("transform", "none");
|
506
|
+
}), this.isAnimating = !0);
|
507
|
+
}, e.prototype.stopScrollAnimation = function() {
|
508
|
+
this.isAnimating = !1;
|
509
|
+
var t = this.getAnimatingScrollPosition();
|
510
|
+
this.adapter.removeClass(e.cssClasses.ANIMATING), this.adapter.setScrollContentStyleProperty("transform", "translateX(0px)"), this.adapter.setScrollAreaScrollLeft(t);
|
511
|
+
}, e.prototype.getAnimatingScrollPosition = function() {
|
512
|
+
var t = this.calculateCurrentTranslateX(), r = this.adapter.getScrollAreaScrollLeft();
|
513
|
+
return this.isRTL() ? this.getRTLScroller().getAnimatingScrollPosition(r, t) : r - t;
|
514
|
+
}, e.prototype.rtlScrollerFactory = function() {
|
515
|
+
var t = this.adapter.getScrollAreaScrollLeft();
|
516
|
+
this.adapter.setScrollAreaScrollLeft(t - 1);
|
517
|
+
var r = this.adapter.getScrollAreaScrollLeft();
|
518
|
+
if (r < 0)
|
519
|
+
return this.adapter.setScrollAreaScrollLeft(t), new j(this.adapter);
|
520
|
+
var a = this.adapter.computeScrollAreaClientRect(), n = this.adapter.computeScrollContentClientRect(), i = Math.round(n.right - a.right);
|
521
|
+
return this.adapter.setScrollAreaScrollLeft(t), i === r ? new H(this.adapter) : new V(this.adapter);
|
522
|
+
}, e.prototype.isRTL = function() {
|
523
|
+
return this.adapter.getScrollContentStyleValue("direction") === "rtl";
|
524
|
+
}, e;
|
525
|
+
}(Y)
|
526
|
+
);
|
527
|
+
const X = B;
|
528
|
+
/**
|
529
|
+
* @license
|
530
|
+
* Copyright 2018 Google LLC
|
531
|
+
* SPDX-License-Identifier: Apache-2.0
|
532
|
+
*/
|
533
|
+
class v extends w {
|
534
|
+
constructor() {
|
535
|
+
super(...arguments), this.mdcFoundationClass = X, this._scrollbarHeight = -1;
|
536
|
+
}
|
537
|
+
_handleInteraction() {
|
538
|
+
this.mdcFoundation.handleInteraction();
|
539
|
+
}
|
540
|
+
_handleTransitionEnd(e) {
|
541
|
+
this.mdcFoundation.handleTransitionEnd(e);
|
542
|
+
}
|
543
|
+
render() {
|
544
|
+
return I`
|
545
|
+
<div class="mdc-tab-scroller">
|
546
|
+
<div class="mdc-tab-scroller__scroll-area"
|
547
|
+
@wheel="${this._handleInteraction}"
|
548
|
+
@touchstart="${this._handleInteraction}"
|
549
|
+
@pointerdown="${this._handleInteraction}"
|
550
|
+
@mousedown="${this._handleInteraction}"
|
551
|
+
@keydown="${this._handleInteraction}"
|
552
|
+
@transitionend="${this._handleTransitionEnd}">
|
553
|
+
<div class="mdc-tab-scroller__scroll-content"><slot></slot></div>
|
554
|
+
</div>
|
555
|
+
</div>
|
556
|
+
`;
|
557
|
+
}
|
558
|
+
createAdapter() {
|
559
|
+
return Object.assign(Object.assign({}, M(this.mdcRoot)), { eventTargetMatchesSelector: (e, t) => k(e, t), addScrollAreaClass: (e) => this.scrollAreaElement.classList.add(e), setScrollAreaStyleProperty: (e, t) => this.scrollAreaElement.style.setProperty(e, t), setScrollContentStyleProperty: (e, t) => this.scrollContentElement.style.setProperty(e, t), getScrollContentStyleValue: (e) => window.getComputedStyle(this.scrollContentElement).getPropertyValue(e), setScrollAreaScrollLeft: (e) => this.scrollAreaElement.scrollLeft = e, getScrollAreaScrollLeft: () => this.scrollAreaElement.scrollLeft, getScrollContentOffsetWidth: () => this.scrollContentElement.offsetWidth, getScrollAreaOffsetWidth: () => this.scrollAreaElement.offsetWidth, computeScrollAreaClientRect: () => this.scrollAreaElement.getBoundingClientRect(), computeScrollContentClientRect: () => this.scrollContentElement.getBoundingClientRect(), computeHorizontalScrollbarHeight: () => (this._scrollbarHeight === -1 && (this.scrollAreaElement.style.overflowX = "scroll", this._scrollbarHeight = this.scrollAreaElement.offsetHeight - this.scrollAreaElement.clientHeight, this.scrollAreaElement.style.overflowX = ""), this._scrollbarHeight) });
|
560
|
+
}
|
561
|
+
/**
|
562
|
+
* Returns the current visual scroll position
|
563
|
+
* @return {number}
|
564
|
+
*/
|
565
|
+
getScrollPosition() {
|
566
|
+
return this.mdcFoundation.getScrollPosition();
|
567
|
+
}
|
568
|
+
/**
|
569
|
+
* Returns the width of the scroll content
|
570
|
+
* @return {number}
|
571
|
+
*/
|
572
|
+
getScrollContentWidth() {
|
573
|
+
return this.scrollContentElement.offsetWidth;
|
574
|
+
}
|
575
|
+
/**
|
576
|
+
* Increments the scroll value by the given amount
|
577
|
+
* @param {number} scrollXIncrement The pixel value by which to increment the
|
578
|
+
* scroll value
|
579
|
+
*/
|
580
|
+
incrementScrollPosition(e) {
|
581
|
+
this.mdcFoundation.incrementScroll(e);
|
582
|
+
}
|
583
|
+
/**
|
584
|
+
* Scrolls to the given pixel position
|
585
|
+
* @param {number} scrollX The pixel value to scroll to
|
586
|
+
*/
|
587
|
+
scrollToPosition(e) {
|
588
|
+
this.mdcFoundation.scrollTo(e);
|
589
|
+
}
|
590
|
+
}
|
591
|
+
u([
|
592
|
+
b(".mdc-tab-scroller")
|
593
|
+
], v.prototype, "mdcRoot", void 0);
|
594
|
+
u([
|
595
|
+
b(".mdc-tab-scroller__scroll-area")
|
596
|
+
], v.prototype, "scrollAreaElement", void 0);
|
597
|
+
u([
|
598
|
+
b(".mdc-tab-scroller__scroll-content")
|
599
|
+
], v.prototype, "scrollContentElement", void 0);
|
600
|
+
u([
|
601
|
+
D({ passive: !0 })
|
602
|
+
], v.prototype, "_handleInteraction", null);
|
603
|
+
/**
|
604
|
+
* @license
|
605
|
+
* Copyright 2021 Google LLC
|
606
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
607
|
+
*/
|
608
|
+
const $ = R`.mdc-tab-scroller{overflow-y:hidden}.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__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}:host{display:flex}.mdc-tab-scroller{flex:1}`;
|
609
|
+
/**
|
610
|
+
* @license
|
611
|
+
* Copyright 2018 Google LLC
|
612
|
+
* SPDX-License-Identifier: Apache-2.0
|
613
|
+
*/
|
614
|
+
let A = class extends v {
|
615
|
+
};
|
616
|
+
A.styles = [$];
|
617
|
+
A = u([
|
618
|
+
x("mwc-tab-scroller")
|
619
|
+
], A);
|
620
|
+
/**
|
621
|
+
* @license
|
622
|
+
* Copyright 2016 Google Inc.
|
623
|
+
*
|
624
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
625
|
+
* of this software and associated documentation files (the "Software"), to deal
|
626
|
+
* in the Software without restriction, including without limitation the rights
|
627
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
628
|
+
* copies of the Software, and to permit persons to whom the Software is
|
629
|
+
* furnished to do so, subject to the following conditions:
|
630
|
+
*
|
631
|
+
* The above copyright notice and this permission notice shall be included in
|
632
|
+
* all copies or substantial portions of the Software.
|
633
|
+
*
|
634
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
635
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
636
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
637
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
638
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
639
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
640
|
+
* THE SOFTWARE.
|
641
|
+
*/
|
642
|
+
var G = (
|
643
|
+
/** @class */
|
644
|
+
function() {
|
645
|
+
function o(e) {
|
646
|
+
e === void 0 && (e = {}), this.adapter = e;
|
647
|
+
}
|
648
|
+
return Object.defineProperty(o, "cssClasses", {
|
649
|
+
get: function() {
|
650
|
+
return {};
|
651
|
+
},
|
652
|
+
enumerable: !1,
|
653
|
+
configurable: !0
|
654
|
+
}), Object.defineProperty(o, "strings", {
|
655
|
+
get: function() {
|
656
|
+
return {};
|
657
|
+
},
|
658
|
+
enumerable: !1,
|
659
|
+
configurable: !0
|
660
|
+
}), Object.defineProperty(o, "numbers", {
|
661
|
+
get: function() {
|
662
|
+
return {};
|
663
|
+
},
|
664
|
+
enumerable: !1,
|
665
|
+
configurable: !0
|
666
|
+
}), Object.defineProperty(o, "defaultAdapter", {
|
667
|
+
get: function() {
|
668
|
+
return {};
|
669
|
+
},
|
670
|
+
enumerable: !1,
|
671
|
+
configurable: !0
|
672
|
+
}), o.prototype.init = function() {
|
673
|
+
}, o.prototype.destroy = function() {
|
674
|
+
}, o;
|
675
|
+
}()
|
676
|
+
);
|
677
|
+
/**
|
678
|
+
* @license
|
679
|
+
* Copyright 2018 Google Inc.
|
680
|
+
*
|
681
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
682
|
+
* of this software and associated documentation files (the "Software"), to deal
|
683
|
+
* in the Software without restriction, including without limitation the rights
|
684
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
685
|
+
* copies of the Software, and to permit persons to whom the Software is
|
686
|
+
* furnished to do so, subject to the following conditions:
|
687
|
+
*
|
688
|
+
* The above copyright notice and this permission notice shall be included in
|
689
|
+
* all copies or substantial portions of the Software.
|
690
|
+
*
|
691
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
692
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
693
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
694
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
695
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
696
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
697
|
+
* THE SOFTWARE.
|
698
|
+
*/
|
699
|
+
var l = {
|
700
|
+
ARROW_LEFT_KEY: "ArrowLeft",
|
701
|
+
ARROW_RIGHT_KEY: "ArrowRight",
|
702
|
+
END_KEY: "End",
|
703
|
+
ENTER_KEY: "Enter",
|
704
|
+
HOME_KEY: "Home",
|
705
|
+
SPACE_KEY: "Space",
|
706
|
+
TAB_ACTIVATED_EVENT: "MDCTabBar:activated",
|
707
|
+
TAB_SCROLLER_SELECTOR: ".mdc-tab-scroller",
|
708
|
+
TAB_SELECTOR: ".mdc-tab"
|
709
|
+
}, p = {
|
710
|
+
ARROW_LEFT_KEYCODE: 37,
|
711
|
+
ARROW_RIGHT_KEYCODE: 39,
|
712
|
+
END_KEYCODE: 35,
|
713
|
+
ENTER_KEYCODE: 13,
|
714
|
+
EXTRA_SCROLL_AMOUNT: 20,
|
715
|
+
HOME_KEYCODE: 36,
|
716
|
+
SPACE_KEYCODE: 32
|
717
|
+
};
|
718
|
+
/**
|
719
|
+
* @license
|
720
|
+
* Copyright 2018 Google Inc.
|
721
|
+
*
|
722
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
723
|
+
* of this software and associated documentation files (the "Software"), to deal
|
724
|
+
* in the Software without restriction, including without limitation the rights
|
725
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
726
|
+
* copies of the Software, and to permit persons to whom the Software is
|
727
|
+
* furnished to do so, subject to the following conditions:
|
728
|
+
*
|
729
|
+
* The above copyright notice and this permission notice shall be included in
|
730
|
+
* all copies or substantial portions of the Software.
|
731
|
+
*
|
732
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
733
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
734
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
735
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
736
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
737
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
738
|
+
* THE SOFTWARE.
|
739
|
+
*/
|
740
|
+
var m = /* @__PURE__ */ new Set();
|
741
|
+
m.add(l.ARROW_LEFT_KEY);
|
742
|
+
m.add(l.ARROW_RIGHT_KEY);
|
743
|
+
m.add(l.END_KEY);
|
744
|
+
m.add(l.HOME_KEY);
|
745
|
+
m.add(l.ENTER_KEY);
|
746
|
+
m.add(l.SPACE_KEY);
|
747
|
+
var h = /* @__PURE__ */ new Map();
|
748
|
+
h.set(p.ARROW_LEFT_KEYCODE, l.ARROW_LEFT_KEY);
|
749
|
+
h.set(p.ARROW_RIGHT_KEYCODE, l.ARROW_RIGHT_KEY);
|
750
|
+
h.set(p.END_KEYCODE, l.END_KEY);
|
751
|
+
h.set(p.HOME_KEYCODE, l.HOME_KEY);
|
752
|
+
h.set(p.ENTER_KEYCODE, l.ENTER_KEY);
|
753
|
+
h.set(p.SPACE_KEYCODE, l.SPACE_KEY);
|
754
|
+
var U = (
|
755
|
+
/** @class */
|
756
|
+
function(o) {
|
757
|
+
g(e, o);
|
758
|
+
function e(t) {
|
759
|
+
var r = o.call(this, S(S({}, e.defaultAdapter), t)) || this;
|
760
|
+
return r.useAutomaticActivation = !1, r;
|
761
|
+
}
|
762
|
+
return Object.defineProperty(e, "strings", {
|
763
|
+
get: function() {
|
764
|
+
return l;
|
765
|
+
},
|
766
|
+
enumerable: !1,
|
767
|
+
configurable: !0
|
768
|
+
}), Object.defineProperty(e, "numbers", {
|
769
|
+
get: function() {
|
770
|
+
return p;
|
771
|
+
},
|
772
|
+
enumerable: !1,
|
773
|
+
configurable: !0
|
774
|
+
}), Object.defineProperty(e, "defaultAdapter", {
|
775
|
+
get: function() {
|
776
|
+
return {
|
777
|
+
scrollTo: function() {
|
778
|
+
},
|
779
|
+
incrementScroll: function() {
|
780
|
+
},
|
781
|
+
getScrollPosition: function() {
|
782
|
+
return 0;
|
783
|
+
},
|
784
|
+
getScrollContentWidth: function() {
|
785
|
+
return 0;
|
786
|
+
},
|
787
|
+
getOffsetWidth: function() {
|
788
|
+
return 0;
|
789
|
+
},
|
790
|
+
isRTL: function() {
|
791
|
+
return !1;
|
792
|
+
},
|
793
|
+
setActiveTab: function() {
|
794
|
+
},
|
795
|
+
activateTabAtIndex: function() {
|
796
|
+
},
|
797
|
+
deactivateTabAtIndex: function() {
|
798
|
+
},
|
799
|
+
focusTabAtIndex: function() {
|
800
|
+
},
|
801
|
+
getTabIndicatorClientRectAtIndex: function() {
|
802
|
+
return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
803
|
+
},
|
804
|
+
getTabDimensionsAtIndex: function() {
|
805
|
+
return { rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0 };
|
806
|
+
},
|
807
|
+
getPreviousActiveTabIndex: function() {
|
808
|
+
return -1;
|
809
|
+
},
|
810
|
+
getFocusedTabIndex: function() {
|
811
|
+
return -1;
|
812
|
+
},
|
813
|
+
getIndexOfTabById: function() {
|
814
|
+
return -1;
|
815
|
+
},
|
816
|
+
getTabListLength: function() {
|
817
|
+
return 0;
|
818
|
+
},
|
819
|
+
notifyTabActivated: function() {
|
820
|
+
}
|
821
|
+
};
|
822
|
+
},
|
823
|
+
enumerable: !1,
|
824
|
+
configurable: !0
|
825
|
+
}), e.prototype.setUseAutomaticActivation = function(t) {
|
826
|
+
this.useAutomaticActivation = t;
|
827
|
+
}, e.prototype.activateTab = function(t) {
|
828
|
+
var r = this.adapter.getPreviousActiveTabIndex();
|
829
|
+
if (!(!this.indexIsInRange(t) || t === r)) {
|
830
|
+
var a;
|
831
|
+
r !== -1 && (this.adapter.deactivateTabAtIndex(r), a = this.adapter.getTabIndicatorClientRectAtIndex(r)), this.adapter.activateTabAtIndex(t, a), this.scrollIntoView(t), this.adapter.notifyTabActivated(t);
|
832
|
+
}
|
833
|
+
}, e.prototype.handleKeyDown = function(t) {
|
834
|
+
var r = this.getKeyFromEvent(t);
|
835
|
+
if (r !== void 0)
|
836
|
+
if (this.isActivationKey(r) || t.preventDefault(), this.useAutomaticActivation) {
|
837
|
+
if (this.isActivationKey(r))
|
838
|
+
return;
|
839
|
+
var a = this.determineTargetFromKey(this.adapter.getPreviousActiveTabIndex(), r);
|
840
|
+
this.adapter.setActiveTab(a), this.scrollIntoView(a);
|
841
|
+
} else {
|
842
|
+
var n = this.adapter.getFocusedTabIndex();
|
843
|
+
if (this.isActivationKey(r))
|
844
|
+
this.adapter.setActiveTab(n);
|
845
|
+
else {
|
846
|
+
var a = this.determineTargetFromKey(n, r);
|
847
|
+
this.adapter.focusTabAtIndex(a), this.scrollIntoView(a);
|
848
|
+
}
|
849
|
+
}
|
850
|
+
}, e.prototype.handleTabInteraction = function(t) {
|
851
|
+
this.adapter.setActiveTab(this.adapter.getIndexOfTabById(t.detail.tabId));
|
852
|
+
}, e.prototype.scrollIntoView = function(t) {
|
853
|
+
if (this.indexIsInRange(t)) {
|
854
|
+
if (t === 0) {
|
855
|
+
this.adapter.scrollTo(0);
|
856
|
+
return;
|
857
|
+
}
|
858
|
+
if (t === this.adapter.getTabListLength() - 1) {
|
859
|
+
this.adapter.scrollTo(this.adapter.getScrollContentWidth());
|
860
|
+
return;
|
861
|
+
}
|
862
|
+
if (this.isRTL()) {
|
863
|
+
this.scrollIntoViewImplRTL(t);
|
864
|
+
return;
|
865
|
+
}
|
866
|
+
this.scrollIntoViewImpl(t);
|
867
|
+
}
|
868
|
+
}, e.prototype.determineTargetFromKey = function(t, r) {
|
869
|
+
var a = this.isRTL(), n = this.adapter.getTabListLength() - 1, i = r === l.END_KEY, s = r === l.ARROW_LEFT_KEY && !a || r === l.ARROW_RIGHT_KEY && a, d = r === l.ARROW_RIGHT_KEY && !a || r === l.ARROW_LEFT_KEY && a, c = t;
|
870
|
+
return i ? c = n : s ? c -= 1 : d ? c += 1 : c = 0, c < 0 ? c = n : c > n && (c = 0), c;
|
871
|
+
}, e.prototype.calculateScrollIncrement = function(t, r, a, n) {
|
872
|
+
var i = this.adapter.getTabDimensionsAtIndex(r), s = i.contentLeft - a - n, d = i.contentRight - a, c = d - p.EXTRA_SCROLL_AMOUNT, f = s + p.EXTRA_SCROLL_AMOUNT;
|
873
|
+
return r < t ? Math.min(c, 0) : Math.max(f, 0);
|
874
|
+
}, e.prototype.calculateScrollIncrementRTL = function(t, r, a, n, i) {
|
875
|
+
var s = this.adapter.getTabDimensionsAtIndex(r), d = i - s.contentLeft - a, c = i - s.contentRight - a - n, f = c + p.EXTRA_SCROLL_AMOUNT, T = d - p.EXTRA_SCROLL_AMOUNT;
|
876
|
+
return r > t ? Math.max(f, 0) : Math.min(T, 0);
|
877
|
+
}, e.prototype.findAdjacentTabIndexClosestToEdge = function(t, r, a, n) {
|
878
|
+
var i = r.rootLeft - a, s = r.rootRight - a - n, d = i + s, c = i < 0 || d < 0, f = s > 0 || d > 0;
|
879
|
+
return c ? t - 1 : f ? t + 1 : -1;
|
880
|
+
}, e.prototype.findAdjacentTabIndexClosestToEdgeRTL = function(t, r, a, n, i) {
|
881
|
+
var s = i - r.rootLeft - n - a, d = i - r.rootRight - a, c = s + d, f = s > 0 || c > 0, T = d < 0 || c < 0;
|
882
|
+
return f ? t + 1 : T ? t - 1 : -1;
|
883
|
+
}, e.prototype.getKeyFromEvent = function(t) {
|
884
|
+
return m.has(t.key) ? t.key : h.get(t.keyCode);
|
885
|
+
}, e.prototype.isActivationKey = function(t) {
|
886
|
+
return t === l.SPACE_KEY || t === l.ENTER_KEY;
|
887
|
+
}, e.prototype.indexIsInRange = function(t) {
|
888
|
+
return t >= 0 && t < this.adapter.getTabListLength();
|
889
|
+
}, e.prototype.isRTL = function() {
|
890
|
+
return this.adapter.isRTL();
|
891
|
+
}, e.prototype.scrollIntoViewImpl = function(t) {
|
892
|
+
var r = this.adapter.getScrollPosition(), a = this.adapter.getOffsetWidth(), n = this.adapter.getTabDimensionsAtIndex(t), i = this.findAdjacentTabIndexClosestToEdge(t, n, r, a);
|
893
|
+
if (this.indexIsInRange(i)) {
|
894
|
+
var s = this.calculateScrollIncrement(t, i, r, a);
|
895
|
+
this.adapter.incrementScroll(s);
|
896
|
+
}
|
897
|
+
}, e.prototype.scrollIntoViewImplRTL = function(t) {
|
898
|
+
var r = this.adapter.getScrollPosition(), a = this.adapter.getOffsetWidth(), n = this.adapter.getTabDimensionsAtIndex(t), i = this.adapter.getScrollContentWidth(), s = this.findAdjacentTabIndexClosestToEdgeRTL(t, n, r, a, i);
|
899
|
+
if (this.indexIsInRange(s)) {
|
900
|
+
var d = this.calculateScrollIncrementRTL(t, s, r, a, i);
|
901
|
+
this.adapter.incrementScroll(d);
|
902
|
+
}
|
903
|
+
}, e;
|
904
|
+
}(G)
|
905
|
+
);
|
906
|
+
const L = U;
|
907
|
+
/**
|
908
|
+
* @license
|
909
|
+
* Copyright 2018 Google LLC
|
910
|
+
* SPDX-License-Identifier: Apache-2.0
|
911
|
+
*/
|
912
|
+
class _ extends w {
|
913
|
+
constructor() {
|
914
|
+
super(...arguments), this.mdcFoundationClass = L, this.activeIndex = 0, this._previousActiveIndex = -1;
|
915
|
+
}
|
916
|
+
_handleTabInteraction(e) {
|
917
|
+
this.mdcFoundation.handleTabInteraction(e);
|
918
|
+
}
|
919
|
+
_handleKeydown(e) {
|
920
|
+
this.mdcFoundation.handleKeyDown(e);
|
921
|
+
}
|
922
|
+
// TODO(sorvell): can scroller be optional for perf?
|
923
|
+
render() {
|
924
|
+
return I`
|
925
|
+
<div class="mdc-tab-bar" role="tablist"
|
926
|
+
@MDCTab:interacted="${this._handleTabInteraction}"
|
927
|
+
@keydown="${this._handleKeydown}">
|
928
|
+
<mwc-tab-scroller><slot></slot></mwc-tab-scroller>
|
929
|
+
</div>
|
930
|
+
`;
|
931
|
+
}
|
932
|
+
// TODO(sorvell): probably want to memoize this and use a `slotChange` event
|
933
|
+
_getTabs() {
|
934
|
+
return this.tabsSlot.assignedNodes({ flatten: !0 }).filter((e) => e instanceof O);
|
935
|
+
}
|
936
|
+
_getTab(e) {
|
937
|
+
return this._getTabs()[e];
|
938
|
+
}
|
939
|
+
createAdapter() {
|
940
|
+
return {
|
941
|
+
scrollTo: (e) => this.scrollerElement.scrollToPosition(e),
|
942
|
+
incrementScroll: (e) => this.scrollerElement.incrementScrollPosition(e),
|
943
|
+
getScrollPosition: () => this.scrollerElement.getScrollPosition(),
|
944
|
+
getScrollContentWidth: () => this.scrollerElement.getScrollContentWidth(),
|
945
|
+
getOffsetWidth: () => this.mdcRoot.offsetWidth,
|
946
|
+
isRTL: () => window.getComputedStyle(this.mdcRoot).getPropertyValue("direction") === "rtl",
|
947
|
+
setActiveTab: (e) => this.mdcFoundation.activateTab(e),
|
948
|
+
activateTabAtIndex: (e, t) => {
|
949
|
+
const r = this._getTab(e);
|
950
|
+
r !== void 0 && r.activate(t), this._previousActiveIndex = e;
|
951
|
+
},
|
952
|
+
deactivateTabAtIndex: (e) => {
|
953
|
+
const t = this._getTab(e);
|
954
|
+
t !== void 0 && t.deactivate();
|
955
|
+
},
|
956
|
+
focusTabAtIndex: (e) => {
|
957
|
+
const t = this._getTab(e);
|
958
|
+
t !== void 0 && t.focus();
|
959
|
+
},
|
960
|
+
// TODO(sorvell): tab may not be able to synchronously answer
|
961
|
+
// `computeIndicatorClientRect` if an update is pending or it has not yet
|
962
|
+
// updated. If this is necessary, LitElement may need a `forceUpdate`
|
963
|
+
// method.
|
964
|
+
getTabIndicatorClientRectAtIndex: (e) => {
|
965
|
+
const t = this._getTab(e);
|
966
|
+
return t !== void 0 ? t.computeIndicatorClientRect() : new DOMRect();
|
967
|
+
},
|
968
|
+
getTabDimensionsAtIndex: (e) => {
|
969
|
+
const t = this._getTab(e);
|
970
|
+
return t !== void 0 ? t.computeDimensions() : { rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0 };
|
971
|
+
},
|
972
|
+
getPreviousActiveTabIndex: () => this._previousActiveIndex,
|
973
|
+
getFocusedTabIndex: () => {
|
974
|
+
const e = this._getTabs(), t = this.getRootNode().activeElement;
|
975
|
+
return e.indexOf(t);
|
976
|
+
},
|
977
|
+
getIndexOfTabById: (e) => {
|
978
|
+
const t = this._getTabs();
|
979
|
+
for (let r = 0; r < t.length; r++)
|
980
|
+
if (t[r].id === e)
|
981
|
+
return r;
|
982
|
+
return -1;
|
983
|
+
},
|
984
|
+
getTabListLength: () => this._getTabs().length,
|
985
|
+
notifyTabActivated: (e) => {
|
986
|
+
this.activeIndex = e, this.dispatchEvent(new CustomEvent(L.strings.TAB_ACTIVATED_EVENT, { detail: { index: e }, bubbles: !0, cancelable: !0 }));
|
987
|
+
}
|
988
|
+
};
|
989
|
+
}
|
990
|
+
firstUpdated() {
|
991
|
+
}
|
992
|
+
async getUpdateComplete() {
|
993
|
+
const e = await super.getUpdateComplete();
|
994
|
+
return await this.scrollerElement.updateComplete, this.mdcFoundation === void 0 && this.createFoundation(), e;
|
995
|
+
}
|
996
|
+
scrollIndexIntoView(e) {
|
997
|
+
this.mdcFoundation.scrollIntoView(e);
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
u([
|
1001
|
+
b(".mdc-tab-bar")
|
1002
|
+
], _.prototype, "mdcRoot", void 0);
|
1003
|
+
u([
|
1004
|
+
b("mwc-tab-scroller")
|
1005
|
+
], _.prototype, "scrollerElement", void 0);
|
1006
|
+
u([
|
1007
|
+
b("slot")
|
1008
|
+
], _.prototype, "tabsSlot", void 0);
|
1009
|
+
u([
|
1010
|
+
K(async function() {
|
1011
|
+
await this.updateComplete, this.activeIndex !== this._previousActiveIndex && this.mdcFoundation.activateTab(this.activeIndex);
|
1012
|
+
}),
|
1013
|
+
W({ type: Number })
|
1014
|
+
], _.prototype, "activeIndex", void 0);
|
1015
|
+
/**
|
1016
|
+
* @license
|
1017
|
+
* Copyright 2021 Google LLC
|
1018
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
1019
|
+
*/
|
1020
|
+
const q = R`.mdc-tab-bar{width:100%}.mdc-tab{height:48px}.mdc-tab--stacked{height:72px}:host{display:block}.mdc-tab-bar{flex:1}mwc-tab{--mdc-tab-height: 48px;--mdc-tab-stacked-height: 72px}`;
|
1021
|
+
var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, Z = (o, e, t, r) => {
|
1022
|
+
for (var a = r > 1 ? void 0 : r ? Q(e, t) : e, n = o.length - 1, i; n >= 0; n--)
|
1023
|
+
(i = o[n]) && (a = (r ? i(e, t, a) : i(a)) || a);
|
1024
|
+
return r && a && J(e, t, a), a;
|
1025
|
+
};
|
1026
|
+
let E = class extends _ {
|
1027
|
+
};
|
1028
|
+
E.styles = [q];
|
1029
|
+
E = Z([
|
1030
|
+
x("cv-tab-bar")
|
1031
|
+
], E);
|
15
1032
|
export {
|
16
|
-
|
1033
|
+
E as CovalentTabBarBase
|
17
1034
|
};
|