@covalent/components 8.1.0 → 8.2.0-beta.1
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/_commonjsHelpers-ZPn_iTGj.mjs +28 -0
- package/_commonjsHelpers-fFrWAeZI.js +1 -0
- package/action-ribbon.js +2 -3
- package/action-ribbon.mjs +9 -10
- package/alert.js +2 -3
- package/alert.mjs +9 -10
- package/app-shell/app-shell.d.ts +6 -1
- package/app-shell/app-shell.d.ts.map +1 -1
- package/app-shell.js +3 -4
- package/app-shell.mjs +65 -51
- package/{base-element-67ae173f.mjs → base-element--jaKdI-8.mjs} +2 -2
- package/{base-element-58a3f9ea.js → base-element-atp_8bvP.js} +1 -1
- package/button.js +2 -3
- package/button.mjs +15 -16
- package/card.js +2 -3
- package/card.mjs +4 -5
- package/check-list-item.js +10 -12
- package/check-list-item.mjs +65 -65
- package/checkbox.js +1 -2
- package/checkbox.mjs +23 -25
- package/chip-M5Vb5Kd6.js +492 -0
- package/chip-m2mKzWQT.mjs +3115 -0
- package/chip-set.js +75 -0
- package/chip-set.mjs +531 -0
- package/chip.js +1 -0
- package/chip.mjs +12 -0
- package/circular-progress.js +1 -1
- package/circular-progress.mjs +7 -7
- package/{class-map-4b94b017.mjs → class-map-YPXv0Hj4.mjs} +1 -1
- package/{class-map-b5efe8da.js → class-map-wtcW44Of.js} +1 -1
- package/code-snippet.js +12 -1
- package/code-snippet.mjs +12251 -7
- package/{dialog-82b03745.js → dialog-SpbwRuWY.js} +6 -7
- package/{dialog-3ca1b701.mjs → dialog-tIMorfuj.mjs} +60 -62
- package/dialog.js +1 -1
- package/dialog.mjs +10 -10
- package/{directive-helpers-0ce1f995.js → directive-helpers--rJ2jf3N.js} +1 -1
- package/{directive-helpers-e3ea6592.mjs → directive-helpers-9566lOOl.mjs} +1 -1
- package/drawer.js +2 -3
- package/drawer.mjs +11 -12
- package/empty-state.js +1 -2
- package/empty-state.mjs +5 -6
- package/{event-options-78d6cf94.mjs → event-options-0xzSdemG.mjs} +1 -1
- package/{event-options-3f5eb195.js → event-options-2TJPtsKy.js} +1 -1
- package/expansion-panel-item.js +24 -0
- package/expansion-panel-item.mjs +106 -0
- package/expansion-panel.js +7 -0
- package/expansion-panel.mjs +59 -0
- package/{form-element-c553d6f5.js → form-element-5s8gft-A.js} +1 -1
- package/{form-element-ffcf59ff.mjs → form-element-gM33WEq3.mjs} +4 -4
- package/formfield.js +79 -0
- package/formfield.mjs +275 -0
- package/{foundation-786bf879.js → foundation-1Vzfdey_.js} +1 -1
- package/{foundation-39dc72d2.mjs → foundation-3Wg80pI7.mjs} +1 -1
- package/icon-button.js +2 -3
- package/icon-button.mjs +14 -15
- package/icon-check-toggle.js +4 -5
- package/icon-check-toggle.mjs +22 -24
- package/icon-radio-toggle.js +4 -5
- package/icon-radio-toggle.mjs +25 -27
- package/icon.js +1 -5
- package/icon.mjs +15 -21
- package/{if-defined-c367f208.mjs → if-defined-BH_l2PVl.mjs} +1 -1
- package/{if-defined-f1c45245.js → if-defined-lAIUwAsA.js} +1 -1
- package/index.js +1 -568
- package/index.mjs +124 -3741
- package/{inert.esm-359d4581.mjs → inert.esm-vhZXthJr.mjs} +1 -1
- package/linear-progress.js +2 -3
- package/linear-progress.mjs +12 -13
- package/list/check-list-item.d.ts.map +1 -1
- package/list/radio-list-item.d.ts.map +1 -1
- package/list-item-F2e6aWaj.mjs +11 -0
- package/list-item-Ze98reWt.js +5 -0
- package/list-item.js +7 -1
- package/list-item.mjs +37 -16
- package/list.js +3 -8
- package/list.mjs +31 -37
- package/menu.js +1 -5
- package/menu.mjs +28 -34
- package/{mwc-checkbox.css-b3434429.js → mwc-checkbox.css-JOD-Qh-9.js} +42 -2
- package/{mwc-checkbox.css-8f4f1a9b.mjs → mwc-checkbox.css-c44nPIEs.mjs} +198 -3
- package/{mwc-drawer-base-135de8a5.mjs → mwc-drawer-base-8e_1aSuf.mjs} +24 -26
- package/{mwc-drawer-base-798b11f8.js → mwc-drawer-base-Fv3JVYPS.js} +5 -5
- package/{mwc-icon-bf656cf5.mjs → mwc-icon-eaW72Ei7.mjs} +6 -5
- package/{mwc-icon-f87639bc.js → mwc-icon-r2y4-AXI.js} +2 -2
- package/{mwc-line-ripple-directive-b24a914e.mjs → mwc-line-ripple-directive-Q_HMRGPE.mjs} +6 -6
- package/{mwc-line-ripple-directive-a6b39a3c.js → mwc-line-ripple-directive-iRoAkPnW.js} +1 -1
- package/{mwc-list-item.css-b0009fc7.mjs → mwc-list-item.css-d-SHhq7Q.mjs} +199 -7
- package/{mwc-list-item.css-25adc0c4.js → mwc-list-item.css-yJ5bjNGc.js} +28 -5
- package/mwc-list.css-DjU8XB1m.js +111 -0
- package/{mwc-list-base-76e37212.mjs → mwc-list.css-_OVL_dbR.mjs} +213 -212
- package/{mwc-menu-base-c4bc88ea.mjs → mwc-menu.css-cKtc1ZD4.mjs} +74 -75
- package/mwc-menu.css-qavo4jer.js +190 -0
- package/{mwc-radio-base-a374fbd9.mjs → mwc-radio.css-_lt-Vcvl.mjs} +123 -117
- package/mwc-radio.css-h_Wv0Eag.js +105 -0
- package/{mwc-slider.css-c7107d94.js → mwc-slider.css-lCfMVbO5.js} +1 -1
- package/{mwc-slider.css-8b6f275c.mjs → mwc-slider.css-md7hPAE7.mjs} +11 -11
- package/{mwc-tab-base-be0c887f.mjs → mwc-tab.css-lT5vTf5I.mjs} +127 -123
- package/{mwc-tab-base-f28722aa.js → mwc-tab.css-q4Jsbyp5.js} +26 -22
- package/{mwc-top-app-bar-base-aec60f27.js → mwc-top-app-bar-base-8qOIX1me.js} +3 -3
- package/{mwc-top-app-bar-base-55da3fe4.mjs → mwc-top-app-bar-base-nm6mdCR3.mjs} +12 -13
- package/nav-list-item.js +6 -7
- package/nav-list-item.mjs +38 -39
- package/package.json +16 -1
- package/{query-d843aa92.mjs → query-1WmuF6Bq.mjs} +1 -1
- package/{query-assigned-nodes-99eae71d.js → query-assigned-nodes-1p7z6CEm.js} +1 -1
- package/{query-assigned-nodes-df691e78.mjs → query-assigned-nodes-6yHI5ePh.mjs} +1 -1
- package/{query-680f1868.js → query-duvhtfSs.js} +1 -1
- package/radio-list-item.js +10 -12
- package/radio-list-item.mjs +62 -62
- package/radio.js +1 -2
- package/radio.mjs +23 -25
- package/{ripple-handlers-f37f21cf.mjs → ripple-handlers-BwaZu9Ps.mjs} +16 -17
- package/{ripple-handlers-5d5b21db.js → ripple-handlers-HeGhXgD2.js} +8 -8
- package/select.js +10 -15
- package/select.mjs +139 -147
- package/side-sheet.js +1 -2
- package/side-sheet.mjs +11 -12
- package/slider-range.js +1 -1
- package/slider-range.mjs +14 -14
- package/slider.js +1 -1
- package/slider.mjs +16 -16
- package/snackbar.js +10 -11
- package/snackbar.mjs +34 -36
- package/{state-0974a8e5.js → state-LqPxt99W.js} +1 -1
- package/{state-b5e865db.mjs → state-inNZe6rL.mjs} +1 -1
- package/status-header-item.js +1 -2
- package/status-header-item.mjs +3 -4
- package/status-header.js +2 -3
- package/status-header.mjs +4 -5
- package/{style-map-88d2563f.js → style-map-66_3wrLx.js} +1 -1
- package/{style-map-bc3ed3e0.mjs → style-map-8yp6DGeh.mjs} +2 -2
- package/style.css +1 -1
- package/switch.js +2 -3
- package/switch.mjs +15 -16
- package/tab-bar.js +18 -22
- package/tab-bar.mjs +195 -203
- package/tab.js +1 -6
- package/tab.mjs +26 -32
- package/text-lockup.js +1 -2
- package/text-lockup.mjs +8 -9
- package/textarea.js +15 -19
- package/textarea.mjs +59 -65
- package/textfield/textfield.d.ts +1 -0
- package/textfield/textfield.d.ts.map +1 -1
- package/textfield-7aU1kEO6.mjs +936 -0
- package/textfield-jvevIGSw.js +136 -0
- package/textfield.js +3 -7
- package/textfield.mjs +33 -36
- package/toolbar.js +1 -2
- package/toolbar.mjs +9 -10
- package/tooltip.js +2 -3
- package/tooltip.mjs +9 -10
- package/top-app-bar-fixed.js +6 -6
- package/top-app-bar-fixed.mjs +27 -28
- package/{top-app-bar-f83386e0.mjs → top-app-bar-h0V-USh_.mjs} +2 -3
- package/{top-app-bar-a531c1b4.js → top-app-bar-qcW2ucE3.js} +2 -3
- package/top-app-bar.js +1 -1
- package/top-app-bar.mjs +9 -9
- package/tree-list-item.js +1 -2
- package/tree-list-item.mjs +6 -7
- package/tree-list.js +1 -2
- package/tree-list.mjs +2 -3
- package/{tslib.es6-f3e988cd.mjs → tslib.es6-S8SvF2K1.mjs} +5 -5
- package/typography.js +1 -2
- package/typography.mjs +3 -4
- package/code-snippet-2137b11c.js +0 -13
- package/code-snippet-ccca324f.mjs +0 -12278
- package/list-item-04b6ffa1.js +0 -8
- package/list-item-1c4f9e23.mjs +0 -32
- package/mwc-checkbox-base-3d8c9549.js +0 -41
- package/mwc-checkbox-base-f10fd709.mjs +0 -198
- package/mwc-list-base-400b00e2.js +0 -111
- package/mwc-list-item-base-297d86b0.js +0 -28
- package/mwc-list-item-base-fe4398c3.mjs +0 -202
- package/mwc-menu-base-c75ca473.js +0 -190
- package/mwc-radio-base-913e02e2.js +0 -101
- package/mwc-radio.css-4e140252.js +0 -5
- package/mwc-radio.css-7454bb11.mjs +0 -10
- package/textfield-62e16cc2.js +0 -133
- package/textfield-63d1859a.mjs +0 -932
- /package/{aria-property-849c8816.js → aria-property-52VAcg_f.js} +0 -0
- /package/{aria-property-fa2717fe.mjs → aria-property-wYjPNXcK.mjs} +0 -0
- /package/{inert.esm-2cee6f2e.js → inert.esm-TSRtlTFV.js} +0 -0
- /package/{observer-a096ab43.js → observer-LlGBroG9.js} +0 -0
- /package/{observer-be7b92e2.mjs → observer-cKAgu-MI.mjs} +0 -0
- /package/{property-9b6ea53b.mjs → property-K7hFBmOi.mjs} +0 -0
- /package/{property-57f6f6fe.js → property-iZpLBvy-.js} +0 -0
- /package/{query-assigned-elements-f623705d.js → query-assigned-elements-j_5ZiL65.js} +0 -0
- /package/{query-assigned-elements-4a39219d.mjs → query-assigned-elements-yFWOzcsT.mjs} +0 -0
- /package/{tslib.es6-98719205.js → tslib.es6-5xG0QhxF.js} +0 -0
- /package/{utils-a8190a39.js → utils-W3ENJhq-.js} +0 -0
- /package/{utils-2932417c.mjs → utils-xAXEDL0Y.mjs} +0 -0
package/list-item-04b6ffa1.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";const c=require("./mwc-list-item-base-297d86b0.js"),e=require("./query-assigned-elements-f623705d.js"),v=require("./mwc-list-item.css-25adc0c4.js"),a=`.mdc-deprecated-list-item__text{padding-left:var(--cv-list-item-text-padding, 0)}
|
2
|
-
`;var o=Object.defineProperty,I=Object.getOwnPropertyDescriptor,L=(l,s,r,i)=>{for(var t=i>1?void 0:i?I(s,r):s,n=l.length-1,m;n>=0;n--)(m=l[n])&&(t=(i?m(s,r,t):m(t))||t);return i&&t&&o(s,r,t),t};exports.CovalentListItem=class extends c.ListItemBase{};exports.CovalentListItem.styles=[e.i`
|
3
|
-
${e.r(v.styles)}
|
4
|
-
`,e.i`
|
5
|
-
${e.r(v.styles$1)}
|
6
|
-
`,e.i`
|
7
|
-
${e.r(a)}
|
8
|
-
`];exports.CovalentListItem=L([e.e("cv-list-item")],exports.CovalentListItem);const C=exports.CovalentListItem;exports.CovalentListItem$1=C;exports.styles=a;
|
package/list-item-1c4f9e23.mjs
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
import { L as v } from "./mwc-list-item-base-fe4398c3.mjs";
|
2
|
-
import { i as m, r as o, e as n } from "./query-assigned-elements-4a39219d.mjs";
|
3
|
-
import { s as c, a as f } from "./mwc-list-item.css-b0009fc7.mjs";
|
4
|
-
const _ = `.mdc-deprecated-list-item__text{padding-left:var(--cv-list-item-text-padding, 0)}
|
5
|
-
`;
|
6
|
-
var d = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, x = (p, e, a, s) => {
|
7
|
-
for (var t = s > 1 ? void 0 : s ? $(e, a) : e, i = p.length - 1, l; i >= 0; i--)
|
8
|
-
(l = p[i]) && (t = (s ? l(e, a, t) : l(t)) || t);
|
9
|
-
return s && t && d(e, a, t), t;
|
10
|
-
};
|
11
|
-
let r = class extends v {
|
12
|
-
};
|
13
|
-
r.styles = [
|
14
|
-
m`
|
15
|
-
${o(c)}
|
16
|
-
`,
|
17
|
-
m`
|
18
|
-
${o(f)}
|
19
|
-
`,
|
20
|
-
m`
|
21
|
-
${o(_)}
|
22
|
-
`
|
23
|
-
];
|
24
|
-
r = x([
|
25
|
-
n("cv-list-item")
|
26
|
-
], r);
|
27
|
-
const O = r;
|
28
|
-
export {
|
29
|
-
r as C,
|
30
|
-
O as a,
|
31
|
-
_ as s
|
32
|
-
};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";const i=require("./tslib.es6-98719205.js"),h=require("./ripple-handlers-5d5b21db.js"),r=require("./aria-property-849c8816.js"),k=require("./form-element-c553d6f5.js"),l=require("./query-assigned-elements-f623705d.js"),n=require("./property-57f6f6fe.js"),c=require("./state-0974a8e5.js"),b=require("./event-options-3f5eb195.js"),p=require("./query-680f1868.js"),v=require("./class-map-b5efe8da.js"),s=require("./if-defined-f1c45245.js");/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2019 Google LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/class t extends k.FormElement{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.name="",this.value="on",this.reducedTouchTarget=!1,this.animationClass="",this.shouldRenderRipple=!1,this.focused=!1,this.mdcFoundationClass=void 0,this.mdcFoundation=void 0,this.rippleElement=null,this.rippleHandlers=new h.RippleHandlers(()=>(this.shouldRenderRipple=!0,this.ripple.then(e=>this.rippleElement=e),this.ripple))}createAdapter(){return{}}update(e){const a=e.get("indeterminate"),d=e.get("checked"),o=e.get("disabled");if(a!==void 0||d!==void 0||o!==void 0){const u=this.calculateAnimationStateName(!!d,!!a,!!o),m=this.calculateAnimationStateName(this.checked,this.indeterminate,this.disabled);this.animationClass=`${u}-${m}`}super.update(e)}calculateAnimationStateName(e,a,d){return d?"disabled":a?"indeterminate":e?"checked":"unchecked"}renderRipple(){return this.shouldRenderRipple?this.renderRippleTemplate():""}renderRippleTemplate(){return l.x`<mwc-ripple
|
6
|
-
.disabled="${this.disabled}"
|
7
|
-
unbounded></mwc-ripple>`}render(){const e=this.indeterminate||this.checked,a={"mdc-checkbox--disabled":this.disabled,"mdc-checkbox--selected":e,"mdc-checkbox--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-checkbox--anim-checked-indeterminate":this.animationClass=="checked-indeterminate","mdc-checkbox--anim-checked-unchecked":this.animationClass=="checked-unchecked","mdc-checkbox--anim-indeterminate-checked":this.animationClass=="indeterminate-checked","mdc-checkbox--anim-indeterminate-unchecked":this.animationClass=="indeterminate-unchecked","mdc-checkbox--anim-unchecked-checked":this.animationClass=="unchecked-checked","mdc-checkbox--anim-unchecked-indeterminate":this.animationClass=="unchecked-indeterminate"},d=this.indeterminate?"mixed":void 0;return l.x`
|
8
|
-
<div class="mdc-checkbox mdc-checkbox--upgraded ${v.o(a)}">
|
9
|
-
<input type="checkbox"
|
10
|
-
class="mdc-checkbox__native-control"
|
11
|
-
name="${s.l(this.name)}"
|
12
|
-
aria-checked="${s.l(d)}"
|
13
|
-
aria-label="${s.l(this.ariaLabel)}"
|
14
|
-
aria-labelledby="${s.l(this.ariaLabelledBy)}"
|
15
|
-
aria-describedby="${s.l(this.ariaDescribedBy)}"
|
16
|
-
data-indeterminate="${this.indeterminate?"true":"false"}"
|
17
|
-
?disabled="${this.disabled}"
|
18
|
-
.indeterminate="${this.indeterminate}"
|
19
|
-
.checked="${this.checked}"
|
20
|
-
.value="${this.value}"
|
21
|
-
@change="${this.handleChange}"
|
22
|
-
@focus="${this.handleFocus}"
|
23
|
-
@blur="${this.handleBlur}"
|
24
|
-
@mousedown="${this.handleRippleMouseDown}"
|
25
|
-
@mouseenter="${this.handleRippleMouseEnter}"
|
26
|
-
@mouseleave="${this.handleRippleMouseLeave}"
|
27
|
-
@touchstart="${this.handleRippleTouchStart}"
|
28
|
-
@touchend="${this.handleRippleDeactivate}"
|
29
|
-
@touchcancel="${this.handleRippleDeactivate}">
|
30
|
-
<div class="mdc-checkbox__background"
|
31
|
-
@animationend="${this.resetAnimationClass}">
|
32
|
-
<svg class="mdc-checkbox__checkmark"
|
33
|
-
viewBox="0 0 24 24">
|
34
|
-
<path class="mdc-checkbox__checkmark-path"
|
35
|
-
fill="none"
|
36
|
-
d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
|
37
|
-
</svg>
|
38
|
-
<div class="mdc-checkbox__mixedmark"></div>
|
39
|
-
</div>
|
40
|
-
${this.renderRipple()}
|
41
|
-
</div>`}setFormData(e){this.name&&this.checked&&e.append(this.name,this.value)}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleBlur(){this.focused=!1,this.handleRippleBlur()}handleRippleMouseDown(e){const a=()=>{window.removeEventListener("mouseup",a),this.handleRippleDeactivate()};window.addEventListener("mouseup",a),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}handleChange(){this.checked=this.formElement.checked,this.indeterminate=this.formElement.indeterminate}resetAnimationClass(){this.animationClass=""}get isRippleActive(){var e;return((e=this.rippleElement)===null||e===void 0?void 0:e.isActive)||!1}}i.__decorate([p.i(".mdc-checkbox")],t.prototype,"mdcRoot",void 0);i.__decorate([p.i("input")],t.prototype,"formElement",void 0);i.__decorate([n.n({type:Boolean,reflect:!0})],t.prototype,"checked",void 0);i.__decorate([n.n({type:Boolean})],t.prototype,"indeterminate",void 0);i.__decorate([n.n({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0);i.__decorate([n.n({type:String,reflect:!0})],t.prototype,"name",void 0);i.__decorate([n.n({type:String})],t.prototype,"value",void 0);i.__decorate([r.ariaProperty,n.n({type:String,attribute:"aria-label"})],t.prototype,"ariaLabel",void 0);i.__decorate([r.ariaProperty,n.n({type:String,attribute:"aria-labelledby"})],t.prototype,"ariaLabelledBy",void 0);i.__decorate([r.ariaProperty,n.n({type:String,attribute:"aria-describedby"})],t.prototype,"ariaDescribedBy",void 0);i.__decorate([n.n({type:Boolean})],t.prototype,"reducedTouchTarget",void 0);i.__decorate([c.t()],t.prototype,"animationClass",void 0);i.__decorate([c.t()],t.prototype,"shouldRenderRipple",void 0);i.__decorate([c.t()],t.prototype,"focused",void 0);i.__decorate([h.e("mwc-ripple")],t.prototype,"ripple",void 0);i.__decorate([b.e({passive:!0})],t.prototype,"handleRippleTouchStart",null);exports.CheckboxBase=t;
|
@@ -1,198 +0,0 @@
|
|
1
|
-
import { f as t } from "./tslib.es6-f3e988cd.mjs";
|
2
|
-
import { e as u, R as k } from "./ripple-handlers-f37f21cf.mjs";
|
3
|
-
import { a as r } from "./aria-property-fa2717fe.mjs";
|
4
|
-
import { F as b } from "./form-element-ffcf59ff.mjs";
|
5
|
-
import { x as l } from "./query-assigned-elements-4a39219d.mjs";
|
6
|
-
import { n as d } from "./property-9b6ea53b.mjs";
|
7
|
-
import { t as c } from "./state-b5e865db.mjs";
|
8
|
-
import { e as v } from "./event-options-78d6cf94.mjs";
|
9
|
-
import { i as h } from "./query-d843aa92.mjs";
|
10
|
-
import { o as f } from "./class-map-4b94b017.mjs";
|
11
|
-
import { l as s } from "./if-defined-c367f208.mjs";
|
12
|
-
/**
|
13
|
-
* @license
|
14
|
-
* Copyright 2019 Google LLC
|
15
|
-
* SPDX-License-Identifier: Apache-2.0
|
16
|
-
*/
|
17
|
-
class i extends b {
|
18
|
-
constructor() {
|
19
|
-
super(...arguments), this.checked = !1, this.indeterminate = !1, this.disabled = !1, this.name = "", this.value = "on", this.reducedTouchTarget = !1, this.animationClass = "", this.shouldRenderRipple = !1, this.focused = !1, this.mdcFoundationClass = void 0, this.mdcFoundation = void 0, this.rippleElement = null, this.rippleHandlers = new k(() => (this.shouldRenderRipple = !0, this.ripple.then((e) => this.rippleElement = e), this.ripple));
|
20
|
-
}
|
21
|
-
createAdapter() {
|
22
|
-
return {};
|
23
|
-
}
|
24
|
-
update(e) {
|
25
|
-
const a = e.get("indeterminate"), n = e.get("checked"), o = e.get("disabled");
|
26
|
-
if (a !== void 0 || n !== void 0 || o !== void 0) {
|
27
|
-
const p = this.calculateAnimationStateName(!!n, !!a, !!o), m = this.calculateAnimationStateName(this.checked, this.indeterminate, this.disabled);
|
28
|
-
this.animationClass = `${p}-${m}`;
|
29
|
-
}
|
30
|
-
super.update(e);
|
31
|
-
}
|
32
|
-
calculateAnimationStateName(e, a, n) {
|
33
|
-
return n ? "disabled" : a ? "indeterminate" : e ? "checked" : "unchecked";
|
34
|
-
}
|
35
|
-
// TODO(dfreedm): Make this use selected as a param after Polymer/internal#739
|
36
|
-
/** @soyTemplate */
|
37
|
-
renderRipple() {
|
38
|
-
return this.shouldRenderRipple ? this.renderRippleTemplate() : "";
|
39
|
-
}
|
40
|
-
/** @soyTemplate */
|
41
|
-
renderRippleTemplate() {
|
42
|
-
return l`<mwc-ripple
|
43
|
-
.disabled="${this.disabled}"
|
44
|
-
unbounded></mwc-ripple>`;
|
45
|
-
}
|
46
|
-
/**
|
47
|
-
* @soyTemplate
|
48
|
-
* @soyAttributes checkboxAttributes: input
|
49
|
-
* @soyClasses checkboxClasses: .mdc-checkbox
|
50
|
-
*/
|
51
|
-
render() {
|
52
|
-
const e = this.indeterminate || this.checked, a = {
|
53
|
-
"mdc-checkbox--disabled": this.disabled,
|
54
|
-
"mdc-checkbox--selected": e,
|
55
|
-
"mdc-checkbox--touch": !this.reducedTouchTarget,
|
56
|
-
"mdc-ripple-upgraded--background-focused": this.focused,
|
57
|
-
// transition animiation classes
|
58
|
-
"mdc-checkbox--anim-checked-indeterminate": this.animationClass == "checked-indeterminate",
|
59
|
-
"mdc-checkbox--anim-checked-unchecked": this.animationClass == "checked-unchecked",
|
60
|
-
"mdc-checkbox--anim-indeterminate-checked": this.animationClass == "indeterminate-checked",
|
61
|
-
"mdc-checkbox--anim-indeterminate-unchecked": this.animationClass == "indeterminate-unchecked",
|
62
|
-
"mdc-checkbox--anim-unchecked-checked": this.animationClass == "unchecked-checked",
|
63
|
-
"mdc-checkbox--anim-unchecked-indeterminate": this.animationClass == "unchecked-indeterminate"
|
64
|
-
}, n = this.indeterminate ? "mixed" : void 0;
|
65
|
-
return l`
|
66
|
-
<div class="mdc-checkbox mdc-checkbox--upgraded ${f(a)}">
|
67
|
-
<input type="checkbox"
|
68
|
-
class="mdc-checkbox__native-control"
|
69
|
-
name="${s(this.name)}"
|
70
|
-
aria-checked="${s(n)}"
|
71
|
-
aria-label="${s(this.ariaLabel)}"
|
72
|
-
aria-labelledby="${s(this.ariaLabelledBy)}"
|
73
|
-
aria-describedby="${s(this.ariaDescribedBy)}"
|
74
|
-
data-indeterminate="${this.indeterminate ? "true" : "false"}"
|
75
|
-
?disabled="${this.disabled}"
|
76
|
-
.indeterminate="${this.indeterminate}"
|
77
|
-
.checked="${this.checked}"
|
78
|
-
.value="${this.value}"
|
79
|
-
@change="${this.handleChange}"
|
80
|
-
@focus="${this.handleFocus}"
|
81
|
-
@blur="${this.handleBlur}"
|
82
|
-
@mousedown="${this.handleRippleMouseDown}"
|
83
|
-
@mouseenter="${this.handleRippleMouseEnter}"
|
84
|
-
@mouseleave="${this.handleRippleMouseLeave}"
|
85
|
-
@touchstart="${this.handleRippleTouchStart}"
|
86
|
-
@touchend="${this.handleRippleDeactivate}"
|
87
|
-
@touchcancel="${this.handleRippleDeactivate}">
|
88
|
-
<div class="mdc-checkbox__background"
|
89
|
-
@animationend="${this.resetAnimationClass}">
|
90
|
-
<svg class="mdc-checkbox__checkmark"
|
91
|
-
viewBox="0 0 24 24">
|
92
|
-
<path class="mdc-checkbox__checkmark-path"
|
93
|
-
fill="none"
|
94
|
-
d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
|
95
|
-
</svg>
|
96
|
-
<div class="mdc-checkbox__mixedmark"></div>
|
97
|
-
</div>
|
98
|
-
${this.renderRipple()}
|
99
|
-
</div>`;
|
100
|
-
}
|
101
|
-
setFormData(e) {
|
102
|
-
this.name && this.checked && e.append(this.name, this.value);
|
103
|
-
}
|
104
|
-
handleFocus() {
|
105
|
-
this.focused = !0, this.handleRippleFocus();
|
106
|
-
}
|
107
|
-
handleBlur() {
|
108
|
-
this.focused = !1, this.handleRippleBlur();
|
109
|
-
}
|
110
|
-
handleRippleMouseDown(e) {
|
111
|
-
const a = () => {
|
112
|
-
window.removeEventListener("mouseup", a), this.handleRippleDeactivate();
|
113
|
-
};
|
114
|
-
window.addEventListener("mouseup", a), this.rippleHandlers.startPress(e);
|
115
|
-
}
|
116
|
-
handleRippleTouchStart(e) {
|
117
|
-
this.rippleHandlers.startPress(e);
|
118
|
-
}
|
119
|
-
handleRippleDeactivate() {
|
120
|
-
this.rippleHandlers.endPress();
|
121
|
-
}
|
122
|
-
handleRippleMouseEnter() {
|
123
|
-
this.rippleHandlers.startHover();
|
124
|
-
}
|
125
|
-
handleRippleMouseLeave() {
|
126
|
-
this.rippleHandlers.endHover();
|
127
|
-
}
|
128
|
-
handleRippleFocus() {
|
129
|
-
this.rippleHandlers.startFocus();
|
130
|
-
}
|
131
|
-
handleRippleBlur() {
|
132
|
-
this.rippleHandlers.endFocus();
|
133
|
-
}
|
134
|
-
handleChange() {
|
135
|
-
this.checked = this.formElement.checked, this.indeterminate = this.formElement.indeterminate;
|
136
|
-
}
|
137
|
-
resetAnimationClass() {
|
138
|
-
this.animationClass = "";
|
139
|
-
}
|
140
|
-
get isRippleActive() {
|
141
|
-
var e;
|
142
|
-
return ((e = this.rippleElement) === null || e === void 0 ? void 0 : e.isActive) || !1;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
t([
|
146
|
-
h(".mdc-checkbox")
|
147
|
-
], i.prototype, "mdcRoot", void 0);
|
148
|
-
t([
|
149
|
-
h("input")
|
150
|
-
], i.prototype, "formElement", void 0);
|
151
|
-
t([
|
152
|
-
d({ type: Boolean, reflect: !0 })
|
153
|
-
], i.prototype, "checked", void 0);
|
154
|
-
t([
|
155
|
-
d({ type: Boolean })
|
156
|
-
], i.prototype, "indeterminate", void 0);
|
157
|
-
t([
|
158
|
-
d({ type: Boolean, reflect: !0 })
|
159
|
-
], i.prototype, "disabled", void 0);
|
160
|
-
t([
|
161
|
-
d({ type: String, reflect: !0 })
|
162
|
-
], i.prototype, "name", void 0);
|
163
|
-
t([
|
164
|
-
d({ type: String })
|
165
|
-
], i.prototype, "value", void 0);
|
166
|
-
t([
|
167
|
-
r,
|
168
|
-
d({ type: String, attribute: "aria-label" })
|
169
|
-
], i.prototype, "ariaLabel", void 0);
|
170
|
-
t([
|
171
|
-
r,
|
172
|
-
d({ type: String, attribute: "aria-labelledby" })
|
173
|
-
], i.prototype, "ariaLabelledBy", void 0);
|
174
|
-
t([
|
175
|
-
r,
|
176
|
-
d({ type: String, attribute: "aria-describedby" })
|
177
|
-
], i.prototype, "ariaDescribedBy", void 0);
|
178
|
-
t([
|
179
|
-
d({ type: Boolean })
|
180
|
-
], i.prototype, "reducedTouchTarget", void 0);
|
181
|
-
t([
|
182
|
-
c()
|
183
|
-
], i.prototype, "animationClass", void 0);
|
184
|
-
t([
|
185
|
-
c()
|
186
|
-
], i.prototype, "shouldRenderRipple", void 0);
|
187
|
-
t([
|
188
|
-
c()
|
189
|
-
], i.prototype, "focused", void 0);
|
190
|
-
t([
|
191
|
-
u("mwc-ripple")
|
192
|
-
], i.prototype, "ripple", void 0);
|
193
|
-
t([
|
194
|
-
v({ passive: !0 })
|
195
|
-
], i.prototype, "handleRippleTouchStart", null);
|
196
|
-
export {
|
197
|
-
i as C
|
198
|
-
};
|
@@ -1,111 +0,0 @@
|
|
1
|
-
"use strict";const p=require("./tslib.es6-98719205.js"),O=require("./query-assigned-elements-f623705d.js"),B=require("./mwc-list-item-base-297d86b0.js"),H=require("./base-element-58a3f9ea.js"),L=require("./observer-a096ab43.js"),F=require("./utils-a8190a39.js"),I=require("./property-57f6f6fe.js"),K=require("./query-680f1868.js"),W=require("./query-assigned-nodes-99eae71d.js"),k=require("./if-defined-f1c45245.js");/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2021 Google LLC
|
4
|
-
* SPDX-LIcense-Identifier: Apache-2.0
|
5
|
-
*/const V=O.i`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-deprecated-list-item__meta ::slotted(.material-icons),.mdc-deprecated-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-deprecated-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}[dir=rtl] .mdc-deprecated-list-item__meta,.mdc-deprecated-list-item__meta[dir=rtl]{margin-left:0;margin-right:auto}.mdc-deprecated-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-deprecated-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-deprecated-list-item__text ::slotted([for]),.mdc-deprecated-list-item__text[for]{pointer-events:none}.mdc-deprecated-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-deprecated-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-deprecated-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-deprecated-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-deprecated-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-deprecated-list--dense .mdc-deprecated-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-deprecated-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-deprecated-list-item__text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-deprecated-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-deprecated-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-deprecated-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}[dir=rtl] :host([graphic=avatar]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=medium]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=large]) .mdc-deprecated-list-item__graphic,[dir=rtl] :host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=avatar]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=medium]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=large]) .mdc-deprecated-list-item__graphic[dir=rtl],:host([graphic=control]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}[dir=rtl] :host([graphic=icon]) .mdc-deprecated-list-item__graphic,:host([graphic=icon]) .mdc-deprecated-list-item__graphic[dir=rtl]{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic.multi,:host([graphic=large]) .mdc-deprecated-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-deprecated-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}`;/**
|
6
|
-
* @license
|
7
|
-
* Copyright 2020 Google LLC
|
8
|
-
* SPDX-License-Identifier: Apache-2.0
|
9
|
-
*/let N=class extends B.ListItemBase{};N.styles=[V];N=p.__decorate([O.e("mwc-list-item")],N);/**
|
10
|
-
* @license
|
11
|
-
* Copyright 2016 Google Inc.
|
12
|
-
*
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
-
* copies of the Software, and to permit persons to whom the Software is
|
18
|
-
* furnished to do so, subject to the following conditions:
|
19
|
-
*
|
20
|
-
* The above copyright notice and this permission notice shall be included in
|
21
|
-
* all copies or substantial portions of the Software.
|
22
|
-
*
|
23
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
29
|
-
* THE SOFTWARE.
|
30
|
-
*/var X=function(){function r(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(r,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.destroy=function(){},r}();/**
|
31
|
-
* @license
|
32
|
-
* Copyright 2020 Google Inc.
|
33
|
-
*
|
34
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
35
|
-
* of this software and associated documentation files (the "Software"), to deal
|
36
|
-
* in the Software without restriction, including without limitation the rights
|
37
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
38
|
-
* copies of the Software, and to permit persons to whom the Software is
|
39
|
-
* furnished to do so, subject to the following conditions:
|
40
|
-
*
|
41
|
-
* The above copyright notice and this permission notice shall be included in
|
42
|
-
* all copies or substantial portions of the Software.
|
43
|
-
*
|
44
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
45
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
46
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
47
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
48
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
49
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
50
|
-
* THE SOFTWARE.
|
51
|
-
*/var n={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape",TAB:"Tab"},c=new Set;c.add(n.BACKSPACE);c.add(n.ENTER);c.add(n.SPACEBAR);c.add(n.PAGE_UP);c.add(n.PAGE_DOWN);c.add(n.END);c.add(n.HOME);c.add(n.ARROW_LEFT);c.add(n.ARROW_UP);c.add(n.ARROW_RIGHT);c.add(n.ARROW_DOWN);c.add(n.DELETE);c.add(n.ESCAPE);c.add(n.TAB);var h={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27,TAB:9},l=new Map;l.set(h.BACKSPACE,n.BACKSPACE);l.set(h.ENTER,n.ENTER);l.set(h.SPACEBAR,n.SPACEBAR);l.set(h.PAGE_UP,n.PAGE_UP);l.set(h.PAGE_DOWN,n.PAGE_DOWN);l.set(h.END,n.END);l.set(h.HOME,n.HOME);l.set(h.ARROW_LEFT,n.ARROW_LEFT);l.set(h.ARROW_UP,n.ARROW_UP);l.set(h.ARROW_RIGHT,n.ARROW_RIGHT);l.set(h.ARROW_DOWN,n.ARROW_DOWN);l.set(h.DELETE,n.DELETE);l.set(h.ESCAPE,n.ESCAPE);l.set(h.TAB,n.TAB);var S=new Set;S.add(n.PAGE_UP);S.add(n.PAGE_DOWN);S.add(n.END);S.add(n.HOME);S.add(n.ARROW_LEFT);S.add(n.ARROW_UP);S.add(n.ARROW_RIGHT);S.add(n.ARROW_DOWN);function A(r){var e=r.key;if(c.has(e))return e;var t=l.get(r.keyCode);return t||n.UNKNOWN}/**
|
52
|
-
* @license
|
53
|
-
* Copyright 2018 Google Inc.
|
54
|
-
*
|
55
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
56
|
-
* of this software and associated documentation files (the "Software"), to deal
|
57
|
-
* in the Software without restriction, including without limitation the rights
|
58
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
59
|
-
* copies of the Software, and to permit persons to whom the Software is
|
60
|
-
* furnished to do so, subject to the following conditions:
|
61
|
-
*
|
62
|
-
* The above copyright notice and this permission notice shall be included in
|
63
|
-
* all copies or substantial portions of the Software.
|
64
|
-
*
|
65
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
66
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
67
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
68
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
69
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
70
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
71
|
-
* THE SOFTWARE.
|
72
|
-
*/var x,E,a={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"};x={},x[""+a.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",x[""+a.LIST_ITEM_CLASS]="mdc-list-item",x[""+a.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",x[""+a.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",x[""+a.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",x[""+a.ROOT]="mdc-list";var v=(E={},E[""+a.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",E[""+a.LIST_ITEM_CLASS]="mdc-deprecated-list-item",E[""+a.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",E[""+a.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",E[""+a.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",E[""+a.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",E[""+a.ROOT]="mdc-deprecated-list",E),C={ACTION_EVENT:"MDCList:action",SELECTION_CHANGE_EVENT:"MDCList:selectionChange",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:`
|
73
|
-
.`+a.LIST_ITEM_CLASS+` button:not(:disabled),
|
74
|
-
.`+a.LIST_ITEM_CLASS+` a,
|
75
|
-
.`+v[a.LIST_ITEM_CLASS]+` button:not(:disabled),
|
76
|
-
.`+v[a.LIST_ITEM_CLASS]+` a
|
77
|
-
`,DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:`
|
78
|
-
.`+a.LIST_ITEM_CLASS+` button:not(:disabled),
|
79
|
-
.`+a.LIST_ITEM_CLASS+` a,
|
80
|
-
.`+a.LIST_ITEM_CLASS+` input[type="radio"]:not(:disabled),
|
81
|
-
.`+a.LIST_ITEM_CLASS+` input[type="checkbox"]:not(:disabled),
|
82
|
-
.`+v[a.LIST_ITEM_CLASS]+` button:not(:disabled),
|
83
|
-
.`+v[a.LIST_ITEM_CLASS]+` a,
|
84
|
-
.`+v[a.LIST_ITEM_CLASS]+` input[type="radio"]:not(:disabled),
|
85
|
-
.`+v[a.LIST_ITEM_CLASS]+` input[type="checkbox"]:not(:disabled)
|
86
|
-
`,RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},m={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};/**
|
87
|
-
* @license
|
88
|
-
* Copyright 2020 Google LLC
|
89
|
-
* SPDX-License-Identifier: Apache-2.0
|
90
|
-
*/const M=(r,e)=>r-e,G=(r,e)=>{const t=Array.from(r),i=Array.from(e),s={added:[],removed:[]},d=t.sort(M),o=i.sort(M);let _=0,b=0;for(;_<d.length||b<o.length;){const f=d[_],g=o[b];if(f===g){_++,b++;continue}if(f!==void 0&&(g===void 0||f<g)){s.removed.push(f),_++;continue}if(g!==void 0&&(f===void 0||g<f)){s.added.push(g),b++;continue}}return s},q=["input","button","textarea","select"];function R(r){return r instanceof Set}const D=r=>{const e=r===m.UNSET_INDEX?new Set:r;return R(e)?new Set(e):new Set([e])};class P extends X{constructor(e){super(Object.assign(Object.assign({},P.defaultAdapter),e)),this.isMulti_=!1,this.wrapFocus_=!1,this.isVertical_=!0,this.selectedIndex_=m.UNSET_INDEX,this.focusedItemIndex_=m.UNSET_INDEX,this.useActivatedClass_=!1,this.ariaCurrentAttrValue_=null}static get strings(){return C}static get numbers(){return m}static get defaultAdapter(){return{focusItemAtIndex:()=>{},getFocusedElementIndex:()=>0,getListItemCount:()=>0,isFocusInsideList:()=>!1,isRootFocused:()=>!1,notifyAction:()=>{},notifySelected:()=>{},getSelectedStateForElementIndex:()=>!1,setDisabledStateForElementIndex:()=>{},getDisabledStateForElementIndex:()=>!1,setSelectedStateForElementIndex:()=>{},setActivatedStateForElementIndex:()=>{},setTabIndexForElementIndex:()=>{},setAttributeForElementIndex:()=>{},getAttributeForElementIndex:()=>null}}setWrapFocus(e){this.wrapFocus_=e}setMulti(e){this.isMulti_=e;const t=this.selectedIndex_;if(e){if(!R(t)){const i=t===m.UNSET_INDEX;this.selectedIndex_=i?new Set:new Set([t])}}else if(R(t))if(t.size){const i=Array.from(t).sort(M);this.selectedIndex_=i[0]}else this.selectedIndex_=m.UNSET_INDEX}setVerticalOrientation(e){this.isVertical_=e}setUseActivatedClass(e){this.useActivatedClass_=e}getSelectedIndex(){return this.selectedIndex_}setSelectedIndex(e){this.isIndexValid_(e)&&(this.isMulti_?this.setMultiSelectionAtIndex_(D(e)):this.setSingleSelectionAtIndex_(e))}handleFocusIn(e,t){t>=0&&this.adapter.setTabIndexForElementIndex(t,0)}handleFocusOut(e,t){t>=0&&this.adapter.setTabIndexForElementIndex(t,-1),setTimeout(()=>{this.adapter.isFocusInsideList()||this.setTabindexToFirstSelectedItem_()},0)}handleKeydown(e,t,i){const s=A(e)==="ArrowLeft",d=A(e)==="ArrowUp",o=A(e)==="ArrowRight",_=A(e)==="ArrowDown",b=A(e)==="Home",f=A(e)==="End",g=A(e)==="Enter",z=A(e)==="Spacebar";if(this.adapter.isRootFocused()){d||f?(e.preventDefault(),this.focusLastElement()):(_||b)&&(e.preventDefault(),this.focusFirstElement());return}let T=this.adapter.getFocusedElementIndex();if(T===-1&&(T=i,T<0))return;let y;if(this.isVertical_&&_||!this.isVertical_&&o)this.preventDefaultEvent(e),y=this.focusNextElement(T);else if(this.isVertical_&&d||!this.isVertical_&&s)this.preventDefaultEvent(e),y=this.focusPrevElement(T);else if(b)this.preventDefaultEvent(e),y=this.focusFirstElement();else if(f)this.preventDefaultEvent(e),y=this.focusLastElement();else if((g||z)&&t){const U=e.target;if(U&&U.tagName==="A"&&g)return;this.preventDefaultEvent(e),this.setSelectedIndexOnAction_(T,!0)}this.focusedItemIndex_=T,y!==void 0&&(this.setTabindexAtIndex_(y),this.focusedItemIndex_=y)}handleSingleSelection(e,t,i){e!==m.UNSET_INDEX&&(this.setSelectedIndexOnAction_(e,t,i),this.setTabindexAtIndex_(e),this.focusedItemIndex_=e)}focusNextElement(e){const t=this.adapter.getListItemCount();let i=e+1;if(i>=t)if(this.wrapFocus_)i=0;else return e;return this.adapter.focusItemAtIndex(i),i}focusPrevElement(e){let t=e-1;if(t<0)if(this.wrapFocus_)t=this.adapter.getListItemCount()-1;else return e;return this.adapter.focusItemAtIndex(t),t}focusFirstElement(){return this.adapter.focusItemAtIndex(0),0}focusLastElement(){const e=this.adapter.getListItemCount()-1;return this.adapter.focusItemAtIndex(e),e}setEnabled(e,t){this.isIndexValid_(e)&&this.adapter.setDisabledStateForElementIndex(e,!t)}preventDefaultEvent(e){const i=`${e.target.tagName}`.toLowerCase();q.indexOf(i)===-1&&e.preventDefault()}setSingleSelectionAtIndex_(e,t=!0){this.selectedIndex_!==e&&(this.selectedIndex_!==m.UNSET_INDEX&&(this.adapter.setSelectedStateForElementIndex(this.selectedIndex_,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(this.selectedIndex_,!1)),t&&this.adapter.setSelectedStateForElementIndex(e,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(e,!0),this.setAriaForSingleSelectionAtIndex_(e),this.selectedIndex_=e,this.adapter.notifySelected(e))}setMultiSelectionAtIndex_(e,t=!0){const i=D(this.selectedIndex_),s=G(i,e);if(!(!s.removed.length&&!s.added.length)){for(const d of s.removed)t&&this.adapter.setSelectedStateForElementIndex(d,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(d,!1);for(const d of s.added)t&&this.adapter.setSelectedStateForElementIndex(d,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(d,!0);this.selectedIndex_=e,this.adapter.notifySelected(e,s)}}setAriaForSingleSelectionAtIndex_(e){this.selectedIndex_===m.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(e,C.ARIA_CURRENT));const t=this.ariaCurrentAttrValue_!==null,i=t?C.ARIA_CURRENT:C.ARIA_SELECTED;this.selectedIndex_!==m.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false");const s=t?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(e,i,s)}setTabindexAtIndex_(e){this.focusedItemIndex_===m.UNSET_INDEX&&e!==0?this.adapter.setTabIndexForElementIndex(0,-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==e&&this.adapter.setTabIndexForElementIndex(this.focusedItemIndex_,-1),this.adapter.setTabIndexForElementIndex(e,0)}setTabindexToFirstSelectedItem_(){let e=0;typeof this.selectedIndex_=="number"&&this.selectedIndex_!==m.UNSET_INDEX?e=this.selectedIndex_:R(this.selectedIndex_)&&this.selectedIndex_.size>0&&(e=Math.min(...this.selectedIndex_)),this.setTabindexAtIndex_(e)}isIndexValid_(e){if(e instanceof Set){if(!this.isMulti_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");if(e.size===0)return!0;{let t=!1;for(const i of e)if(t=this.isIndexInRange_(i),t)break;return t}}else if(typeof e=="number"){if(this.isMulti_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return e===m.UNSET_INDEX||this.isIndexInRange_(e)}else return!1}isIndexInRange_(e){const t=this.adapter.getListItemCount();return e>=0&&e<t}setSelectedIndexOnAction_(e,t,i){if(this.adapter.getDisabledStateForElementIndex(e))return;let s=e;this.isMulti_&&(s=new Set([e])),this.isIndexValid_(s)&&(this.isMulti_?this.toggleMultiAtIndex(e,i,t):t||i?this.setSingleSelectionAtIndex_(e,t):this.selectedIndex_===e&&this.setSingleSelectionAtIndex_(m.UNSET_INDEX),t&&this.adapter.notifyAction(e))}toggleMultiAtIndex(e,t,i=!0){let s=!1;t===void 0?s=!this.adapter.getSelectedStateForElementIndex(e):s=t;const d=D(this.selectedIndex_);s?d.add(e):d.delete(e),this.setMultiSelectionAtIndex_(d,i)}}/**
|
91
|
-
* @license
|
92
|
-
* Copyright 2020 Google LLC
|
93
|
-
* SPDX-License-Identifier: Apache-2.0
|
94
|
-
*/function $(r,e=50){let t;return function(i=!0){clearTimeout(t),t=setTimeout(()=>{r(i)},e)}}const w=r=>r.hasAttribute("mwc-list-item");function j(){const r=this.itemsReadyResolver;this.itemsReady=new Promise(e=>this.itemsReadyResolver=e),r()}class u extends H.BaseElement{constructor(){super(),this.mdcAdapter=null,this.mdcFoundationClass=P,this.activatable=!1,this.multi=!1,this.wrapFocus=!1,this.itemRoles=null,this.innerRole=null,this.innerAriaLabel=null,this.rootTabbable=!1,this.previousTabindex=null,this.noninteractive=!1,this.itemsReadyResolver=()=>{},this.itemsReady=Promise.resolve([]),this.items_=[];const e=$(this.layout.bind(this));this.debouncedLayout=(t=!0)=>{j.call(this),e(t)}}async getUpdateComplete(){const e=await super.getUpdateComplete();return await this.itemsReady,e}get items(){return this.items_}updateItems(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[],i=[];for(const o of t)w(o)&&(i.push(o),o._managingList=this),o.hasAttribute("divider")&&!o.hasAttribute("role")&&o.setAttribute("role","separator");this.items_=i;const s=new Set;if(this.items_.forEach((o,_)=>{this.itemRoles?o.setAttribute("role",this.itemRoles):o.removeAttribute("role"),o.selected&&s.add(_)}),this.multi)this.select(s);else{const o=s.size?s.entries().next().value[1]:-1;this.select(o)}const d=new Event("items-updated",{bubbles:!0,composed:!0});this.dispatchEvent(d)}get selected(){const e=this.index;if(!R(e))return e===-1?null:this.items[e];const t=[];for(const i of e)t.push(this.items[i]);return t}get index(){return this.mdcFoundation?this.mdcFoundation.getSelectedIndex():-1}render(){const e=this.innerRole===null?void 0:this.innerRole,t=this.innerAriaLabel===null?void 0:this.innerAriaLabel,i=this.rootTabbable?"0":"-1";return O.x`
|
95
|
-
<!-- @ts-ignore -->
|
96
|
-
<ul
|
97
|
-
tabindex=${i}
|
98
|
-
role="${k.l(e)}"
|
99
|
-
aria-label="${k.l(t)}"
|
100
|
-
class="mdc-deprecated-list"
|
101
|
-
@keydown=${this.onKeydown}
|
102
|
-
@focusin=${this.onFocusIn}
|
103
|
-
@focusout=${this.onFocusOut}
|
104
|
-
@request-selected=${this.onRequestSelected}
|
105
|
-
@list-item-rendered=${this.onListItemConnected}>
|
106
|
-
<slot></slot>
|
107
|
-
${this.renderPlaceholder()}
|
108
|
-
</ul>
|
109
|
-
`}renderPlaceholder(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[];return this.emptyMessage!==void 0&&t.length===0?O.x`
|
110
|
-
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
|
111
|
-
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusIn(e,t)}}onFocusOut(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e);this.mdcFoundation.handleFocusOut(e,t)}}onKeydown(e){if(this.mdcFoundation&&this.mdcRoot){const t=this.getIndexOfTarget(e),i=e.target,s=w(i);this.mdcFoundation.handleKeydown(e,s,t)}}onRequestSelected(e){if(this.mdcFoundation){let t=this.getIndexOfTarget(e);if(t===-1&&(this.layout(),t=this.getIndexOfTarget(e),t===-1)||this.items[t].disabled)return;const s=e.detail.selected,d=e.detail.source;this.mdcFoundation.handleSingleSelection(t,d==="interaction",s),e.stopPropagation()}}getIndexOfTarget(e){const t=this.items,i=e.composedPath();for(const s of i){let d=-1;if(F.isNodeElement(s)&&w(s)&&(d=t.indexOf(s)),d!==-1)return d}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(e,t)=>{if(!this.mdcRoot)return"";const s=this.items[e];return s?s.getAttribute(t):""},setAttributeForElementIndex:(e,t,i)=>{if(!this.mdcRoot)return;const s=this.items[e];s&&s.setAttribute(t,i)},focusItemAtIndex:e=>{const t=this.items[e];t&&t.focus()},setTabIndexForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.tabindex=t)},notifyAction:e=>{const t={bubbles:!0,composed:!0};t.detail={index:e};const i=new CustomEvent("action",t);this.dispatchEvent(i)},notifySelected:(e,t)=>{const i={bubbles:!0,composed:!0};i.detail={index:e,diff:t};const s=new CustomEvent("selected",i);this.dispatchEvent(s)},isFocusInsideList:()=>F.doesElementContainFocus(this),isRootFocused:()=>{const e=this.mdcRoot;return e.getRootNode().activeElement===e},setDisabledStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.disabled=t)},getDisabledStateForElementIndex:e=>{const t=this.items[e];return t?t.disabled:!1},setSelectedStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.selected=t)},getSelectedStateForElementIndex:e=>{const t=this.items[e];return t?t.selected:!1},setActivatedStateForElementIndex:(e,t)=>{const i=this.items[e];i&&(i.activated=t)}},this.mdcAdapter}selectUi(e,t=!1){const i=this.items[e];i&&(i.selected=!0,i.activated=t)}deselectUi(e){const t=this.items[e];t&&(t.selected=!1,t.activated=!1)}select(e){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(e)}toggle(e,t){this.multi&&this.mdcFoundation.toggleMultiAtIndex(e,t)}onListItemConnected(e){const t=e.target;this.layout(this.items.indexOf(t)===-1)}layout(e=!0){e&&this.updateItems();const t=this.items[0];for(const i of this.items)i.tabindex=-1;t&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=t):t.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot||!this.items.length)return-1;const e=F.deepActiveElementPath();if(!e.length)return-1;for(let t=e.length-1;t>=0;t--){const i=e[t];if(w(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(e){for(const t of this.items)if(t.tabindex===0){t.tabindex=-1;break}this.items[e].tabindex=0,this.items[e].focus()}focus(){const e=this.mdcRoot;e&&e.focus()}blur(){const e=this.mdcRoot;e&&e.blur()}}p.__decorate([I.n({type:String})],u.prototype,"emptyMessage",void 0);p.__decorate([K.i(".mdc-deprecated-list")],u.prototype,"mdcRoot",void 0);p.__decorate([W.o("",!0,"*")],u.prototype,"assignedElements",void 0);p.__decorate([W.o("",!0,'[tabindex="0"]')],u.prototype,"tabbableElements",void 0);p.__decorate([I.n({type:Boolean}),L.observer(function(r){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(r)})],u.prototype,"activatable",void 0);p.__decorate([I.n({type:Boolean}),L.observer(function(r,e){this.mdcFoundation&&this.mdcFoundation.setMulti(r),e!==void 0&&this.layout()})],u.prototype,"multi",void 0);p.__decorate([I.n({type:Boolean}),L.observer(function(r){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(r)})],u.prototype,"wrapFocus",void 0);p.__decorate([I.n({type:String}),L.observer(function(r,e){e!==void 0&&this.updateItems()})],u.prototype,"itemRoles",void 0);p.__decorate([I.n({type:String})],u.prototype,"innerRole",void 0);p.__decorate([I.n({type:String})],u.prototype,"innerAriaLabel",void 0);p.__decorate([I.n({type:Boolean})],u.prototype,"rootTabbable",void 0);p.__decorate([I.n({type:Boolean,reflect:!0}),L.observer(function(r){var e,t;if(r){const i=(t=(e=this.tabbableElements)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:null;this.previousTabindex=i,i&&i.setAttribute("tabindex","-1")}else!r&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)})],u.prototype,"noninteractive",void 0);exports.ListBase=u;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
"use strict";const s=require("./tslib.es6-98719205.js"),c=require("./ripple-handlers-5d5b21db.js"),l=require("./observer-a096ab43.js"),r=require("./query-assigned-elements-f623705d.js"),n=require("./property-57f6f6fe.js"),d=require("./state-0974a8e5.js"),p=require("./query-680f1868.js"),h=require("./class-map-b5efe8da.js");/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2020 Google LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/class t extends r.s{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new c.RippleHandlers(()=>(this.shouldRenderRipple=!0,this.ripple)),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:e=>{const i=e.type;this.onDown(i==="mousedown"?"mouseup":"touchend",e)}}]}get text(){const e=this.textContent;return e?e.trim():""}render(){const e=this.renderText(),i=this.graphic?this.renderGraphic():r.x``,o=this.hasMeta?this.renderMeta():r.x``;return r.x`
|
6
|
-
${this.renderRipple()}
|
7
|
-
${i}
|
8
|
-
${e}
|
9
|
-
${o}`}renderRipple(){return this.shouldRenderRipple?r.x`
|
10
|
-
<mwc-ripple
|
11
|
-
.activated=${this.activated}>
|
12
|
-
</mwc-ripple>`:this.activated?r.x`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const e={multi:this.multipleGraphics};return r.x`
|
13
|
-
<span class="mdc-deprecated-list-item__graphic material-icons ${h.o(e)}">
|
14
|
-
<slot name="graphic"></slot>
|
15
|
-
</span>`}renderMeta(){return r.x`
|
16
|
-
<span class="mdc-deprecated-list-item__meta material-icons">
|
17
|
-
<slot name="meta"></slot>
|
18
|
-
</span>`}renderText(){const e=this.twoline?this.renderTwoline():this.renderSingleLine();return r.x`
|
19
|
-
<span class="mdc-deprecated-list-item__text">
|
20
|
-
${e}
|
21
|
-
</span>`}renderSingleLine(){return r.x`<slot></slot>`}renderTwoline(){return r.x`
|
22
|
-
<span class="mdc-deprecated-list-item__primary-text">
|
23
|
-
<slot></slot>
|
24
|
-
</span>
|
25
|
-
<span class="mdc-deprecated-list-item__secondary-text">
|
26
|
-
<slot name="secondary"></slot>
|
27
|
-
</span>
|
28
|
-
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(e,i){const o=()=>{window.removeEventListener(e,o),this.rippleHandlers.endPress()};window.addEventListener(e,o),this.rippleHandlers.startPress(i)}fireRequestSelected(e,i){if(this.noninteractive)return;const o=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:i,selected:e}});this.dispatchEvent(o)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const e of this.listeners)for(const i of e.eventNames)e.target.addEventListener(i,e.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const e of this.listeners)for(const i of e.eventNames)e.target.removeEventListener(i,e.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const e=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(e)}}s.__decorate([p.i("slot")],t.prototype,"slotElement",void 0);s.__decorate([c.e("mwc-ripple")],t.prototype,"ripple",void 0);s.__decorate([n.n({type:String})],t.prototype,"value",void 0);s.__decorate([n.n({type:String,reflect:!0})],t.prototype,"group",void 0);s.__decorate([n.n({type:Number,reflect:!0})],t.prototype,"tabindex",void 0);s.__decorate([n.n({type:Boolean,reflect:!0}),l.observer(function(a){a?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")})],t.prototype,"disabled",void 0);s.__decorate([n.n({type:Boolean,reflect:!0})],t.prototype,"twoline",void 0);s.__decorate([n.n({type:Boolean,reflect:!0})],t.prototype,"activated",void 0);s.__decorate([n.n({type:String,reflect:!0})],t.prototype,"graphic",void 0);s.__decorate([n.n({type:Boolean})],t.prototype,"multipleGraphics",void 0);s.__decorate([n.n({type:Boolean})],t.prototype,"hasMeta",void 0);s.__decorate([n.n({type:Boolean,reflect:!0}),l.observer(function(a){a?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")})],t.prototype,"noninteractive",void 0);s.__decorate([n.n({type:Boolean,reflect:!0}),l.observer(function(a){const e=this.getAttribute("role"),i=e==="gridcell"||e==="option"||e==="row"||e==="tab";if(i&&a?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged){this._firstChanged=!1;return}this._skipPropRequest||this.fireRequestSelected(a,"property")})],t.prototype,"selected",void 0);s.__decorate([d.t()],t.prototype,"shouldRenderRipple",void 0);s.__decorate([d.t()],t.prototype,"_managingList",void 0);exports.ListItemBase=t;
|