@covalent/components 6.4.0 → 6.4.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.js +6 -6
- package/action-ribbon.mjs +24 -23
- package/alert.js +4 -4
- package/alert.mjs +28 -27
- package/app-shell.js +4 -4
- package/app-shell.mjs +10 -10
- package/{base-element-67ae173f.mjs → base-element-c3dc926e.mjs} +2 -2
- package/{base-element-58a3f9ea.js → base-element-d5abe37a.js} +1 -1
- package/button.js +4 -4
- package/button.mjs +13 -13
- package/card.js +8 -8
- package/card.mjs +4 -4
- package/check-list-item.js +3 -3
- package/check-list-item.mjs +16 -16
- package/checkbox.js +1 -1
- package/checkbox.mjs +15 -15
- package/circular-progress.js +7 -7
- package/circular-progress.mjs +6 -6
- package/class-map-08c84aeb.mjs +62 -0
- package/class-map-50b8edb4.js +9 -0
- package/code-snippet.js +9 -9
- package/code-snippet.mjs +1213 -1276
- package/{dialog-9ac44447.mjs → dialog-85c21333.mjs} +39 -39
- package/{dialog-79036d60.js → dialog-8ee07177.js} +4 -4
- package/dialog.js +1 -1
- package/dialog.mjs +8 -8
- package/{directive-helpers-e3ea6592.mjs → directive-helpers-725a181d.mjs} +3 -3
- package/{directive-helpers-0ce1f995.js → directive-helpers-fce8cf91.js} +2 -2
- package/drawer.js +1 -1
- package/drawer.mjs +8 -8
- package/empty-state.js +7 -7
- package/empty-state.mjs +4 -4
- package/{event-options-78d6cf94.mjs → event-options-3937d997.mjs} +1 -1
- package/{event-options-3f5eb195.js → event-options-7bc382d8.js} +1 -1
- package/{form-element-bd973124.mjs → form-element-6dbd7afa.mjs} +4 -4
- package/{form-element-ead758d4.js → form-element-d4e7bcdb.js} +2 -2
- package/foundation-2334d146.mjs +60 -0
- package/{foundation-62d4413d.js → foundation-3f55a9dc.js} +3 -24
- package/{foundation-3f556da7.mjs → foundation-c580100a.mjs} +28 -78
- package/foundation-e830bd94.js +22 -0
- package/icon-button.js +5 -5
- package/icon-button.mjs +12 -12
- package/icon-check-toggle.js +5 -5
- package/icon-check-toggle.mjs +15 -15
- package/icon-radio-toggle.js +4 -4
- package/icon-radio-toggle.mjs +15 -15
- package/icon.js +1 -1
- package/icon.mjs +3 -3
- package/{if-defined-c367f208.mjs → if-defined-639ed018.mjs} +1 -1
- package/if-defined-cb12d481.js +5 -0
- package/index.js +1 -1
- package/index.mjs +121 -120
- package/linear-progress.js +6 -6
- package/linear-progress.mjs +13 -13
- package/{list-066f5de4.mjs → list-d616957b.mjs} +3 -3
- package/{list-05db7fed.js → list-defdaa3b.js} +2 -2
- package/list-expansion.js +4 -4
- package/list-expansion.mjs +25 -25
- package/{list-item-8da7ba96.js → list-item-3fa66f09.js} +3 -3
- package/{list-item-ba77097d.mjs → list-item-d5c05e10.mjs} +6 -6
- package/list-item.js +1 -1
- package/list-item.mjs +13 -13
- package/list.js +1 -1
- package/list.mjs +15 -15
- package/menu.js +1 -1
- package/menu.mjs +15 -15
- package/{mwc-checkbox-base-3da36456.mjs → mwc-checkbox-base-10e977f2.mjs} +21 -21
- package/{mwc-checkbox-base-d46c7666.js → mwc-checkbox-base-435c1f1d.js} +9 -9
- package/{mwc-checkbox.css-b3434429.js → mwc-checkbox.css-956e3d6c.js} +1 -1
- package/{mwc-checkbox.css-8f4f1a9b.mjs → mwc-checkbox.css-b7abc7fd.mjs} +1 -1
- package/{mwc-drawer-base-fe660bdf.mjs → mwc-drawer-base-b2b772c3.mjs} +10 -10
- package/{mwc-drawer-base-8eecb1de.js → mwc-drawer-base-f44fcf34.js} +6 -6
- package/{mwc-icon-8c9cd0c9.js → mwc-icon-b96fb867.js} +2 -2
- package/{mwc-icon-ba18383d.mjs → mwc-icon-c7013880.mjs} +2 -2
- package/{mwc-line-ripple-directive-d1cf9570.js → mwc-line-ripple-directive-a97ce725.js} +3 -3
- package/{mwc-line-ripple-directive-ffce2cff.mjs → mwc-line-ripple-directive-c3e1f04a.mjs} +6 -6
- package/{mwc-list-base-cb3500b4.js → mwc-list-base-7d5f7278.js} +4 -4
- package/{mwc-list-base-32d4ac31.mjs → mwc-list-base-c0f8af1c.mjs} +9 -9
- package/{mwc-list-item-base-4a4d1e1b.js → mwc-list-item-base-803b9771.js} +8 -8
- package/{mwc-list-item-base-8654347d.mjs → mwc-list-item-base-acef0223.mjs} +7 -7
- package/{mwc-list-item.css-25adc0c4.js → mwc-list-item.css-401e2407.js} +1 -1
- package/{mwc-list-item.css-b0009fc7.mjs → mwc-list-item.css-b5481d96.mjs} +1 -1
- package/{mwc-menu-base-572a76b9.mjs → mwc-menu-base-8970b43d.mjs} +11 -11
- package/{mwc-menu-base-f14ec544.js → mwc-menu-base-ac49fe54.js} +17 -17
- package/{mwc-radio-base-470b4fcc.js → mwc-radio-base-442d495a.js} +4 -4
- package/{mwc-radio-base-9446d39b.mjs → mwc-radio-base-c29e6f42.mjs} +11 -11
- package/{mwc-radio.css-4e140252.js → mwc-radio.css-388ad26d.js} +1 -1
- package/{mwc-radio.css-7454bb11.mjs → mwc-radio.css-4694aa9c.mjs} +1 -1
- package/{mwc-slider.css-10adbaf8.mjs → mwc-slider.css-336f809b.mjs} +12 -12
- package/{mwc-slider.css-9dd57b10.js → mwc-slider.css-48f02f1e.js} +11 -11
- package/{mwc-tab-base-fc3ffb43.js → mwc-tab-base-1a19b299.js} +13 -13
- package/{mwc-tab-base-4ba47acc.mjs → mwc-tab-base-7fb3d339.mjs} +14 -14
- package/{mwc-top-app-bar-base-0304e67f.js → mwc-top-app-bar-base-14e0a018.js} +8 -8
- package/{mwc-top-app-bar-base-adc4168a.mjs → mwc-top-app-bar-base-79c87e69.mjs} +24 -22
- package/nav-list-item.js +2 -2
- package/nav-list-item.mjs +13 -13
- package/package.json +1 -1
- package/{property-57f6f6fe.js → property-074570d1.js} +1 -1
- package/{property-9b6ea53b.mjs → property-ca27685b.mjs} +9 -9
- package/{query-d843aa92.mjs → query-1e7846ea.mjs} +1 -1
- package/{query-680f1868.js → query-2ba749b7.js} +1 -1
- package/query-assigned-elements-07e38f46.js +33 -0
- package/{query-assigned-elements-4a39219d.mjs → query-assigned-elements-514e5265.mjs} +152 -153
- package/{query-assigned-nodes-99eae71d.js → query-assigned-nodes-9ec0fa5f.js} +1 -1
- package/{query-assigned-nodes-df691e78.mjs → query-assigned-nodes-bea12e0c.mjs} +1 -1
- package/radio-list-item.js +3 -3
- package/radio-list-item.mjs +18 -18
- package/radio.js +1 -1
- package/radio.mjs +15 -15
- package/{ripple-handlers-c82b1232.js → ripple-handlers-2176f137.js} +5 -5
- package/{ripple-handlers-321219b8.mjs → ripple-handlers-227497d3.mjs} +10 -10
- package/select.js +10 -10
- package/select.mjs +20 -20
- package/side-sheet.js +2 -2
- package/side-sheet.mjs +21 -21
- package/slider-range.js +7 -7
- package/slider-range.mjs +13 -13
- package/slider.js +3 -3
- package/slider.mjs +15 -15
- package/snackbar.js +6 -6
- package/snackbar.mjs +12 -12
- package/{state-b5e865db.mjs → state-6f7e570d.mjs} +1 -1
- package/state-949232e6.js +5 -0
- package/status-header-item.js +3 -3
- package/status-header-item.mjs +15 -15
- package/status-header.js +2 -2
- package/status-header.mjs +3 -3
- package/style-map-2cb0fb63.mjs +40 -0
- package/style-map-3056a771.js +5 -0
- package/style.css +1 -1
- package/switch.js +8 -8
- package/switch.mjs +13 -13
- package/tab-bar.js +5 -5
- package/tab-bar.mjs +16 -16
- package/tab.js +1 -1
- package/tab.mjs +12 -12
- package/text-lockup.js +4 -4
- package/text-lockup.mjs +7 -7
- package/textarea.js +4 -4
- package/textarea.mjs +26 -26
- package/{textfield-2cee5a1a.mjs → textfield-276b0ded.mjs} +14 -14
- package/{textfield-0993c163.js → textfield-507c6a06.js} +12 -12
- package/textfield.js +1 -1
- package/textfield.mjs +14 -14
- package/toolbar.js +1 -1
- package/toolbar.mjs +8 -8
- package/tooltip/tooltip.d.ts.map +1 -1
- package/tooltip.js +11 -32
- package/tooltip.mjs +516 -611
- package/{top-app-bar-a531c1b4.js → top-app-bar-34e85527.js} +1 -1
- package/{top-app-bar-f83386e0.mjs → top-app-bar-a236c3bc.mjs} +1 -1
- package/top-app-bar-fixed.js +5 -89
- package/top-app-bar-fixed.mjs +37 -279
- package/top-app-bar.js +1 -1
- package/top-app-bar.mjs +9 -9
- package/tree-list-item.js +7 -7
- package/tree-list-item.mjs +6 -6
- package/tree-list.js +2 -2
- package/tree-list.mjs +1 -1
- package/tslib.es6-6b53b818.js +1 -0
- package/tslib.es6-b5e819a6.mjs +82 -0
- package/typography.js +3 -3
- package/typography.mjs +2 -2
- package/{utils-2932417c.mjs → utils-dc65fdc9.mjs} +2 -2
- package/class-map-4b94b017.mjs +0 -62
- package/class-map-b5efe8da.js +0 -9
- package/if-defined-f1c45245.js +0 -5
- package/query-assigned-elements-f623705d.js +0 -31
- package/state-0974a8e5.js +0 -5
- package/style-map-88d2563f.js +0 -5
- package/style-map-bc3ed3e0.mjs +0 -44
- package/tslib.es6-e6a11c8a.js +0 -1
- package/tslib.es6-f1eaf65c.mjs +0 -82
package/radio-list-item.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./tslib.es6-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./tslib.es6-6b53b818.js"),c=require("./query-assigned-elements-07e38f46.js"),u=require("./mwc-radio-base-442d495a.js"),_=require("./property-074570d1.js"),b=require("./query-2ba749b7.js"),p=require("./class-map-50b8edb4.js"),g=require("./if-defined-cb12d481.js"),h=require("./mwc-list-item-base-803b9771.js"),m=require("./mwc-list-item.css-401e2407.js");require("./ripple-handlers-2176f137.js");require("./base-element-d5abe37a.js");require("./utils-a8190a39.js");require("./state-949232e6.js");require("./style-map-3056a771.js");require("./aria-property-849c8816.js");require("./form-element-d4e7bcdb.js");require("./observer-a096ab43.js");require("./event-options-7bc382d8.js");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2021 Google LLC
|
4
4
|
* SPDX-LIcense-Identifier: Apache-2.0
|
@@ -10,7 +10,7 @@
|
|
10
10
|
* @license
|
11
11
|
* Copyright 2020 Google LLC
|
12
12
|
* SPDX-License-Identifier: Apache-2.0
|
13
|
-
*/class n extends h.ListItemBase{constructor(){super(...arguments),this.left=!1,this.graphic="control",this._changeFromClick=!1}render(){const d={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},r=this.renderText(),e=this.graphic&&this.graphic!=="control"&&!this.left?this.renderGraphic():c.
|
13
|
+
*/class n extends h.ListItemBase{constructor(){super(...arguments),this.left=!1,this.graphic="control",this._changeFromClick=!1}render(){const d={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},r=this.renderText(),e=this.graphic&&this.graphic!=="control"&&!this.left?this.renderGraphic():c.y``,o=this.hasMeta&&this.left?this.renderMeta():c.y``,a=this.renderRipple();return c.y`
|
14
14
|
${a}
|
15
15
|
${e}
|
16
16
|
${this.left?"":r}
|
@@ -24,4 +24,4 @@
|
|
24
24
|
@checked=${this.onChange}>
|
25
25
|
</mwc-radio>
|
26
26
|
${this.left?r:""}
|
27
|
-
${o}`}onClick(){this._changeFromClick=!0,super.onClick()}async onChange(d){const r=d.target;this.selected===r.checked||(this._skipPropRequest=!0,this.selected=r.checked,await this.updateComplete,this._skipPropRequest=!1,this._changeFromClick||this.fireRequestSelected(this.selected,"interaction")),this._changeFromClick=!1}}t.__decorate([b.i("slot")],n.prototype,"slotElement",void 0);t.__decorate([b.i("mwc-radio")],n.prototype,"radioElement",void 0);t.__decorate([_.
|
27
|
+
${o}`}onClick(){this._changeFromClick=!0,super.onClick()}async onChange(d){const r=d.target;this.selected===r.checked||(this._skipPropRequest=!0,this.selected=r.checked,await this.updateComplete,this._skipPropRequest=!1,this._changeFromClick||this.fireRequestSelected(this.selected,"interaction")),this._changeFromClick=!1}}t.__decorate([b.i("slot")],n.prototype,"slotElement",void 0);t.__decorate([b.i("mwc-radio")],n.prototype,"radioElement",void 0);t.__decorate([_.e({type:Boolean})],n.prototype,"left",void 0);t.__decorate([_.e({type:String,reflect:!0})],n.prototype,"graphic",void 0);var k=Object.defineProperty,v=Object.getOwnPropertyDescriptor,x=(i,d,r,e)=>{for(var o=e>1?void 0:e?v(d,r):d,a=i.length-1,s;a>=0;a--)(s=i[a])&&(o=(e?s(d,r,o):s(o))||o);return e&&o&&k(d,r,o),o};exports.CovalentRadioListItem=class extends n{};exports.CovalentRadioListItem.styles=[m.styles,m.styles$1];exports.CovalentRadioListItem=x([c.e("cv-radio-list-item")],exports.CovalentRadioListItem);const y=exports.CovalentRadioListItem;exports.default=y;
|
package/radio-list-item.mjs
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
import { i as u, e as _,
|
3
|
-
import { R as h } from "./mwc-radio-base-
|
4
|
-
import {
|
5
|
-
import { i as p } from "./query-
|
6
|
-
import { o as g } from "./class-map-
|
7
|
-
import { l as f } from "./if-defined-
|
8
|
-
import { L as k } from "./mwc-list-item-base-
|
9
|
-
import { s as v, a as x } from "./mwc-list-item.css-
|
10
|
-
import "./ripple-handlers-
|
11
|
-
import "./base-element-
|
12
|
-
import "./utils-
|
13
|
-
import "./state-
|
14
|
-
import "./style-map-
|
1
|
+
import { _ as e } from "./tslib.es6-b5e819a6.mjs";
|
2
|
+
import { i as u, e as _, y as s } from "./query-assigned-elements-514e5265.mjs";
|
3
|
+
import { R as h } from "./mwc-radio-base-c29e6f42.mjs";
|
4
|
+
import { e as b } from "./property-ca27685b.mjs";
|
5
|
+
import { i as p } from "./query-1e7846ea.mjs";
|
6
|
+
import { o as g } from "./class-map-08c84aeb.mjs";
|
7
|
+
import { l as f } from "./if-defined-639ed018.mjs";
|
8
|
+
import { L as k } from "./mwc-list-item-base-acef0223.mjs";
|
9
|
+
import { s as v, a as x } from "./mwc-list-item.css-b5481d96.mjs";
|
10
|
+
import "./ripple-handlers-227497d3.mjs";
|
11
|
+
import "./base-element-c3dc926e.mjs";
|
12
|
+
import "./utils-dc65fdc9.mjs";
|
13
|
+
import "./state-6f7e570d.mjs";
|
14
|
+
import "./style-map-2cb0fb63.mjs";
|
15
15
|
import "./aria-property-fa2717fe.mjs";
|
16
|
-
import "./form-element-
|
16
|
+
import "./form-element-6dbd7afa.mjs";
|
17
17
|
import "./observer-be7b92e2.mjs";
|
18
|
-
import "./event-options-
|
18
|
+
import "./event-options-3937d997.mjs";
|
19
19
|
/**
|
20
20
|
* @license
|
21
21
|
* Copyright 2021 Google LLC
|
@@ -83,7 +83,7 @@ e([
|
|
83
83
|
e([
|
84
84
|
b({ type: String, reflect: !0 })
|
85
85
|
], a.prototype, "graphic", void 0);
|
86
|
-
var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor,
|
86
|
+
var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor, $ = (t, d, r, c) => {
|
87
87
|
for (var o = c > 1 ? void 0 : c ? z(d, r) : d, i = t.length - 1, m; i >= 0; i--)
|
88
88
|
(m = t[i]) && (o = (c ? m(d, r, o) : m(o)) || o);
|
89
89
|
return c && o && w(d, r, o), o;
|
@@ -91,7 +91,7 @@ var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor, C = (t, d, r
|
|
91
91
|
let n = class extends a {
|
92
92
|
};
|
93
93
|
n.styles = [v, x];
|
94
|
-
n =
|
94
|
+
n = $([
|
95
95
|
_("cv-radio-list-item")
|
96
96
|
], n);
|
97
97
|
const K = n;
|
package/radio.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./query-assigned-elements-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./query-assigned-elements-07e38f46.js"),n=require("./mwc-radio-base-442d495a.js"),l=require("./mwc-radio.css-388ad26d.js");require("./tslib.es6-6b53b818.js");require("./ripple-handlers-2176f137.js");require("./base-element-d5abe37a.js");require("./utils-a8190a39.js");require("./property-074570d1.js");require("./state-949232e6.js");require("./query-2ba749b7.js");require("./class-map-50b8edb4.js");require("./style-map-3056a771.js");require("./aria-property-849c8816.js");require("./form-element-d4e7bcdb.js");require("./observer-a096ab43.js");require("./event-options-7bc382d8.js");require("./if-defined-cb12d481.js");const c=`:host{--mdc-radio-unchecked-color: var(--mdc-theme-text-icon-on-background)}
|
2
2
|
`;var d=Object.defineProperty,q=Object.getOwnPropertyDescriptor,v=(i,r,t,o)=>{for(var e=o>1?void 0:o?q(r,t):r,s=i.length-1,a;s>=0;s--)(a=i[s])&&(e=(o?a(r,t,e):a(e))||e);return o&&e&&d(r,t,e),e};exports.CovalentRadio=class extends n.RadioBase{};exports.CovalentRadio.styles=[l.styles,u.i`${u.r(c)}`];exports.CovalentRadio=v([u.e("cv-radio")],exports.CovalentRadio);const R=exports.CovalentRadio;exports.default=R;
|
package/radio.mjs
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import { i as a, r as c, e as l } from "./query-assigned-elements-
|
2
|
-
import { R as n } from "./mwc-radio-base-
|
3
|
-
import { s as v } from "./mwc-radio.css-
|
4
|
-
import "./tslib.es6-
|
5
|
-
import "./ripple-handlers-
|
6
|
-
import "./base-element-
|
7
|
-
import "./utils-
|
8
|
-
import "./property-
|
9
|
-
import "./state-
|
10
|
-
import "./query-
|
11
|
-
import "./class-map-
|
12
|
-
import "./style-map-
|
1
|
+
import { i as a, r as c, e as l } from "./query-assigned-elements-514e5265.mjs";
|
2
|
+
import { R as n } from "./mwc-radio-base-c29e6f42.mjs";
|
3
|
+
import { s as v } from "./mwc-radio.css-4694aa9c.mjs";
|
4
|
+
import "./tslib.es6-b5e819a6.mjs";
|
5
|
+
import "./ripple-handlers-227497d3.mjs";
|
6
|
+
import "./base-element-c3dc926e.mjs";
|
7
|
+
import "./utils-dc65fdc9.mjs";
|
8
|
+
import "./property-ca27685b.mjs";
|
9
|
+
import "./state-6f7e570d.mjs";
|
10
|
+
import "./query-1e7846ea.mjs";
|
11
|
+
import "./class-map-08c84aeb.mjs";
|
12
|
+
import "./style-map-2cb0fb63.mjs";
|
13
13
|
import "./aria-property-fa2717fe.mjs";
|
14
|
-
import "./form-element-
|
14
|
+
import "./form-element-6dbd7afa.mjs";
|
15
15
|
import "./observer-be7b92e2.mjs";
|
16
|
-
import "./event-options-
|
17
|
-
import "./if-defined-
|
16
|
+
import "./event-options-3937d997.mjs";
|
17
|
+
import "./if-defined-639ed018.mjs";
|
18
18
|
const d = `:host{--mdc-radio-unchecked-color: var(--mdc-theme-text-icon-on-background)}
|
19
19
|
`;
|
20
20
|
var f = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, u = (s, r, i, t) => {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";const h=require("./query-assigned-elements-
|
1
|
+
"use strict";const h=require("./query-assigned-elements-07e38f46.js"),o=require("./tslib.es6-6b53b818.js"),S=require("./base-element-d5abe37a.js"),u=require("./property-074570d1.js"),l=require("./state-949232e6.js"),H=require("./query-2ba749b7.js"),D=require("./class-map-50b8edb4.js"),k=require("./style-map-3056a771.js");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2017 Google LLC
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -65,7 +65,7 @@
|
|
65
65
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
66
66
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
67
67
|
* THE SOFTWARE.
|
68
|
-
*/var M={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},B={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},C={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function U(s,t,e){if(!s)return{x:0,y:0};var r=t.x,a=t.y,i=r+e.left,c=a+e.top,n
|
68
|
+
*/var M={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},B={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},C={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function U(s,t,e){if(!s)return{x:0,y:0};var r=t.x,a=t.y,i=r+e.left,c=a+e.top,d,n;if(s.type==="touchstart"){var m=s;d=m.changedTouches[0].pageX-i,n=m.changedTouches[0].pageY-c}else{var f=s;d=f.pageX-i,n=f.pageY-c}return{x:d,y:n}}/**
|
69
69
|
* @license
|
70
70
|
* Copyright 2016 Google Inc.
|
71
71
|
*
|
@@ -86,13 +86,13 @@
|
|
86
86
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
87
87
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
88
88
|
* THE SOFTWARE.
|
89
|
-
*/var w=["touchstart","pointerdown","mousedown","keydown"],R=["touchend","pointerup","mouseup","contextmenu"],v=[],G=function(s){o.__extends(t,s);function t(e){var r=s.call(this,o.__assign(o.__assign({},t.defaultAdapter),e))||this;return r.activationAnimationHasEnded=!1,r.activationTimer=0,r.fgDeactivationRemovalTimer=0,r.fgScale="0",r.frame={width:0,height:0},r.initialSize=0,r.layoutFrame=0,r.maxRadius=0,r.unboundedCoords={left:0,top:0},r.activationState=r.defaultActivationState(),r.activationTimerCallback=function(){r.activationAnimationHasEnded=!0,r.runDeactivationUXLogicIfReady()},r.activateHandler=function(a){r.activateImpl(a)},r.deactivateHandler=function(){r.deactivateImpl()},r.focusHandler=function(){r.handleFocus()},r.blurHandler=function(){r.handleBlur()},r.resizeHandler=function(){r.layout()},r}return Object.defineProperty(t,"cssClasses",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return B},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=this,r=this.supportsPressRipple();if(this.registerRootHandlers(r),r){var a=t.cssClasses,i=a.ROOT,c=a.UNBOUNDED;requestAnimationFrame(function(){e.adapter.addClass(i),e.adapter.isUnbounded()&&(e.adapter.addClass(c),e.layoutInternal())})}},t.prototype.destroy=function(){var e=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(t.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(t.cssClasses.FG_DEACTIVATION));var r=t.cssClasses,a=r.ROOT,i=r.UNBOUNDED;requestAnimationFrame(function(){e.adapter.removeClass(a),e.adapter.removeClass(i),e.removeCssVars()})}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},t.prototype.activate=function(e){this.activateImpl(e)},t.prototype.deactivate=function(){this.deactivateImpl()},t.prototype.layout=function(){var e=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(function(){e.layoutInternal(),e.layoutFrame=0})},t.prototype.setUnbounded=function(e){var r=t.cssClasses.UNBOUNDED;e?this.adapter.addClass(r):this.adapter.removeClass(r)},t.prototype.handleFocus=function(){var e=this;requestAnimationFrame(function(){return e.adapter.addClass(t.cssClasses.BG_FOCUSED)})},t.prototype.handleBlur=function(){var e=this;requestAnimationFrame(function(){return e.adapter.removeClass(t.cssClasses.BG_FOCUSED)})},t.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},t.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},t.prototype.registerRootHandlers=function(e){var r,a;if(e){try{for(var i=o.__values(w),c=i.next();!c.done;c=i.next()){var n=c.value;this.adapter.registerInteractionHandler(n,this.activateHandler)}}catch(d){r={error:d}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},t.prototype.registerDeactivationHandlers=function(e){var r,a;if(e.type==="keydown")this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var i=o.__values(R),c=i.next();!c.done;c=i.next()){var n=c.value;this.adapter.registerDocumentInteractionHandler(n,this.deactivateHandler)}}catch(d){r={error:d}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}},t.prototype.deregisterRootHandlers=function(){var e,r;try{for(var a=o.__values(w),i=a.next();!i.done;i=a.next()){var c=i.value;this.adapter.deregisterInteractionHandler(c,this.activateHandler)}}catch(n){e={error:n}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},t.prototype.deregisterDeactivationHandlers=function(){var e,r;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var a=o.__values(R),i=a.next();!i.done;i=a.next()){var c=i.value;this.adapter.deregisterDocumentInteractionHandler(c,this.deactivateHandler)}}catch(n){e={error:n}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},t.prototype.removeCssVars=function(){var e=this,r=t.strings,a=Object.keys(r);a.forEach(function(i){i.indexOf("VAR_")===0&&e.adapter.updateCssVariable(r[i],null)})},t.prototype.activateImpl=function(e){var r=this;if(!this.adapter.isSurfaceDisabled()){var a=this.activationState;if(!a.isActivated){var i=this.previousActivationEvent,c=i&&e!==void 0&&i.type!==e.type;if(!c){a.isActivated=!0,a.isProgrammatic=e===void 0,a.activationEvent=e,a.wasActivatedByPointer=a.isProgrammatic?!1:e!==void 0&&(e.type==="mousedown"||e.type==="touchstart"||e.type==="pointerdown");var n=e!==void 0&&v.length>0&&v.some(function(d){return r.adapter.containsEventTarget(d)});if(n){this.resetActivationState();return}e!==void 0&&(v.push(e.target),this.registerDeactivationHandlers(e)),a.wasElementMadeActive=this.checkElementMadeActive(e),a.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame(function(){v=[],!a.wasElementMadeActive&&e!==void 0&&(e.key===" "||e.keyCode===32)&&(a.wasElementMadeActive=r.checkElementMadeActive(e),a.wasElementMadeActive&&r.animateActivation()),a.wasElementMadeActive||(r.activationState=r.defaultActivationState())})}}}},t.prototype.checkElementMadeActive=function(e){return e!==void 0&&e.type==="keydown"?this.adapter.isSurfaceActive():!0},t.prototype.animateActivation=function(){var e=this,r=t.strings,a=r.VAR_FG_TRANSLATE_START,i=r.VAR_FG_TRANSLATE_END,c=t.cssClasses,n=c.FG_DEACTIVATION,d=c.FG_ACTIVATION,m=t.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var f="",g="";if(!this.adapter.isUnbounded()){var b=this.getFgTranslationCoordinates(),A=b.startPoint,F=b.endPoint;f=A.x+"px, "+A.y+"px",g=F.x+"px, "+F.y+"px"}this.adapter.updateCssVariable(a,f),this.adapter.updateCssVariable(i,g),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(n),this.adapter.computeBoundingRect(),this.adapter.addClass(d),this.activationTimer=setTimeout(function(){e.activationTimerCallback()},m)},t.prototype.getFgTranslationCoordinates=function(){var e=this.activationState,r=e.activationEvent,a=e.wasActivatedByPointer,i;a?i=U(r,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):i={x:this.frame.width/2,y:this.frame.height/2},i={x:i.x-this.initialSize/2,y:i.y-this.initialSize/2};var c={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:i,endPoint:c}},t.prototype.runDeactivationUXLogicIfReady=function(){var e=this,r=t.cssClasses.FG_DEACTIVATION,a=this.activationState,i=a.hasDeactivationUXRun,c=a.isActivated,n=i||!c;n&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(r),this.fgDeactivationRemovalTimer=setTimeout(function(){e.adapter.removeClass(r)},C.FG_DEACTIVATION_MS))},t.prototype.rmBoundedActivationClasses=function(){var e=t.cssClasses.FG_ACTIVATION;this.adapter.removeClass(e),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},t.prototype.resetActivationState=function(){var e=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout(function(){return e.previousActivationEvent=void 0},t.numbers.TAP_DELAY_MS)},t.prototype.deactivateImpl=function(){var e=this,r=this.activationState;if(r.isActivated){var a=o.__assign({},r);r.isProgrammatic?(requestAnimationFrame(function(){e.animateDeactivation(a)}),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame(function(){e.activationState.hasDeactivationUXRun=!0,e.animateDeactivation(a),e.resetActivationState()}))}},t.prototype.animateDeactivation=function(e){var r=e.wasActivatedByPointer,a=e.wasElementMadeActive;(r||a)&&this.runDeactivationUXLogicIfReady()},t.prototype.layoutInternal=function(){var e=this;this.frame=this.adapter.computeBoundingRect();var r=Math.max(this.frame.height,this.frame.width),a=function(){var c=Math.sqrt(Math.pow(e.frame.width,2)+Math.pow(e.frame.height,2));return c+t.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?r:a();var i=Math.floor(r*t.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!==0?this.initialSize=i-1:this.initialSize=i,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},t.prototype.updateLayoutCssVars=function(){var e=t.strings,r=e.VAR_FG_SIZE,a=e.VAR_LEFT,i=e.VAR_TOP,c=e.VAR_FG_SCALE;this.adapter.updateCssVariable(r,this.initialSize+"px"),this.adapter.updateCssVariable(c,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(a,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(i,this.unboundedCoords.top+"px"))},t}(x);const L=G;/**
|
89
|
+
*/var w=["touchstart","pointerdown","mousedown","keydown"],R=["touchend","pointerup","mouseup","contextmenu"],v=[],G=function(s){o.__extends(t,s);function t(e){var r=s.call(this,o.__assign(o.__assign({},t.defaultAdapter),e))||this;return r.activationAnimationHasEnded=!1,r.activationTimer=0,r.fgDeactivationRemovalTimer=0,r.fgScale="0",r.frame={width:0,height:0},r.initialSize=0,r.layoutFrame=0,r.maxRadius=0,r.unboundedCoords={left:0,top:0},r.activationState=r.defaultActivationState(),r.activationTimerCallback=function(){r.activationAnimationHasEnded=!0,r.runDeactivationUXLogicIfReady()},r.activateHandler=function(a){r.activateImpl(a)},r.deactivateHandler=function(){r.deactivateImpl()},r.focusHandler=function(){r.handleFocus()},r.blurHandler=function(){r.handleBlur()},r.resizeHandler=function(){r.layout()},r}return Object.defineProperty(t,"cssClasses",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return B},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=this,r=this.supportsPressRipple();if(this.registerRootHandlers(r),r){var a=t.cssClasses,i=a.ROOT,c=a.UNBOUNDED;requestAnimationFrame(function(){e.adapter.addClass(i),e.adapter.isUnbounded()&&(e.adapter.addClass(c),e.layoutInternal())})}},t.prototype.destroy=function(){var e=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(t.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(t.cssClasses.FG_DEACTIVATION));var r=t.cssClasses,a=r.ROOT,i=r.UNBOUNDED;requestAnimationFrame(function(){e.adapter.removeClass(a),e.adapter.removeClass(i),e.removeCssVars()})}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},t.prototype.activate=function(e){this.activateImpl(e)},t.prototype.deactivate=function(){this.deactivateImpl()},t.prototype.layout=function(){var e=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame(function(){e.layoutInternal(),e.layoutFrame=0})},t.prototype.setUnbounded=function(e){var r=t.cssClasses.UNBOUNDED;e?this.adapter.addClass(r):this.adapter.removeClass(r)},t.prototype.handleFocus=function(){var e=this;requestAnimationFrame(function(){return e.adapter.addClass(t.cssClasses.BG_FOCUSED)})},t.prototype.handleBlur=function(){var e=this;requestAnimationFrame(function(){return e.adapter.removeClass(t.cssClasses.BG_FOCUSED)})},t.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},t.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},t.prototype.registerRootHandlers=function(e){var r,a;if(e){try{for(var i=o.__values(w),c=i.next();!c.done;c=i.next()){var d=c.value;this.adapter.registerInteractionHandler(d,this.activateHandler)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},t.prototype.registerDeactivationHandlers=function(e){var r,a;if(e.type==="keydown")this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var i=o.__values(R),c=i.next();!c.done;c=i.next()){var d=c.value;this.adapter.registerDocumentInteractionHandler(d,this.deactivateHandler)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}},t.prototype.deregisterRootHandlers=function(){var e,r;try{for(var a=o.__values(w),i=a.next();!i.done;i=a.next()){var c=i.value;this.adapter.deregisterInteractionHandler(c,this.activateHandler)}}catch(d){e={error:d}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},t.prototype.deregisterDeactivationHandlers=function(){var e,r;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var a=o.__values(R),i=a.next();!i.done;i=a.next()){var c=i.value;this.adapter.deregisterDocumentInteractionHandler(c,this.deactivateHandler)}}catch(d){e={error:d}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},t.prototype.removeCssVars=function(){var e=this,r=t.strings,a=Object.keys(r);a.forEach(function(i){i.indexOf("VAR_")===0&&e.adapter.updateCssVariable(r[i],null)})},t.prototype.activateImpl=function(e){var r=this;if(!this.adapter.isSurfaceDisabled()){var a=this.activationState;if(!a.isActivated){var i=this.previousActivationEvent,c=i&&e!==void 0&&i.type!==e.type;if(!c){a.isActivated=!0,a.isProgrammatic=e===void 0,a.activationEvent=e,a.wasActivatedByPointer=a.isProgrammatic?!1:e!==void 0&&(e.type==="mousedown"||e.type==="touchstart"||e.type==="pointerdown");var d=e!==void 0&&v.length>0&&v.some(function(n){return r.adapter.containsEventTarget(n)});if(d){this.resetActivationState();return}e!==void 0&&(v.push(e.target),this.registerDeactivationHandlers(e)),a.wasElementMadeActive=this.checkElementMadeActive(e),a.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame(function(){v=[],!a.wasElementMadeActive&&e!==void 0&&(e.key===" "||e.keyCode===32)&&(a.wasElementMadeActive=r.checkElementMadeActive(e),a.wasElementMadeActive&&r.animateActivation()),a.wasElementMadeActive||(r.activationState=r.defaultActivationState())})}}}},t.prototype.checkElementMadeActive=function(e){return e!==void 0&&e.type==="keydown"?this.adapter.isSurfaceActive():!0},t.prototype.animateActivation=function(){var e=this,r=t.strings,a=r.VAR_FG_TRANSLATE_START,i=r.VAR_FG_TRANSLATE_END,c=t.cssClasses,d=c.FG_DEACTIVATION,n=c.FG_ACTIVATION,m=t.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var f="",g="";if(!this.adapter.isUnbounded()){var b=this.getFgTranslationCoordinates(),A=b.startPoint,F=b.endPoint;f=A.x+"px, "+A.y+"px",g=F.x+"px, "+F.y+"px"}this.adapter.updateCssVariable(a,f),this.adapter.updateCssVariable(i,g),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(d),this.adapter.computeBoundingRect(),this.adapter.addClass(n),this.activationTimer=setTimeout(function(){e.activationTimerCallback()},m)},t.prototype.getFgTranslationCoordinates=function(){var e=this.activationState,r=e.activationEvent,a=e.wasActivatedByPointer,i;a?i=U(r,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):i={x:this.frame.width/2,y:this.frame.height/2},i={x:i.x-this.initialSize/2,y:i.y-this.initialSize/2};var c={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:i,endPoint:c}},t.prototype.runDeactivationUXLogicIfReady=function(){var e=this,r=t.cssClasses.FG_DEACTIVATION,a=this.activationState,i=a.hasDeactivationUXRun,c=a.isActivated,d=i||!c;d&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(r),this.fgDeactivationRemovalTimer=setTimeout(function(){e.adapter.removeClass(r)},C.FG_DEACTIVATION_MS))},t.prototype.rmBoundedActivationClasses=function(){var e=t.cssClasses.FG_ACTIVATION;this.adapter.removeClass(e),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},t.prototype.resetActivationState=function(){var e=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout(function(){return e.previousActivationEvent=void 0},t.numbers.TAP_DELAY_MS)},t.prototype.deactivateImpl=function(){var e=this,r=this.activationState;if(r.isActivated){var a=o.__assign({},r);r.isProgrammatic?(requestAnimationFrame(function(){e.animateDeactivation(a)}),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame(function(){e.activationState.hasDeactivationUXRun=!0,e.animateDeactivation(a),e.resetActivationState()}))}},t.prototype.animateDeactivation=function(e){var r=e.wasActivatedByPointer,a=e.wasElementMadeActive;(r||a)&&this.runDeactivationUXLogicIfReady()},t.prototype.layoutInternal=function(){var e=this;this.frame=this.adapter.computeBoundingRect();var r=Math.max(this.frame.height,this.frame.width),a=function(){var c=Math.sqrt(Math.pow(e.frame.width,2)+Math.pow(e.frame.height,2));return c+t.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?r:a();var i=Math.floor(r*t.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!==0?this.initialSize=i-1:this.initialSize=i,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},t.prototype.updateLayoutCssVars=function(){var e=t.strings,r=e.VAR_FG_SIZE,a=e.VAR_LEFT,i=e.VAR_TOP,c=e.VAR_FG_SCALE;this.adapter.updateCssVariable(r,this.initialSize+"px"),this.adapter.updateCssVariable(c,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(a,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(i,this.unboundedCoords.top+"px"))},t}(x);const L=G;/**
|
90
90
|
* @license
|
91
91
|
* Copyright 2018 Google LLC
|
92
92
|
* SPDX-License-Identifier: Apache-2.0
|
93
|
-
*/class p extends S.BaseElement{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=L}get isActive(){return _(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0;break}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1;break}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e;break}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation(()=>{this.mdcFoundation.activate(t)})}endPress(){this.waitForFoundation(()=>{this.mdcFoundation.deactivate()})}startFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleFocus()})}endFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleBlur()})}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),e=this.selected&&(this.primary||!this.accent),r={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":e,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return h.
|
93
|
+
*/class p extends S.BaseElement{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=L}get isActive(){return _(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0;break}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1;break}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e;break}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation(()=>{this.mdcFoundation.activate(t)})}endPress(){this.waitForFoundation(()=>{this.mdcFoundation.deactivate()})}startFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleFocus()})}endFocus(){this.waitForFoundation(()=>{this.mdcFoundation.handleBlur()})}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),e=this.selected&&(this.primary||!this.accent),r={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":e,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return h.y`
|
94
94
|
<div class="mdc-ripple-surface mdc-ripple-upgraded ${D.o(r)}"
|
95
|
-
style="${k.
|
95
|
+
style="${k.i({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}o.__decorate([H.i(".mdc-ripple-surface")],p.prototype,"mdcRoot",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"primary",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"accent",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"unbounded",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"disabled",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"activated",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"selected",void 0);o.__decorate([u.e({type:Boolean})],p.prototype,"internalUseStateLayerCustomProperties",void 0);o.__decorate([l.t()],p.prototype,"hovering",void 0);o.__decorate([l.t()],p.prototype,"bgFocused",void 0);o.__decorate([l.t()],p.prototype,"fgActivation",void 0);o.__decorate([l.t()],p.prototype,"fgDeactivation",void 0);o.__decorate([l.t()],p.prototype,"fgScale",void 0);o.__decorate([l.t()],p.prototype,"fgSize",void 0);o.__decorate([l.t()],p.prototype,"translateStart",void 0);o.__decorate([l.t()],p.prototype,"translateEnd",void 0);o.__decorate([l.t()],p.prototype,"leftPos",void 0);o.__decorate([l.t()],p.prototype,"topPos",void 0);/**
|
96
96
|
* @license
|
97
97
|
* Copyright 2021 Google LLC
|
98
98
|
* SPDX-LIcense-Identifier: Apache-2.0
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { o as H,
|
2
|
-
import {
|
3
|
-
import { B } from "./base-element-
|
4
|
-
import {
|
5
|
-
import { t as l } from "./state-
|
6
|
-
import { i as M } from "./query-
|
7
|
-
import { o as U } from "./class-map-
|
8
|
-
import {
|
1
|
+
import { o as H, y as D, i as k, e as z } from "./query-assigned-elements-514e5265.mjs";
|
2
|
+
import { a as x, b as y, c as v, _ as p } from "./tslib.es6-b5e819a6.mjs";
|
3
|
+
import { B } from "./base-element-c3dc926e.mjs";
|
4
|
+
import { e as u } from "./property-ca27685b.mjs";
|
5
|
+
import { t as l } from "./state-6f7e570d.mjs";
|
6
|
+
import { i as M } from "./query-1e7846ea.mjs";
|
7
|
+
import { o as U } from "./class-map-08c84aeb.mjs";
|
8
|
+
import { i as G } from "./style-map-2cb0fb63.mjs";
|
9
9
|
/**
|
10
10
|
* @license
|
11
11
|
* Copyright 2017 Google LLC
|
@@ -194,7 +194,7 @@ var R = [
|
|
194
194
|
], h = [], q = (
|
195
195
|
/** @class */
|
196
196
|
function(o) {
|
197
|
-
|
197
|
+
x(t, o);
|
198
198
|
function t(e) {
|
199
199
|
var r = o.call(this, y(y({}, t.defaultAdapter), e)) || this;
|
200
200
|
return r.activationAnimationHasEnded = !1, r.activationTimer = 0, r.fgDeactivationRemovalTimer = 0, r.fgScale = "0", r.frame = { width: 0, height: 0 }, r.initialSize = 0, r.layoutFrame = 0, r.maxRadius = 0, r.unboundedCoords = { left: 0, top: 0 }, r.activationState = r.defaultActivationState(), r.activationTimerCallback = function() {
|
@@ -719,7 +719,7 @@ let g = class extends s {
|
|
719
719
|
};
|
720
720
|
g.styles = [$];
|
721
721
|
g = p([
|
722
|
-
|
722
|
+
z("mwc-ripple")
|
723
723
|
], g);
|
724
724
|
/**
|
725
725
|
* @license
|
package/select.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./query-assigned-elements-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./query-assigned-elements-07e38f46.js"),o=require("./tslib.es6-6b53b818.js"),N=require("./mwc-line-ripple-directive-a97ce725.js"),Q=require("./mwc-menu-base-ac49fe54.js");require("./mwc-icon-b96fb867.js");const Z=require("./form-element-d4e7bcdb.js"),S=require("./observer-a096ab43.js"),P=require("./utils-a8190a39.js"),v=require("./property-074570d1.js"),C=require("./state-949232e6.js"),J=require("./event-options-7bc382d8.js"),x=require("./query-2ba749b7.js"),L=require("./class-map-50b8edb4.js"),U=require("./if-defined-cb12d481.js");require("./base-element-d5abe37a.js");require("./mwc-list-base-7d5f7278.js");require("./mwc-list-item-base-803b9771.js");require("./ripple-handlers-2176f137.js");require("./style-map-3056a771.js");require("./query-assigned-nodes-9ec0fa5f.js");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2021 Google LLC
|
4
4
|
* SPDX-LIcense-Identifier: Apache-2.0
|
@@ -174,11 +174,11 @@
|
|
174
174
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
175
175
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
176
176
|
* THE SOFTWARE.
|
177
|
-
*/var ae=function(c){o.__extends(e,c);function e(t,i){i===void 0&&(i={});var d=c.call(this,o.__assign(o.__assign({},e.defaultAdapter),t))||this;return d.disabled=!1,d.isMenuOpen=!1,d.useDefaultValidation=!0,d.customValidity=!0,d.lastSelectedIndex=T.UNSET_INDEX,d.clickDebounceTimeout=0,d.recentlyClicked=!1,d.leadingIcon=i.leadingIcon,d.helperText=i.helperText,d}return Object.defineProperty(e,"cssClasses",{get:function(){return p},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!1,configurable:!0}),e.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},e.prototype.setSelectedIndex=function(t,i,d){i===void 0&&(i=!1),d===void 0&&(d=!1),!(t>=this.adapter.getMenuItemCount())&&(t===T.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),i&&this.adapter.closeMenu(),!d&&this.lastSelectedIndex!==t&&this.handleChange(),this.lastSelectedIndex=t)},e.prototype.setValue=function(t,i){i===void 0&&(i=!1);var d=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(d,!1,i)},e.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),i=this.adapter.getMenuItemValues();return t!==T.UNSET_INDEX?i[t]:""},e.prototype.getDisabled=function(){return this.disabled},e.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(p.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(p.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},e.prototype.openMenu=function(){this.adapter.addClass(p.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,i=this.adapter.hasClass(p.FOCUSED),d=t||i,l=this.adapter.hasClass(p.REQUIRED);this.notchOutline(d),this.adapter.floatLabel(d),this.adapter.setLabelRequired(l)}},e.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues(),i=t.indexOf(this.getValue());this.setSelectedIndex(i,!1,!0)},e.prototype.handleMenuOpened=function(){if(this.adapter.getMenuItemValues().length!==0){var t=this.getSelectedIndex(),i=t>=0?t:0;this.adapter.focusMenuItemAtIndex(i)}},e.prototype.handleMenuClosing=function(){this.adapter.setSelectAnchorAttr("aria-expanded","false")},e.prototype.handleMenuClosed=function(){this.adapter.removeClass(p.ACTIVATED),this.isMenuOpen=!1,this.adapter.isSelectAnchorFocused()||this.blur()},e.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue());var t=this.adapter.hasClass(p.REQUIRED);t&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},e.prototype.handleFocus=function(){this.adapter.addClass(p.FOCUSED),this.layout(),this.adapter.activateBottomLine()},e.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},e.prototype.handleClick=function(t){if(!(this.disabled||this.recentlyClicked)){if(this.setClickDebounceTimeout(),this.isMenuOpen){this.adapter.closeMenu();return}this.adapter.setRippleCenter(t),this.openMenu()}},e.prototype.handleKeydown=function(t){if(!(this.isMenuOpen||!this.adapter.hasClass(p.FOCUSED))){var i=b(t)===n.ENTER,d=b(t)===n.SPACEBAR,l=b(t)===n.ARROW_UP,a=b(t)===n.ARROW_DOWN,h=t.ctrlKey||t.metaKey;if(!h&&(!d&&t.key&&t.key.length===1||d&&this.adapter.isTypeaheadInProgress())){var s=d?" ":t.key,A=this.adapter.typeaheadMatchItem(s,this.getSelectedIndex());A>=0&&this.setSelectedIndex(A),t.preventDefault();return}!i&&!d&&!l&&!a||(this.openMenu(),t.preventDefault())}},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var i=this.adapter.hasClass(p.FOCUSED);if(t){var d=T.LABEL_SCALE,l=this.adapter.getLabelWidth()*d;this.adapter.notchOutline(l)}else i||this.adapter.closeOutline()}},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.getUseDefaultValidation=function(){return this.useDefaultValidation},e.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},e.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(p.INVALID),this.adapter.removeMenuClass(p.MENU_INVALID)):(this.adapter.addClass(p.INVALID),this.adapter.addMenuClass(p.MENU_INVALID)),this.syncHelperTextValidity(t)},e.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(p.REQUIRED)&&!this.adapter.hasClass(p.DISABLED)?this.getSelectedIndex()!==T.UNSET_INDEX&&(this.getSelectedIndex()!==0
|
177
|
+
*/var ae=function(c){o.__extends(e,c);function e(t,i){i===void 0&&(i={});var d=c.call(this,o.__assign(o.__assign({},e.defaultAdapter),t))||this;return d.disabled=!1,d.isMenuOpen=!1,d.useDefaultValidation=!0,d.customValidity=!0,d.lastSelectedIndex=T.UNSET_INDEX,d.clickDebounceTimeout=0,d.recentlyClicked=!1,d.leadingIcon=i.leadingIcon,d.helperText=i.helperText,d}return Object.defineProperty(e,"cssClasses",{get:function(){return p},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!1,configurable:!0}),e.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},e.prototype.setSelectedIndex=function(t,i,d){i===void 0&&(i=!1),d===void 0&&(d=!1),!(t>=this.adapter.getMenuItemCount())&&(t===T.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),i&&this.adapter.closeMenu(),!d&&this.lastSelectedIndex!==t&&this.handleChange(),this.lastSelectedIndex=t)},e.prototype.setValue=function(t,i){i===void 0&&(i=!1);var d=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(d,!1,i)},e.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),i=this.adapter.getMenuItemValues();return t!==T.UNSET_INDEX?i[t]:""},e.prototype.getDisabled=function(){return this.disabled},e.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(p.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(p.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},e.prototype.openMenu=function(){this.adapter.addClass(p.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,i=this.adapter.hasClass(p.FOCUSED),d=t||i,l=this.adapter.hasClass(p.REQUIRED);this.notchOutline(d),this.adapter.floatLabel(d),this.adapter.setLabelRequired(l)}},e.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues(),i=t.indexOf(this.getValue());this.setSelectedIndex(i,!1,!0)},e.prototype.handleMenuOpened=function(){if(this.adapter.getMenuItemValues().length!==0){var t=this.getSelectedIndex(),i=t>=0?t:0;this.adapter.focusMenuItemAtIndex(i)}},e.prototype.handleMenuClosing=function(){this.adapter.setSelectAnchorAttr("aria-expanded","false")},e.prototype.handleMenuClosed=function(){this.adapter.removeClass(p.ACTIVATED),this.isMenuOpen=!1,this.adapter.isSelectAnchorFocused()||this.blur()},e.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue());var t=this.adapter.hasClass(p.REQUIRED);t&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},e.prototype.handleFocus=function(){this.adapter.addClass(p.FOCUSED),this.layout(),this.adapter.activateBottomLine()},e.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},e.prototype.handleClick=function(t){if(!(this.disabled||this.recentlyClicked)){if(this.setClickDebounceTimeout(),this.isMenuOpen){this.adapter.closeMenu();return}this.adapter.setRippleCenter(t),this.openMenu()}},e.prototype.handleKeydown=function(t){if(!(this.isMenuOpen||!this.adapter.hasClass(p.FOCUSED))){var i=b(t)===n.ENTER,d=b(t)===n.SPACEBAR,l=b(t)===n.ARROW_UP,a=b(t)===n.ARROW_DOWN,h=t.ctrlKey||t.metaKey;if(!h&&(!d&&t.key&&t.key.length===1||d&&this.adapter.isTypeaheadInProgress())){var s=d?" ":t.key,A=this.adapter.typeaheadMatchItem(s,this.getSelectedIndex());A>=0&&this.setSelectedIndex(A),t.preventDefault();return}!i&&!d&&!l&&!a||(this.openMenu(),t.preventDefault())}},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var i=this.adapter.hasClass(p.FOCUSED);if(t){var d=T.LABEL_SCALE,l=this.adapter.getLabelWidth()*d;this.adapter.notchOutline(l)}else i||this.adapter.closeOutline()}},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.getUseDefaultValidation=function(){return this.useDefaultValidation},e.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},e.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(p.INVALID),this.adapter.removeMenuClass(p.MENU_INVALID)):(this.adapter.addClass(p.INVALID),this.adapter.addMenuClass(p.MENU_INVALID)),this.syncHelperTextValidity(t)},e.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(p.REQUIRED)&&!this.adapter.hasClass(p.DISABLED)?this.getSelectedIndex()!==T.UNSET_INDEX&&(this.getSelectedIndex()!==0||Boolean(this.getValue())):this.customValidity},e.prototype.setRequired=function(t){t?this.adapter.addClass(p.REQUIRED):this.adapter.removeClass(p.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},e.prototype.getRequired=function(){return this.adapter.getSelectAnchorAttr("aria-required")==="true"},e.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(F.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(p.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(p.INVALID)),this.layout(),this.layoutOptions()},e.prototype.blur=function(){this.adapter.removeClass(p.FOCUSED),this.layout(),this.adapter.deactivateBottomLine();var t=this.adapter.hasClass(p.REQUIRED);t&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var i=this.helperText.isVisible(),d=this.helperText.getId();i&&d?this.adapter.setSelectAnchorAttr(D.ARIA_DESCRIBEDBY,d):this.adapter.removeSelectAnchorAttr(D.ARIA_DESCRIBEDBY)}},e.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},T.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},e}(re);const se=ae;/**
|
178
178
|
* @license
|
179
179
|
* Copyright 2020 Google LLC
|
180
180
|
* SPDX-License-Identifier: Apache-2.0
|
181
|
-
*/const H=(c={})=>{const e={};for(const t in c)e[t]=c[t];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};class r extends Z.FormElement{constructor(){super(...arguments),this.mdcFoundationClass=se,this.disabled=!1,this.outlined=!1,this.label="",this.outlineOpen=!1,this.outlineWidth=0,this.value="",this.name="",this.selectedText="",this.icon="",this.menuOpen=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.required=!1,this.naturalMenuWidth=!1,this.isUiValid=!0,this.fixedMenuPosition=!1,this.typeaheadState=ce(),this.sortedIndexByFirstChar=new Map,this.menuElement_=null,this.listeners=[],this.onBodyClickBound=()=>{},this._menuUpdateComplete=null,this.valueSetDirectly=!1,this.validityTransform=null,this._validity=H()}get items(){return this.menuElement_||(this.menuElement_=this.menuElement),this.menuElement_?this.menuElement_.items:[]}get selected(){const e=this.menuElement;return e?e.selected:null}get index(){const e=this.menuElement;return e?e.index:-1}get shouldRenderHelperText(){return!!this.helper||!!this.validationMessage}get validity(){return this._checkValidity(this.value),this._validity}render(){const e={"mdc-select--disabled":this.disabled,"mdc-select--no-label":!this.label,"mdc-select--filled":!this.outlined,"mdc-select--outlined":this.outlined,"mdc-select--with-leading-icon":!!this.icon,"mdc-select--required":this.required,"mdc-select--invalid":!this.isUiValid},t=this.label?"label":void 0,i=this.shouldRenderHelperText?"helper-text":void 0;return u.
|
181
|
+
*/const H=(c={})=>{const e={};for(const t in c)e[t]=c[t];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};class r extends Z.FormElement{constructor(){super(...arguments),this.mdcFoundationClass=se,this.disabled=!1,this.outlined=!1,this.label="",this.outlineOpen=!1,this.outlineWidth=0,this.value="",this.name="",this.selectedText="",this.icon="",this.menuOpen=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.required=!1,this.naturalMenuWidth=!1,this.isUiValid=!0,this.fixedMenuPosition=!1,this.typeaheadState=ce(),this.sortedIndexByFirstChar=new Map,this.menuElement_=null,this.listeners=[],this.onBodyClickBound=()=>{},this._menuUpdateComplete=null,this.valueSetDirectly=!1,this.validityTransform=null,this._validity=H()}get items(){return this.menuElement_||(this.menuElement_=this.menuElement),this.menuElement_?this.menuElement_.items:[]}get selected(){const e=this.menuElement;return e?e.selected:null}get index(){const e=this.menuElement;return e?e.index:-1}get shouldRenderHelperText(){return!!this.helper||!!this.validationMessage}get validity(){return this._checkValidity(this.value),this._validity}render(){const e={"mdc-select--disabled":this.disabled,"mdc-select--no-label":!this.label,"mdc-select--filled":!this.outlined,"mdc-select--outlined":this.outlined,"mdc-select--with-leading-icon":!!this.icon,"mdc-select--required":this.required,"mdc-select--invalid":!this.isUiValid},t=this.label?"label":void 0,i=this.shouldRenderHelperText?"helper-text":void 0;return u.y`
|
182
182
|
<div
|
183
183
|
class="mdc-select ${L.o(e)}">
|
184
184
|
<input
|
@@ -231,7 +231,7 @@
|
|
231
231
|
</div>
|
232
232
|
${this.renderMenu()}
|
233
233
|
</div>
|
234
|
-
${this.renderHelperText()}`}renderMenu(){const e=this.getMenuClasses();return u.
|
234
|
+
${this.renderHelperText()}`}renderMenu(){const e=this.getMenuClasses();return u.y`
|
235
235
|
<mwc-menu
|
236
236
|
innerRole="listbox"
|
237
237
|
wrapFocus
|
@@ -247,24 +247,24 @@
|
|
247
247
|
@items-updated=${this.onItemsUpdated}
|
248
248
|
@keydown=${this.handleTypeahead}>
|
249
249
|
${this.renderMenuContent()}
|
250
|
-
</mwc-menu>`}getMenuClasses(){return{"mdc-select__menu":!0,"mdc-menu":!0,"mdc-menu-surface":!0,"mdc-select__menu--invalid":!this.isUiValid}}renderMenuContent(){return u.
|
250
|
+
</mwc-menu>`}getMenuClasses(){return{"mdc-select__menu":!0,"mdc-menu":!0,"mdc-menu-surface":!0,"mdc-select__menu--invalid":!this.isUiValid}}renderMenuContent(){return u.y`<slot></slot>`}renderRipple(){return this.outlined?u.b:u.y`
|
251
251
|
<span class="mdc-select__ripple"></span>
|
252
|
-
`}renderOutline(){return this.outlined?u.
|
252
|
+
`}renderOutline(){return this.outlined?u.y`
|
253
253
|
<mwc-notched-outline
|
254
254
|
.width=${this.outlineWidth}
|
255
255
|
.open=${this.outlineOpen}
|
256
256
|
class="mdc-notched-outline">
|
257
257
|
${this.renderLabel()}
|
258
|
-
</mwc-notched-outline>`:u.
|
258
|
+
</mwc-notched-outline>`:u.b}renderLabel(){return this.label?u.y`
|
259
259
|
<span
|
260
260
|
.floatingLabelFoundation=${N.floatingLabel(this.label)}
|
261
261
|
id="label">${this.label}</span>
|
262
|
-
`:u.
|
262
|
+
`:u.b}renderLeadingIcon(){return this.icon?u.y`<mwc-icon class="mdc-select__icon"><div>${this.icon}</div></mwc-icon>`:u.b}renderLineRipple(){return this.outlined?u.b:u.y`
|
263
263
|
<span .lineRippleFoundation=${N.lineRipple()}></span>
|
264
|
-
`}renderHelperText(){if(!this.shouldRenderHelperText)return u.
|
264
|
+
`}renderHelperText(){if(!this.shouldRenderHelperText)return u.b;const e=this.validationMessage&&!this.isUiValid,t={"mdc-select-helper-text--validation-msg":e};return u.y`
|
265
265
|
<p
|
266
266
|
class="mdc-select-helper-text ${L.o(t)}"
|
267
|
-
id="helper-text">${e?this.validationMessage:this.helper}</p>`}createAdapter(){return Object.assign(Object.assign({},P.addHasRemoveClass(this.mdcRoot)),{activateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},hasLabel:()=>!!this.label,floatLabel:e=>{this.labelElement&&this.labelElement.floatingLabelFoundation.float(e)},getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,setLabelRequired:e=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(e)},hasOutline:()=>this.outlined,notchOutline:e=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=e,this.outlineOpen=!0)},closeOutline:()=>{this.outlineElement&&(this.outlineOpen=!1)},setRippleCenter:e=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.setRippleCenter(e)},notifyChange:async e=>{if(!this.valueSetDirectly&&e===this.value)return;this.valueSetDirectly=!1,this.value=e,await this.updateComplete;const t=new Event("change",{bubbles:!0});this.dispatchEvent(t)},setSelectedText:e=>this.selectedText=e,isSelectAnchorFocused:()=>{const e=this.anchorElement;return e?e.getRootNode().activeElement===e:!1},getSelectAnchorAttr:e=>{const t=this.anchorElement;return t?t.getAttribute(e):null},setSelectAnchorAttr:(e,t)=>{const i=this.anchorElement;i&&i.setAttribute(e,t)},removeSelectAnchorAttr:e=>{const t=this.anchorElement;t&&t.removeAttribute(e)},openMenu:()=>{this.menuOpen=!0},closeMenu:()=>{this.menuOpen=!1},addMenuClass:()=>{},removeMenuClass:()=>{},getAnchorElement:()=>this.anchorElement,setMenuAnchorElement:()=>{},setMenuAnchorCorner:()=>{const e=this.menuElement;e&&(e.corner="BOTTOM_START")},setMenuWrapFocus:e=>{const t=this.menuElement;t&&(t.wrapFocus=e)},focusMenuItemAtIndex:e=>{const t=this.menuElement;if(!t)return;const i=t.items[e];i&&i.focus()},getMenuItemCount:()=>{const e=this.menuElement;return e?e.items.length:0},getMenuItemValues:()=>{const e=this.menuElement;return e?e.items.map(i=>i.value):[]},getMenuItemTextAtIndex:e=>{const t=this.menuElement;if(!t)return"";const i=t.items[e];return i?i.text:""},getSelectedIndex:()=>this.index,setSelectedIndex:()=>{},isTypeaheadInProgress:()=>$(this.typeaheadState),typeaheadMatchItem:(e,t)=>{if(!this.menuElement)return-1;const i={focusItemAtIndex:l=>{this.menuElement.focusItemAtIndex(l)},focusedItemIndex:t||this.menuElement.getFocusedItemIndex(),nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:!1,isItemAtIndexDisabled:l=>this.items[l].disabled},d=k(i,this.typeaheadState);return d!==-1&&this.select(d),d}})}checkValidity(){const e=this._checkValidity(this.value);if(!e){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return e}reportValidity(){const e=this.checkValidity();return this.isUiValid=e,e}_checkValidity(e){const t=this.formElement.validity;let i=H(t);if(this.validityTransform){const d=this.validityTransform(e,i);i=Object.assign(Object.assign({},i),d)}return this._validity=i,this._validity.valid}setCustomValidity(e){this.validationMessage=e,this.formElement.setCustomValidity(e)}async getUpdateComplete(){return await this._menuUpdateComplete,await super.getUpdateComplete()}async firstUpdated(){const e=this.menuElement;if(e&&(this._menuUpdateComplete=e.updateComplete,await this._menuUpdateComplete),super.firstUpdated(),this.mdcFoundation.isValid=()=>!0,this.mdcFoundation.setValid=()=>{},this.mdcFoundation.setDisabled(this.disabled),this.validateOnInitialRender&&this.reportValidity(),!this.selected){!this.items.length&&this.slotElement&&this.slotElement.assignedNodes({flatten:!0}).length&&(await new Promise(i=>requestAnimationFrame(i)),await this.layout());const t=this.items.length&&this.items[0].value==="";if(!this.value&&t){this.select(0);return}this.selectByValue(this.value)}this.sortedIndexByFirstChar=z(this.items.length,t=>this.items[t].text)}onItemsUpdated(){this.sortedIndexByFirstChar=z(this.items.length,e=>this.items[e].text)}select(e){const t=this.menuElement;t&&t.select(e)}selectByValue(e){let t=-1;for(let i=0;i<this.items.length;i++)if(this.items[i].value===e){t=i;break}this.valueSetDirectly=!0,this.select(t),this.mdcFoundation.handleChange()}disconnectedCallback(){super.disconnectedCallback();for(const e of this.listeners)e.target.removeEventListener(e.name,e.cb)}focus(){const e=new CustomEvent("focus"),t=this.anchorElement;t&&(t.dispatchEvent(e),t.focus())}blur(){const e=new CustomEvent("blur"),t=this.anchorElement;t&&(t.dispatchEvent(e),t.blur())}onFocus(){this.mdcFoundation&&this.mdcFoundation.handleFocus()}onBlur(){this.mdcFoundation&&this.mdcFoundation.handleBlur();const e=this.menuElement;e&&!e.open&&this.reportValidity()}onClick(e){if(this.mdcFoundation){this.focus();const t=e.target.getBoundingClientRect();let i=0;"touches"in e?i=e.touches[0].clientX:i=e.clientX;const d=i-t.left;this.mdcFoundation.handleClick(d)}}onKeydown(e){const t=b(e)===n.ARROW_UP,i=b(e)===n.ARROW_DOWN;if(i||t){const d=t&&this.index>0,l=i&&this.index<this.items.length-1;d?this.select(this.index-1):l&&this.select(this.index+1),e.preventDefault(),this.mdcFoundation.openMenu();return}this.mdcFoundation.handleKeydown(e)}handleTypeahead(e){if(!this.menuElement)return;const t=this.menuElement.getFocusedItemIndex(),i=P.isNodeElement(e.target)?e.target:null,d=i?i.hasAttribute("mwc-list-item"):!1,l={event:e,focusItemAtIndex:a=>{this.menuElement.focusItemAtIndex(a)},focusedItemIndex:t,isTargetListItem:d,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:a=>this.items[a].disabled};oe(l,this.typeaheadState)}async onSelected(e){this.mdcFoundation||await this.updateComplete,this.mdcFoundation.handleMenuItemAction(e.detail.index);const t=this.items[e.detail.index];t&&(this.value=t.value)}onOpened(){this.mdcFoundation&&(this.menuOpen=!0,this.mdcFoundation.handleMenuOpened())}onClosed(){this.mdcFoundation&&(this.menuOpen=!1,this.mdcFoundation.handleMenuClosed())}setFormData(e){this.name&&this.selected!==null&&e.append(this.name,this.value)}async layout(e=!0){this.mdcFoundation&&this.mdcFoundation.layout(),await this.updateComplete;const t=this.menuElement;t&&t.layout(e);const i=this.labelElement;if(!i){this.outlineOpen=!1;return}const d=!!this.label&&!!this.value;if(i.floatingLabelFoundation.float(d),!this.outlined)return;this.outlineOpen=d,await this.updateComplete;const l=i.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=l)}async layoutOptions(){this.mdcFoundation&&this.mdcFoundation.layoutOptions()}}o.__decorate([x.i(".mdc-select")],r.prototype,"mdcRoot",void 0);o.__decorate([x.i(".formElement")],r.prototype,"formElement",void 0);o.__decorate([x.i("slot")],r.prototype,"slotElement",void 0);o.__decorate([x.i("select")],r.prototype,"nativeSelectElement",void 0);o.__decorate([x.i("input")],r.prototype,"nativeInputElement",void 0);o.__decorate([x.i(".mdc-line-ripple")],r.prototype,"lineRippleElement",void 0);o.__decorate([x.i(".mdc-floating-label")],r.prototype,"labelElement",void 0);o.__decorate([x.i("mwc-notched-outline")],r.prototype,"outlineElement",void 0);o.__decorate([x.i(".mdc-menu")],r.prototype,"menuElement",void 0);o.__decorate([x.i(".mdc-select__anchor")],r.prototype,"anchorElement",void 0);o.__decorate([v.
|
267
|
+
id="helper-text">${e?this.validationMessage:this.helper}</p>`}createAdapter(){return Object.assign(Object.assign({},P.addHasRemoveClass(this.mdcRoot)),{activateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},hasLabel:()=>!!this.label,floatLabel:e=>{this.labelElement&&this.labelElement.floatingLabelFoundation.float(e)},getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,setLabelRequired:e=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(e)},hasOutline:()=>this.outlined,notchOutline:e=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=e,this.outlineOpen=!0)},closeOutline:()=>{this.outlineElement&&(this.outlineOpen=!1)},setRippleCenter:e=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.setRippleCenter(e)},notifyChange:async e=>{if(!this.valueSetDirectly&&e===this.value)return;this.valueSetDirectly=!1,this.value=e,await this.updateComplete;const t=new Event("change",{bubbles:!0});this.dispatchEvent(t)},setSelectedText:e=>this.selectedText=e,isSelectAnchorFocused:()=>{const e=this.anchorElement;return e?e.getRootNode().activeElement===e:!1},getSelectAnchorAttr:e=>{const t=this.anchorElement;return t?t.getAttribute(e):null},setSelectAnchorAttr:(e,t)=>{const i=this.anchorElement;i&&i.setAttribute(e,t)},removeSelectAnchorAttr:e=>{const t=this.anchorElement;t&&t.removeAttribute(e)},openMenu:()=>{this.menuOpen=!0},closeMenu:()=>{this.menuOpen=!1},addMenuClass:()=>{},removeMenuClass:()=>{},getAnchorElement:()=>this.anchorElement,setMenuAnchorElement:()=>{},setMenuAnchorCorner:()=>{const e=this.menuElement;e&&(e.corner="BOTTOM_START")},setMenuWrapFocus:e=>{const t=this.menuElement;t&&(t.wrapFocus=e)},focusMenuItemAtIndex:e=>{const t=this.menuElement;if(!t)return;const i=t.items[e];i&&i.focus()},getMenuItemCount:()=>{const e=this.menuElement;return e?e.items.length:0},getMenuItemValues:()=>{const e=this.menuElement;return e?e.items.map(i=>i.value):[]},getMenuItemTextAtIndex:e=>{const t=this.menuElement;if(!t)return"";const i=t.items[e];return i?i.text:""},getSelectedIndex:()=>this.index,setSelectedIndex:()=>{},isTypeaheadInProgress:()=>$(this.typeaheadState),typeaheadMatchItem:(e,t)=>{if(!this.menuElement)return-1;const i={focusItemAtIndex:l=>{this.menuElement.focusItemAtIndex(l)},focusedItemIndex:t||this.menuElement.getFocusedItemIndex(),nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:!1,isItemAtIndexDisabled:l=>this.items[l].disabled},d=k(i,this.typeaheadState);return d!==-1&&this.select(d),d}})}checkValidity(){const e=this._checkValidity(this.value);if(!e){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return e}reportValidity(){const e=this.checkValidity();return this.isUiValid=e,e}_checkValidity(e){const t=this.formElement.validity;let i=H(t);if(this.validityTransform){const d=this.validityTransform(e,i);i=Object.assign(Object.assign({},i),d)}return this._validity=i,this._validity.valid}setCustomValidity(e){this.validationMessage=e,this.formElement.setCustomValidity(e)}async getUpdateComplete(){return await this._menuUpdateComplete,await super.getUpdateComplete()}async firstUpdated(){const e=this.menuElement;if(e&&(this._menuUpdateComplete=e.updateComplete,await this._menuUpdateComplete),super.firstUpdated(),this.mdcFoundation.isValid=()=>!0,this.mdcFoundation.setValid=()=>{},this.mdcFoundation.setDisabled(this.disabled),this.validateOnInitialRender&&this.reportValidity(),!this.selected){!this.items.length&&this.slotElement&&this.slotElement.assignedNodes({flatten:!0}).length&&(await new Promise(i=>requestAnimationFrame(i)),await this.layout());const t=this.items.length&&this.items[0].value==="";if(!this.value&&t){this.select(0);return}this.selectByValue(this.value)}this.sortedIndexByFirstChar=z(this.items.length,t=>this.items[t].text)}onItemsUpdated(){this.sortedIndexByFirstChar=z(this.items.length,e=>this.items[e].text)}select(e){const t=this.menuElement;t&&t.select(e)}selectByValue(e){let t=-1;for(let i=0;i<this.items.length;i++)if(this.items[i].value===e){t=i;break}this.valueSetDirectly=!0,this.select(t),this.mdcFoundation.handleChange()}disconnectedCallback(){super.disconnectedCallback();for(const e of this.listeners)e.target.removeEventListener(e.name,e.cb)}focus(){const e=new CustomEvent("focus"),t=this.anchorElement;t&&(t.dispatchEvent(e),t.focus())}blur(){const e=new CustomEvent("blur"),t=this.anchorElement;t&&(t.dispatchEvent(e),t.blur())}onFocus(){this.mdcFoundation&&this.mdcFoundation.handleFocus()}onBlur(){this.mdcFoundation&&this.mdcFoundation.handleBlur();const e=this.menuElement;e&&!e.open&&this.reportValidity()}onClick(e){if(this.mdcFoundation){this.focus();const t=e.target.getBoundingClientRect();let i=0;"touches"in e?i=e.touches[0].clientX:i=e.clientX;const d=i-t.left;this.mdcFoundation.handleClick(d)}}onKeydown(e){const t=b(e)===n.ARROW_UP,i=b(e)===n.ARROW_DOWN;if(i||t){const d=t&&this.index>0,l=i&&this.index<this.items.length-1;d?this.select(this.index-1):l&&this.select(this.index+1),e.preventDefault(),this.mdcFoundation.openMenu();return}this.mdcFoundation.handleKeydown(e)}handleTypeahead(e){if(!this.menuElement)return;const t=this.menuElement.getFocusedItemIndex(),i=P.isNodeElement(e.target)?e.target:null,d=i?i.hasAttribute("mwc-list-item"):!1,l={event:e,focusItemAtIndex:a=>{this.menuElement.focusItemAtIndex(a)},focusedItemIndex:t,isTargetListItem:d,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:a=>this.items[a].disabled};oe(l,this.typeaheadState)}async onSelected(e){this.mdcFoundation||await this.updateComplete,this.mdcFoundation.handleMenuItemAction(e.detail.index);const t=this.items[e.detail.index];t&&(this.value=t.value)}onOpened(){this.mdcFoundation&&(this.menuOpen=!0,this.mdcFoundation.handleMenuOpened())}onClosed(){this.mdcFoundation&&(this.menuOpen=!1,this.mdcFoundation.handleMenuClosed())}setFormData(e){this.name&&this.selected!==null&&e.append(this.name,this.value)}async layout(e=!0){this.mdcFoundation&&this.mdcFoundation.layout(),await this.updateComplete;const t=this.menuElement;t&&t.layout(e);const i=this.labelElement;if(!i){this.outlineOpen=!1;return}const d=!!this.label&&!!this.value;if(i.floatingLabelFoundation.float(d),!this.outlined)return;this.outlineOpen=d,await this.updateComplete;const l=i.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=l)}async layoutOptions(){this.mdcFoundation&&this.mdcFoundation.layoutOptions()}}o.__decorate([x.i(".mdc-select")],r.prototype,"mdcRoot",void 0);o.__decorate([x.i(".formElement")],r.prototype,"formElement",void 0);o.__decorate([x.i("slot")],r.prototype,"slotElement",void 0);o.__decorate([x.i("select")],r.prototype,"nativeSelectElement",void 0);o.__decorate([x.i("input")],r.prototype,"nativeInputElement",void 0);o.__decorate([x.i(".mdc-line-ripple")],r.prototype,"lineRippleElement",void 0);o.__decorate([x.i(".mdc-floating-label")],r.prototype,"labelElement",void 0);o.__decorate([x.i("mwc-notched-outline")],r.prototype,"outlineElement",void 0);o.__decorate([x.i(".mdc-menu")],r.prototype,"menuElement",void 0);o.__decorate([x.i(".mdc-select__anchor")],r.prototype,"anchorElement",void 0);o.__decorate([v.e({type:Boolean,attribute:"disabled",reflect:!0}),S.observer(function(c){this.mdcFoundation&&this.mdcFoundation.setDisabled(c)})],r.prototype,"disabled",void 0);o.__decorate([v.e({type:Boolean}),S.observer(function(c,e){e!==void 0&&this.outlined!==e&&this.layout(!1)})],r.prototype,"outlined",void 0);o.__decorate([v.e({type:String}),S.observer(function(c,e){e!==void 0&&this.label!==e&&this.layout(!1)})],r.prototype,"label",void 0);o.__decorate([C.t()],r.prototype,"outlineOpen",void 0);o.__decorate([C.t()],r.prototype,"outlineWidth",void 0);o.__decorate([v.e({type:String}),S.observer(function(c){if(this.mdcFoundation){const e=this.selected===null&&!!c,t=this.selected&&this.selected.value!==c;(e||t)&&this.selectByValue(c),this.reportValidity()}})],r.prototype,"value",void 0);o.__decorate([v.e()],r.prototype,"name",void 0);o.__decorate([C.t()],r.prototype,"selectedText",void 0);o.__decorate([v.e({type:String})],r.prototype,"icon",void 0);o.__decorate([C.t()],r.prototype,"menuOpen",void 0);o.__decorate([v.e({type:String})],r.prototype,"helper",void 0);o.__decorate([v.e({type:Boolean})],r.prototype,"validateOnInitialRender",void 0);o.__decorate([v.e({type:String})],r.prototype,"validationMessage",void 0);o.__decorate([v.e({type:Boolean})],r.prototype,"required",void 0);o.__decorate([v.e({type:Boolean})],r.prototype,"naturalMenuWidth",void 0);o.__decorate([C.t()],r.prototype,"isUiValid",void 0);o.__decorate([v.e({type:Boolean})],r.prototype,"fixedMenuPosition",void 0);o.__decorate([J.e({capture:!0})],r.prototype,"handleTypeahead",null);/**
|
268
268
|
* @license
|
269
269
|
* Copyright 2021 Google LLC
|
270
270
|
* SPDX-LIcense-Identifier: Apache-2.0
|
package/select.mjs
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
import { i as P, e as Y, x,
|
2
|
-
import {
|
3
|
-
import { f as ie, l as le } from "./mwc-line-ripple-directive-
|
4
|
-
import { M as de } from "./mwc-menu-base-
|
5
|
-
import "./mwc-icon-
|
6
|
-
import { F as ce } from "./form-element-
|
1
|
+
import { i as P, e as Y, y as x, b as w, r as ee } from "./query-assigned-elements-514e5265.mjs";
|
2
|
+
import { _ as o, a as te, b as V } from "./tslib.es6-b5e819a6.mjs";
|
3
|
+
import { f as ie, l as le } from "./mwc-line-ripple-directive-c3e1f04a.mjs";
|
4
|
+
import { M as de } from "./mwc-menu-base-8970b43d.mjs";
|
5
|
+
import "./mwc-icon-c7013880.mjs";
|
6
|
+
import { F as ce } from "./form-element-6dbd7afa.mjs";
|
7
7
|
import { o as R } from "./observer-be7b92e2.mjs";
|
8
|
-
import { a as ne, i as oe } from "./utils-
|
9
|
-
import {
|
10
|
-
import { t as S } from "./state-
|
11
|
-
import { e as re } from "./event-options-
|
12
|
-
import { i as v } from "./query-
|
13
|
-
import { o as M } from "./class-map-
|
14
|
-
import { l as z } from "./if-defined-
|
15
|
-
import "./base-element-
|
16
|
-
import "./mwc-list-base-
|
17
|
-
import "./mwc-list-item-base-
|
18
|
-
import "./ripple-handlers-
|
19
|
-
import "./style-map-
|
20
|
-
import "./query-assigned-nodes-
|
8
|
+
import { a as ne, i as oe } from "./utils-dc65fdc9.mjs";
|
9
|
+
import { e as g } from "./property-ca27685b.mjs";
|
10
|
+
import { t as S } from "./state-6f7e570d.mjs";
|
11
|
+
import { e as re } from "./event-options-3937d997.mjs";
|
12
|
+
import { i as v } from "./query-1e7846ea.mjs";
|
13
|
+
import { o as M } from "./class-map-08c84aeb.mjs";
|
14
|
+
import { l as z } from "./if-defined-639ed018.mjs";
|
15
|
+
import "./base-element-c3dc926e.mjs";
|
16
|
+
import "./mwc-list-base-c0f8af1c.mjs";
|
17
|
+
import "./mwc-list-item-base-acef0223.mjs";
|
18
|
+
import "./ripple-handlers-227497d3.mjs";
|
19
|
+
import "./style-map-2cb0fb63.mjs";
|
20
|
+
import "./query-assigned-nodes-bea12e0c.mjs";
|
21
21
|
/**
|
22
22
|
* @license
|
23
23
|
* Copyright 2021 Google LLC
|
@@ -714,7 +714,7 @@ var ge = (
|
|
714
714
|
}, e.prototype.setValid = function(t) {
|
715
715
|
this.useDefaultValidation || (this.customValidity = t), this.adapter.setSelectAnchorAttr("aria-invalid", (!t).toString()), t ? (this.adapter.removeClass(p.INVALID), this.adapter.removeMenuClass(p.MENU_INVALID)) : (this.adapter.addClass(p.INVALID), this.adapter.addMenuClass(p.MENU_INVALID)), this.syncHelperTextValidity(t);
|
716
716
|
}, e.prototype.isValid = function() {
|
717
|
-
return this.useDefaultValidation && this.adapter.hasClass(p.REQUIRED) && !this.adapter.hasClass(p.DISABLED) ? this.getSelectedIndex() !== T.UNSET_INDEX && (this.getSelectedIndex() !== 0 ||
|
717
|
+
return this.useDefaultValidation && this.adapter.hasClass(p.REQUIRED) && !this.adapter.hasClass(p.DISABLED) ? this.getSelectedIndex() !== T.UNSET_INDEX && (this.getSelectedIndex() !== 0 || Boolean(this.getValue())) : this.customValidity;
|
718
718
|
}, e.prototype.setRequired = function(t) {
|
719
719
|
t ? this.adapter.addClass(p.REQUIRED) : this.adapter.removeClass(p.REQUIRED), this.adapter.setSelectAnchorAttr("aria-required", t.toString()), this.adapter.setLabelRequired(t);
|
720
720
|
}, e.prototype.getRequired = function() {
|
package/side-sheet.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./query-assigned-elements-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./query-assigned-elements-07e38f46.js"),c=require("./property-074570d1.js"),l=require("./dialog-8ee07177.js");require("./tslib.es6-6b53b818.js");require("./inert.esm-2cee6f2e.js");require("./base-element-d5abe37a.js");require("./utils-a8190a39.js");require("./observer-a096ab43.js");require("./query-2ba749b7.js");require("./class-map-50b8edb4.js");const h=`:host{--cv-side-sheet-width: 800px;--mdc-dialog-heading-ink-color: var(--mdc-theme-text-primary-on-background)}.mdc-dialog{justify-content:flex-end}.mdc-dialog .mdc-dialog__surface{border-radius:0;height:100%;min-height:inherit;max-height:inherit;min-width:var(--cv-side-sheet-width, 400px)}.mdc-dialog--opening .mdc-dialog__container{transform:translate(100%);transition:transform .15s cubic-bezier(.4,0,1,1)}.mdc-dialog--open .mdc-dialog__container{transform:translate(0)}.mdc-dialog--closing .mdc-dialog__container{opacity:1;transform:translate(100%);transition:transform .15s cubic-bezier(0,0,.2,1)}:host([pushed]) .mdc-dialog__surface{min-width:100vw}:host([noPadding]) .mdc-dialog .mdc-dialog__content{padding:0}
|
2
2
|
`;var u=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(r,t,o,i)=>{for(var e=i>1?void 0:i?g(t,o):t,n=r.length-1,a;n>=0;n--)(a=r[n])&&(e=(i?a(t,o,e):a(e))||e);return i&&e&&u(t,o,e),e};exports.CovalentSideSheet=class extends l.CovalentDialog{constructor(){super(),this.pushed=!1,this.noPadding=!1,this.hideActions=!0}};exports.CovalentSideSheet.styles=[l.styles,d.i`
|
3
3
|
${d.r(h)}
|
4
|
-
`];s([c.
|
4
|
+
`];s([c.e({type:Boolean,reflect:!0})],exports.CovalentSideSheet.prototype,"pushed",2);s([c.e({type:Boolean,reflect:!0})],exports.CovalentSideSheet.prototype,"noPadding",2);exports.CovalentSideSheet=s([d.e("cv-side-sheet")],exports.CovalentSideSheet);
|
package/side-sheet.mjs
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
import { i as m, r as l, e as p } from "./query-assigned-elements-
|
2
|
-
import {
|
3
|
-
import { s as h, C as g } from "./dialog-
|
4
|
-
import "./tslib.es6-
|
1
|
+
import { i as m, r as l, e as p } from "./query-assigned-elements-514e5265.mjs";
|
2
|
+
import { e as c } from "./property-ca27685b.mjs";
|
3
|
+
import { s as h, C as g } from "./dialog-85c21333.mjs";
|
4
|
+
import "./tslib.es6-b5e819a6.mjs";
|
5
5
|
import "./inert.esm-359d4581.mjs";
|
6
|
-
import "./base-element-
|
7
|
-
import "./utils-
|
6
|
+
import "./base-element-c3dc926e.mjs";
|
7
|
+
import "./utils-dc65fdc9.mjs";
|
8
8
|
import "./observer-be7b92e2.mjs";
|
9
|
-
import "./query-
|
10
|
-
import "./class-map-
|
9
|
+
import "./query-1e7846ea.mjs";
|
10
|
+
import "./class-map-08c84aeb.mjs";
|
11
11
|
const f = `:host{--cv-side-sheet-width: 800px;--mdc-dialog-heading-ink-color: var(--mdc-theme-text-primary-on-background)}.mdc-dialog{justify-content:flex-end}.mdc-dialog .mdc-dialog__surface{border-radius:0;height:100%;min-height:inherit;max-height:inherit;min-width:var(--cv-side-sheet-width, 400px)}.mdc-dialog--opening .mdc-dialog__container{transform:translate(100%);transition:transform .15s cubic-bezier(.4,0,1,1)}.mdc-dialog--open .mdc-dialog__container{transform:translate(0)}.mdc-dialog--closing .mdc-dialog__container{opacity:1;transform:translate(100%);transition:transform .15s cubic-bezier(0,0,.2,1)}:host([pushed]) .mdc-dialog__surface{min-width:100vw}:host([noPadding]) .mdc-dialog .mdc-dialog__content{padding:0}
|
12
12
|
`;
|
13
|
-
var _ = Object.defineProperty, u = Object.getOwnPropertyDescriptor,
|
14
|
-
for (var
|
15
|
-
(
|
16
|
-
return o &&
|
13
|
+
var _ = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (d, i, r, o) => {
|
14
|
+
for (var e = o > 1 ? void 0 : o ? u(i, r) : i, a = d.length - 1, s; a >= 0; a--)
|
15
|
+
(s = d[a]) && (e = (o ? s(i, r, e) : s(e)) || e);
|
16
|
+
return o && e && _(i, r, e), e;
|
17
17
|
};
|
18
|
-
let
|
18
|
+
let t = class extends g {
|
19
19
|
constructor() {
|
20
20
|
super(), this.pushed = !1, this.noPadding = !1, this.hideActions = !0;
|
21
21
|
}
|
22
22
|
};
|
23
|
-
|
23
|
+
t.styles = [
|
24
24
|
h,
|
25
25
|
m`
|
26
26
|
${l(f)}
|
27
27
|
`
|
28
28
|
];
|
29
|
-
|
29
|
+
n([
|
30
30
|
c({ type: Boolean, reflect: !0 })
|
31
|
-
],
|
32
|
-
|
31
|
+
], t.prototype, "pushed", 2);
|
32
|
+
n([
|
33
33
|
c({ type: Boolean, reflect: !0 })
|
34
|
-
],
|
35
|
-
|
34
|
+
], t.prototype, "noPadding", 2);
|
35
|
+
t = n([
|
36
36
|
p("cv-side-sheet")
|
37
|
-
],
|
37
|
+
], t);
|
38
38
|
export {
|
39
|
-
|
39
|
+
t as CovalentSideSheet
|
40
40
|
};
|