@covalent/components 8.1.0 → 8.2.0
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
@@ -1,17 +1,209 @@
|
|
1
|
-
import {
|
1
|
+
import { b as e } from "./tslib.es6-S8SvF2K1.mjs";
|
2
|
+
import { e as n, R as p } from "./ripple-handlers-BwaZu9Ps.mjs";
|
3
|
+
import { o as d } from "./observer-cKAgu-MI.mjs";
|
4
|
+
import { s as m, x as s, i as h } from "./query-assigned-elements-yFWOzcsT.mjs";
|
5
|
+
import { n as a } from "./property-K7hFBmOi.mjs";
|
6
|
+
import { t as l } from "./state-inNZe6rL.mjs";
|
7
|
+
import { i as g } from "./query-1WmuF6Bq.mjs";
|
8
|
+
import { o as _ } from "./class-map-YPXv0Hj4.mjs";
|
2
9
|
/**
|
3
10
|
* @license
|
4
|
-
* Copyright
|
5
|
-
* SPDX-
|
11
|
+
* Copyright 2020 Google LLC
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
6
13
|
*/
|
7
|
-
|
14
|
+
class i extends m {
|
15
|
+
constructor() {
|
16
|
+
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 p(() => (this.shouldRenderRipple = !0, this.ripple)), this.listeners = [
|
17
|
+
{
|
18
|
+
target: this,
|
19
|
+
eventNames: ["click"],
|
20
|
+
cb: () => {
|
21
|
+
this.onClick();
|
22
|
+
}
|
23
|
+
},
|
24
|
+
{
|
25
|
+
target: this,
|
26
|
+
eventNames: ["mouseenter"],
|
27
|
+
cb: this.rippleHandlers.startHover
|
28
|
+
},
|
29
|
+
{
|
30
|
+
target: this,
|
31
|
+
eventNames: ["mouseleave"],
|
32
|
+
cb: this.rippleHandlers.endHover
|
33
|
+
},
|
34
|
+
{
|
35
|
+
target: this,
|
36
|
+
eventNames: ["focus"],
|
37
|
+
cb: this.rippleHandlers.startFocus
|
38
|
+
},
|
39
|
+
{
|
40
|
+
target: this,
|
41
|
+
eventNames: ["blur"],
|
42
|
+
cb: this.rippleHandlers.endFocus
|
43
|
+
},
|
44
|
+
{
|
45
|
+
target: this,
|
46
|
+
eventNames: ["mousedown", "touchstart"],
|
47
|
+
cb: (t) => {
|
48
|
+
const r = t.type;
|
49
|
+
this.onDown(r === "mousedown" ? "mouseup" : "touchend", t);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
];
|
53
|
+
}
|
54
|
+
get text() {
|
55
|
+
const t = this.textContent;
|
56
|
+
return t ? t.trim() : "";
|
57
|
+
}
|
58
|
+
render() {
|
59
|
+
const t = this.renderText(), r = this.graphic ? this.renderGraphic() : s``, c = this.hasMeta ? this.renderMeta() : s``;
|
60
|
+
return s`
|
61
|
+
${this.renderRipple()}
|
62
|
+
${r}
|
63
|
+
${t}
|
64
|
+
${c}`;
|
65
|
+
}
|
66
|
+
renderRipple() {
|
67
|
+
return this.shouldRenderRipple ? s`
|
68
|
+
<mwc-ripple
|
69
|
+
.activated=${this.activated}>
|
70
|
+
</mwc-ripple>` : this.activated ? s`<div class="fake-activated-ripple"></div>` : "";
|
71
|
+
}
|
72
|
+
renderGraphic() {
|
73
|
+
const t = {
|
74
|
+
multi: this.multipleGraphics
|
75
|
+
};
|
76
|
+
return s`
|
77
|
+
<span class="mdc-deprecated-list-item__graphic material-icons ${_(t)}">
|
78
|
+
<slot name="graphic"></slot>
|
79
|
+
</span>`;
|
80
|
+
}
|
81
|
+
renderMeta() {
|
82
|
+
return s`
|
83
|
+
<span class="mdc-deprecated-list-item__meta material-icons">
|
84
|
+
<slot name="meta"></slot>
|
85
|
+
</span>`;
|
86
|
+
}
|
87
|
+
renderText() {
|
88
|
+
const t = this.twoline ? this.renderTwoline() : this.renderSingleLine();
|
89
|
+
return s`
|
90
|
+
<span class="mdc-deprecated-list-item__text">
|
91
|
+
${t}
|
92
|
+
</span>`;
|
93
|
+
}
|
94
|
+
renderSingleLine() {
|
95
|
+
return s`<slot></slot>`;
|
96
|
+
}
|
97
|
+
renderTwoline() {
|
98
|
+
return s`
|
99
|
+
<span class="mdc-deprecated-list-item__primary-text">
|
100
|
+
<slot></slot>
|
101
|
+
</span>
|
102
|
+
<span class="mdc-deprecated-list-item__secondary-text">
|
103
|
+
<slot name="secondary"></slot>
|
104
|
+
</span>
|
105
|
+
`;
|
106
|
+
}
|
107
|
+
onClick() {
|
108
|
+
this.fireRequestSelected(!this.selected, "interaction");
|
109
|
+
}
|
110
|
+
onDown(t, r) {
|
111
|
+
const c = () => {
|
112
|
+
window.removeEventListener(t, c), this.rippleHandlers.endPress();
|
113
|
+
};
|
114
|
+
window.addEventListener(t, c), this.rippleHandlers.startPress(r);
|
115
|
+
}
|
116
|
+
fireRequestSelected(t, r) {
|
117
|
+
if (this.noninteractive)
|
118
|
+
return;
|
119
|
+
const c = new CustomEvent("request-selected", { bubbles: !0, composed: !0, detail: { source: r, selected: t } });
|
120
|
+
this.dispatchEvent(c);
|
121
|
+
}
|
122
|
+
connectedCallback() {
|
123
|
+
super.connectedCallback(), this.noninteractive || this.setAttribute("mwc-list-item", "");
|
124
|
+
for (const t of this.listeners)
|
125
|
+
for (const r of t.eventNames)
|
126
|
+
t.target.addEventListener(r, t.cb, { passive: !0 });
|
127
|
+
}
|
128
|
+
disconnectedCallback() {
|
129
|
+
super.disconnectedCallback();
|
130
|
+
for (const t of this.listeners)
|
131
|
+
for (const r of t.eventNames)
|
132
|
+
t.target.removeEventListener(r, t.cb);
|
133
|
+
this._managingList && (this._managingList.debouncedLayout ? this._managingList.debouncedLayout(!0) : this._managingList.layout(!0));
|
134
|
+
}
|
135
|
+
// composed flag, event fire through shadow root and up through composed tree
|
136
|
+
firstUpdated() {
|
137
|
+
const t = new Event("list-item-rendered", { bubbles: !0, composed: !0 });
|
138
|
+
this.dispatchEvent(t);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
e([
|
142
|
+
g("slot")
|
143
|
+
], i.prototype, "slotElement", void 0);
|
144
|
+
e([
|
145
|
+
n("mwc-ripple")
|
146
|
+
], i.prototype, "ripple", void 0);
|
147
|
+
e([
|
148
|
+
a({ type: String })
|
149
|
+
], i.prototype, "value", void 0);
|
150
|
+
e([
|
151
|
+
a({ type: String, reflect: !0 })
|
152
|
+
], i.prototype, "group", void 0);
|
153
|
+
e([
|
154
|
+
a({ type: Number, reflect: !0 })
|
155
|
+
], i.prototype, "tabindex", void 0);
|
156
|
+
e([
|
157
|
+
a({ type: Boolean, reflect: !0 }),
|
158
|
+
d(function(o) {
|
159
|
+
o ? this.setAttribute("aria-disabled", "true") : this.setAttribute("aria-disabled", "false");
|
160
|
+
})
|
161
|
+
], i.prototype, "disabled", void 0);
|
162
|
+
e([
|
163
|
+
a({ type: Boolean, reflect: !0 })
|
164
|
+
], i.prototype, "twoline", void 0);
|
165
|
+
e([
|
166
|
+
a({ type: Boolean, reflect: !0 })
|
167
|
+
], i.prototype, "activated", void 0);
|
168
|
+
e([
|
169
|
+
a({ type: String, reflect: !0 })
|
170
|
+
], i.prototype, "graphic", void 0);
|
171
|
+
e([
|
172
|
+
a({ type: Boolean })
|
173
|
+
], i.prototype, "multipleGraphics", void 0);
|
174
|
+
e([
|
175
|
+
a({ type: Boolean })
|
176
|
+
], i.prototype, "hasMeta", void 0);
|
177
|
+
e([
|
178
|
+
a({ type: Boolean, reflect: !0 }),
|
179
|
+
d(function(o) {
|
180
|
+
o ? (this.removeAttribute("aria-checked"), this.removeAttribute("mwc-list-item"), this.selected = !1, this.activated = !1, this.tabIndex = -1) : this.setAttribute("mwc-list-item", "");
|
181
|
+
})
|
182
|
+
], i.prototype, "noninteractive", void 0);
|
183
|
+
e([
|
184
|
+
a({ type: Boolean, reflect: !0 }),
|
185
|
+
d(function(o) {
|
186
|
+
const t = this.getAttribute("role"), r = t === "gridcell" || t === "option" || t === "row" || t === "tab";
|
187
|
+
if (r && o ? this.setAttribute("aria-selected", "true") : r && this.setAttribute("aria-selected", "false"), this._firstChanged) {
|
188
|
+
this._firstChanged = !1;
|
189
|
+
return;
|
190
|
+
}
|
191
|
+
this._skipPropRequest || this.fireRequestSelected(o, "property");
|
192
|
+
})
|
193
|
+
], i.prototype, "selected", void 0);
|
194
|
+
e([
|
195
|
+
l()
|
196
|
+
], i.prototype, "shouldRenderRipple", void 0);
|
197
|
+
e([
|
198
|
+
l()
|
199
|
+
], i.prototype, "_managingList", void 0);
|
8
200
|
/**
|
9
201
|
* @license
|
10
202
|
* Copyright 2021 Google LLC
|
11
203
|
* SPDX-LIcense-Identifier: Apache-2.0
|
12
204
|
*/
|
13
|
-
const
|
205
|
+
const z = h`: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}`;
|
14
206
|
export {
|
15
|
-
i as
|
16
|
-
|
207
|
+
i as L,
|
208
|
+
z as s
|
17
209
|
};
|
@@ -1,9 +1,32 @@
|
|
1
|
-
"use strict";const
|
1
|
+
"use strict";const i=require("./tslib.es6-5xG0QhxF.js"),n=require("./ripple-handlers-HeGhXgD2.js"),d=require("./observer-LlGBroG9.js"),a=require("./query-assigned-elements-j_5ZiL65.js"),s=require("./property-iZpLBvy-.js"),l=require("./state-LqPxt99W.js"),p=require("./query-duvhtfSs.js"),m=require("./class-map-wtcW44Of.js");/**
|
2
2
|
* @license
|
3
|
-
* Copyright
|
4
|
-
* SPDX-
|
5
|
-
*/
|
3
|
+
* Copyright 2020 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/class e extends a.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 n.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:t=>{const r=t.type;this.onDown(r==="mousedown"?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),r=this.graphic?this.renderGraphic():a.x``,c=this.hasMeta?this.renderMeta():a.x``;return a.x`
|
6
|
+
${this.renderRipple()}
|
7
|
+
${r}
|
8
|
+
${t}
|
9
|
+
${c}`}renderRipple(){return this.shouldRenderRipple?a.x`
|
10
|
+
<mwc-ripple
|
11
|
+
.activated=${this.activated}>
|
12
|
+
</mwc-ripple>`:this.activated?a.x`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return a.x`
|
13
|
+
<span class="mdc-deprecated-list-item__graphic material-icons ${m.o(t)}">
|
14
|
+
<slot name="graphic"></slot>
|
15
|
+
</span>`}renderMeta(){return a.x`
|
16
|
+
<span class="mdc-deprecated-list-item__meta material-icons">
|
17
|
+
<slot name="meta"></slot>
|
18
|
+
</span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return a.x`
|
19
|
+
<span class="mdc-deprecated-list-item__text">
|
20
|
+
${t}
|
21
|
+
</span>`}renderSingleLine(){return a.x`<slot></slot>`}renderTwoline(){return a.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(t,r){const c=()=>{window.removeEventListener(t,c),this.rippleHandlers.endPress()};window.addEventListener(t,c),this.rippleHandlers.startPress(r)}fireRequestSelected(t,r){if(this.noninteractive)return;const c=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:r,selected:t}});this.dispatchEvent(c)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const r of t.eventNames)t.target.addEventListener(r,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const r of t.eventNames)t.target.removeEventListener(r,t.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}i.__decorate([p.i("slot")],e.prototype,"slotElement",void 0);i.__decorate([n.e("mwc-ripple")],e.prototype,"ripple",void 0);i.__decorate([s.n({type:String})],e.prototype,"value",void 0);i.__decorate([s.n({type:String,reflect:!0})],e.prototype,"group",void 0);i.__decorate([s.n({type:Number,reflect:!0})],e.prototype,"tabindex",void 0);i.__decorate([s.n({type:Boolean,reflect:!0}),d.observer(function(o){o?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")})],e.prototype,"disabled",void 0);i.__decorate([s.n({type:Boolean,reflect:!0})],e.prototype,"twoline",void 0);i.__decorate([s.n({type:Boolean,reflect:!0})],e.prototype,"activated",void 0);i.__decorate([s.n({type:String,reflect:!0})],e.prototype,"graphic",void 0);i.__decorate([s.n({type:Boolean})],e.prototype,"multipleGraphics",void 0);i.__decorate([s.n({type:Boolean})],e.prototype,"hasMeta",void 0);i.__decorate([s.n({type:Boolean,reflect:!0}),d.observer(function(o){o?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")})],e.prototype,"noninteractive",void 0);i.__decorate([s.n({type:Boolean,reflect:!0}),d.observer(function(o){const t=this.getAttribute("role"),r=t==="gridcell"||t==="option"||t==="row"||t==="tab";if(r&&o?this.setAttribute("aria-selected","true"):r&&this.setAttribute("aria-selected","false"),this._firstChanged){this._firstChanged=!1;return}this._skipPropRequest||this.fireRequestSelected(o,"property")})],e.prototype,"selected",void 0);i.__decorate([l.t()],e.prototype,"shouldRenderRipple",void 0);i.__decorate([l.t()],e.prototype,"_managingList",void 0);/**
|
6
29
|
* @license
|
7
30
|
* Copyright 2021 Google LLC
|
8
31
|
* SPDX-LIcense-Identifier: Apache-2.0
|
9
|
-
*/const
|
32
|
+
*/const h=a.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}`;exports.ListItemBase=e;exports.styles=h;
|
@@ -0,0 +1,111 @@
|
|
1
|
+
"use strict";const h=require("./tslib.es6-5xG0QhxF.js"),F=require("./query-assigned-elements-j_5ZiL65.js"),B=require("./mwc-list-item.css-yJ5bjNGc.js"),K=require("./base-element-atp_8bvP.js"),C=require("./observer-LlGBroG9.js"),D=require("./utils-W3ENJhq-.js"),A=require("./property-iZpLBvy-.js"),V=require("./query-duvhtfSs.js"),k=require("./query-assigned-nodes-1p7z6CEm.js"),W=require("./if-defined-lAIUwAsA.js");/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2020 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/let w=class extends B.ListItemBase{};w.styles=[B.styles];w=h.__decorate([F.e("mwc-list-item")],w);/**
|
6
|
+
* @license
|
7
|
+
* Copyright 2016 Google Inc.
|
8
|
+
*
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
14
|
+
* furnished to do so, subject to the following conditions:
|
15
|
+
*
|
16
|
+
* The above copyright notice and this permission notice shall be included in
|
17
|
+
* all copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
* THE SOFTWARE.
|
26
|
+
*/var X=function(){function n(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(n,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),n.prototype.init=function(){},n.prototype.destroy=function(){},n}();/**
|
27
|
+
* @license
|
28
|
+
* Copyright 2020 Google Inc.
|
29
|
+
*
|
30
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
31
|
+
* of this software and associated documentation files (the "Software"), to deal
|
32
|
+
* in the Software without restriction, including without limitation the rights
|
33
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
34
|
+
* copies of the Software, and to permit persons to whom the Software is
|
35
|
+
* furnished to do so, subject to the following conditions:
|
36
|
+
*
|
37
|
+
* The above copyright notice and this permission notice shall be included in
|
38
|
+
* all copies or substantial portions of the Software.
|
39
|
+
*
|
40
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
41
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
42
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
43
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
44
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
46
|
+
* THE SOFTWARE.
|
47
|
+
*/var d={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"},l=new Set;l.add(d.BACKSPACE);l.add(d.ENTER);l.add(d.SPACEBAR);l.add(d.PAGE_UP);l.add(d.PAGE_DOWN);l.add(d.END);l.add(d.HOME);l.add(d.ARROW_LEFT);l.add(d.ARROW_UP);l.add(d.ARROW_RIGHT);l.add(d.ARROW_DOWN);l.add(d.DELETE);l.add(d.ESCAPE);l.add(d.TAB);var m={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},c=new Map;c.set(m.BACKSPACE,d.BACKSPACE);c.set(m.ENTER,d.ENTER);c.set(m.SPACEBAR,d.SPACEBAR);c.set(m.PAGE_UP,d.PAGE_UP);c.set(m.PAGE_DOWN,d.PAGE_DOWN);c.set(m.END,d.END);c.set(m.HOME,d.HOME);c.set(m.ARROW_LEFT,d.ARROW_LEFT);c.set(m.ARROW_UP,d.ARROW_UP);c.set(m.ARROW_RIGHT,d.ARROW_RIGHT);c.set(m.ARROW_DOWN,d.ARROW_DOWN);c.set(m.DELETE,d.DELETE);c.set(m.ESCAPE,d.ESCAPE);c.set(m.TAB,d.TAB);var T=new Set;T.add(d.PAGE_UP);T.add(d.PAGE_DOWN);T.add(d.END);T.add(d.HOME);T.add(d.ARROW_LEFT);T.add(d.ARROW_UP);T.add(d.ARROW_RIGHT);T.add(d.ARROW_DOWN);function S(n){var e=n.key;if(l.has(e))return e;var t=c.get(n.keyCode);return t||d.UNKNOWN}/**
|
48
|
+
* @license
|
49
|
+
* Copyright 2018 Google Inc.
|
50
|
+
*
|
51
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
52
|
+
* of this software and associated documentation files (the "Software"), to deal
|
53
|
+
* in the Software without restriction, including without limitation the rights
|
54
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
55
|
+
* copies of the Software, and to permit persons to whom the Software is
|
56
|
+
* furnished to do so, subject to the following conditions:
|
57
|
+
*
|
58
|
+
* The above copyright notice and this permission notice shall be included in
|
59
|
+
* all copies or substantial portions of the Software.
|
60
|
+
*
|
61
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
62
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
63
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
64
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
65
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
66
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
67
|
+
* THE SOFTWARE.
|
68
|
+
*/var b,I,r={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"};b={},b[""+r.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",b[""+r.LIST_ITEM_CLASS]="mdc-list-item",b[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",b[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",b[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",b[""+r.ROOT]="mdc-list";var L=(I={},I[""+r.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",I[""+r.LIST_ITEM_CLASS]="mdc-deprecated-list-item",I[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",I[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",I[""+r.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",I[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",I[""+r.ROOT]="mdc-deprecated-list",I),v={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:`
|
69
|
+
.`+r.LIST_ITEM_CLASS+` button:not(:disabled),
|
70
|
+
.`+r.LIST_ITEM_CLASS+` a,
|
71
|
+
.`+L[r.LIST_ITEM_CLASS]+` button:not(:disabled),
|
72
|
+
.`+L[r.LIST_ITEM_CLASS]+` a
|
73
|
+
`,DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:`
|
74
|
+
.`+r.LIST_ITEM_CLASS+` button:not(:disabled),
|
75
|
+
.`+r.LIST_ITEM_CLASS+` a,
|
76
|
+
.`+r.LIST_ITEM_CLASS+` input[type="radio"]:not(:disabled),
|
77
|
+
.`+r.LIST_ITEM_CLASS+` input[type="checkbox"]:not(:disabled),
|
78
|
+
.`+L[r.LIST_ITEM_CLASS]+` button:not(:disabled),
|
79
|
+
.`+L[r.LIST_ITEM_CLASS]+` a,
|
80
|
+
.`+L[r.LIST_ITEM_CLASS]+` input[type="radio"]:not(:disabled),
|
81
|
+
.`+L[r.LIST_ITEM_CLASS]+` input[type="checkbox"]:not(:disabled)
|
82
|
+
`,RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},u={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};/**
|
83
|
+
* @license
|
84
|
+
* Copyright 2020 Google LLC
|
85
|
+
* SPDX-License-Identifier: Apache-2.0
|
86
|
+
*/const M=(n,e)=>n-e,G=(n,e)=>{const t=Array.from(n),i=Array.from(e),s={added:[],removed:[]},o=t.sort(M),a=i.sort(M);let E=0,g=0;for(;E<o.length||g<a.length;){const _=o[E],p=a[g];if(_===p){E++,g++;continue}if(_!==void 0&&(p===void 0||_<p)){s.removed.push(_),E++;continue}if(p!==void 0&&(_===void 0||p<_)){s.added.push(p),g++;continue}}return s},q=["input","button","textarea","select"];function y(n){return n instanceof Set}const N=n=>{const e=n===u.UNSET_INDEX?new Set:n;return y(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_=u.UNSET_INDEX,this.focusedItemIndex_=u.UNSET_INDEX,this.useActivatedClass_=!1,this.ariaCurrentAttrValue_=null}static get strings(){return v}static get numbers(){return u}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(!y(t)){const i=t===u.UNSET_INDEX;this.selectedIndex_=i?new Set:new Set([t])}}else if(y(t))if(t.size){const i=Array.from(t).sort(M);this.selectedIndex_=i[0]}else this.selectedIndex_=u.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_(N(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=S(e)==="ArrowLeft",o=S(e)==="ArrowUp",a=S(e)==="ArrowRight",E=S(e)==="ArrowDown",g=S(e)==="Home",_=S(e)==="End",p=S(e)==="Enter",H=S(e)==="Spacebar";if(this.adapter.isRootFocused()){o||_?(e.preventDefault(),this.focusLastElement()):(E||g)&&(e.preventDefault(),this.focusFirstElement());return}let x=this.adapter.getFocusedElementIndex();if(x===-1&&(x=i,x<0))return;let R;if(this.isVertical_&&E||!this.isVertical_&&a)this.preventDefaultEvent(e),R=this.focusNextElement(x);else if(this.isVertical_&&o||!this.isVertical_&&s)this.preventDefaultEvent(e),R=this.focusPrevElement(x);else if(g)this.preventDefaultEvent(e),R=this.focusFirstElement();else if(_)this.preventDefaultEvent(e),R=this.focusLastElement();else if((p||H)&&t){const U=e.target;if(U&&U.tagName==="A"&&p)return;this.preventDefaultEvent(e),this.setSelectedIndexOnAction_(x,!0)}this.focusedItemIndex_=x,R!==void 0&&(this.setTabindexAtIndex_(R),this.focusedItemIndex_=R)}handleSingleSelection(e,t,i){e!==u.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_!==u.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=N(this.selectedIndex_),s=G(i,e);if(!(!s.removed.length&&!s.added.length)){for(const o of s.removed)t&&this.adapter.setSelectedStateForElementIndex(o,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(o,!1);for(const o of s.added)t&&this.adapter.setSelectedStateForElementIndex(o,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(o,!0);this.selectedIndex_=e,this.adapter.notifySelected(e,s)}}setAriaForSingleSelectionAtIndex_(e){this.selectedIndex_===u.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(e,v.ARIA_CURRENT));const t=this.ariaCurrentAttrValue_!==null,i=t?v.ARIA_CURRENT:v.ARIA_SELECTED;this.selectedIndex_!==u.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_===u.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_!==u.UNSET_INDEX?e=this.selectedIndex_:y(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===u.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_(u.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 o=N(this.selectedIndex_);s?o.add(e):o.delete(e),this.setMultiSelectionAtIndex_(o,i)}}/**
|
87
|
+
* @license
|
88
|
+
* Copyright 2020 Google LLC
|
89
|
+
* SPDX-License-Identifier: Apache-2.0
|
90
|
+
*/function z(n,e=50){let t;return function(i=!0){clearTimeout(t),t=setTimeout(()=>{n(i)},e)}}const O=n=>n.hasAttribute("mwc-list-item");function $(){const n=this.itemsReadyResolver;this.itemsReady=new Promise(e=>this.itemsReadyResolver=e),n()}class f extends K.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=z(this.layout.bind(this));this.debouncedLayout=(t=!0)=>{$.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 a of t)O(a)&&(i.push(a),a._managingList=this),a.hasAttribute("divider")&&!a.hasAttribute("role")&&a.setAttribute("role","separator");this.items_=i;const s=new Set;if(this.items_.forEach((a,E)=>{this.itemRoles?a.setAttribute("role",this.itemRoles):a.removeAttribute("role"),a.selected&&s.add(E)}),this.multi)this.select(s);else{const a=s.size?s.entries().next().value[1]:-1;this.select(a)}const o=new Event("items-updated",{bubbles:!0,composed:!0});this.dispatchEvent(o)}get selected(){const e=this.index;if(!y(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 F.x`
|
91
|
+
<!-- @ts-ignore -->
|
92
|
+
<ul
|
93
|
+
tabindex=${i}
|
94
|
+
role="${W.l(e)}"
|
95
|
+
aria-label="${W.l(t)}"
|
96
|
+
class="mdc-deprecated-list"
|
97
|
+
@keydown=${this.onKeydown}
|
98
|
+
@focusin=${this.onFocusIn}
|
99
|
+
@focusout=${this.onFocusOut}
|
100
|
+
@request-selected=${this.onRequestSelected}
|
101
|
+
@list-item-rendered=${this.onListItemConnected}>
|
102
|
+
<slot></slot>
|
103
|
+
${this.renderPlaceholder()}
|
104
|
+
</ul>
|
105
|
+
`}renderPlaceholder(){var e;const t=(e=this.assignedElements)!==null&&e!==void 0?e:[];return this.emptyMessage!==void 0&&t.length===0?F.x`
|
106
|
+
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
|
107
|
+
`: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=O(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,o=e.detail.source;this.mdcFoundation.handleSingleSelection(t,o==="interaction",s),e.stopPropagation()}}getIndexOfTarget(e){const t=this.items,i=e.composedPath();for(const s of i){let o=-1;if(D.isNodeElement(s)&&O(s)&&(o=t.indexOf(s)),o!==-1)return o}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:()=>D.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=D.deepActiveElementPath();if(!e.length)return-1;for(let t=e.length-1;t>=0;t--){const i=e[t];if(O(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()}}h.__decorate([A.n({type:String})],f.prototype,"emptyMessage",void 0);h.__decorate([V.i(".mdc-deprecated-list")],f.prototype,"mdcRoot",void 0);h.__decorate([k.o("",!0,"*")],f.prototype,"assignedElements",void 0);h.__decorate([k.o("",!0,'[tabindex="0"]')],f.prototype,"tabbableElements",void 0);h.__decorate([A.n({type:Boolean}),C.observer(function(n){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(n)})],f.prototype,"activatable",void 0);h.__decorate([A.n({type:Boolean}),C.observer(function(n,e){this.mdcFoundation&&this.mdcFoundation.setMulti(n),e!==void 0&&this.layout()})],f.prototype,"multi",void 0);h.__decorate([A.n({type:Boolean}),C.observer(function(n){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(n)})],f.prototype,"wrapFocus",void 0);h.__decorate([A.n({type:String}),C.observer(function(n,e){e!==void 0&&this.updateItems()})],f.prototype,"itemRoles",void 0);h.__decorate([A.n({type:String})],f.prototype,"innerRole",void 0);h.__decorate([A.n({type:String})],f.prototype,"innerAriaLabel",void 0);h.__decorate([A.n({type:Boolean})],f.prototype,"rootTabbable",void 0);h.__decorate([A.n({type:Boolean,reflect:!0}),C.observer(function(n){var e,t;if(n){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!n&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)})],f.prototype,"noninteractive",void 0);/**
|
108
|
+
* @license
|
109
|
+
* Copyright 2021 Google LLC
|
110
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
111
|
+
*/const j=F.i`@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{display:block}.mdc-deprecated-list{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);line-height:1.5rem;margin:0;padding:8px 0;list-style-type:none;color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));padding:var(--mdc-list-vertical-padding, 8px) 0}.mdc-deprecated-list:focus{outline:none}.mdc-deprecated-list-item{height:48px}.mdc-deprecated-list--dense{padding-top:4px;padding-bottom:4px;font-size:.812rem}.mdc-deprecated-list ::slotted([divider]){height:0;margin:0;border:none;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(0, 0, 0, 0.12)}.mdc-deprecated-list ::slotted([divider][padded]){margin:0 var(--mdc-list-side-padding, 16px)}.mdc-deprecated-list ::slotted([divider][inset]){margin-left:var(--mdc-list-inset-margin, 72px);margin-right:0;width:calc( 100% - var(--mdc-list-inset-margin, 72px) )}[dir=rtl] .mdc-deprecated-list ::slotted([divider][inset]),.mdc-deprecated-list ::slotted([divider][inset][dir=rtl]){margin-left:0;margin-right:var(--mdc-list-inset-margin, 72px)}.mdc-deprecated-list ::slotted([divider][inset][padded]){width:calc( 100% - var(--mdc-list-inset-margin, 72px) - var(--mdc-list-side-padding, 16px) )}.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:40px}.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 20px}.mdc-deprecated-list--two-line.mdc-deprecated-list--dense ::slotted([mwc-list-item]),.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:60px}.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 36px}:host([noninteractive]){pointer-events:none;cursor:default}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text){display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}`;exports.ListBase=f;exports.styles=j;
|