@hortiview/shared-components 0.0.4723 → 0.0.4724
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/dist/_getTag-DyrzUAbj.js +494 -0
- package/dist/components/BaseView/BaseView.js +43 -297
- package/dist/components/BasicHeading/BasicHeading.js +24 -25
- package/dist/components/BasicHeading/BasicHeading.test.js +4 -4
- package/dist/components/BlockView/BlockView.js +14 -14
- package/dist/components/DeleteModal/DeleteModal.js +49 -4687
- package/dist/components/Disclaimer/Disclaimer.js +8 -10
- package/dist/components/EmptyView/EmptyView.js +8 -247
- package/dist/components/HashTabView/HashTabView.js +52 -1838
- package/dist/components/HeaderFilter/HeaderFilter.js +18 -7595
- package/dist/components/Iconify/Iconify.js +1 -1
- package/dist/components/ListArea/ListArea.js +316 -261
- package/dist/components/ListArea/ListArea.test.js +1 -1
- package/dist/components/ListArea/ListAreaService.js +34 -35
- package/dist/components/SearchBar/SearchBar.js +21 -2043
- package/package.json +1 -1
- package/dist/BlockView.module-ypKp14Lt.cjs +0 -1
- package/dist/HashTabView.module-B20c3S70.cjs +0 -1
- package/dist/HeaderFilter.module-DSCJz6-s.cjs +0 -1
- package/dist/_commonjsHelpers-DwTZ_eVU.cjs +0 -1
- package/dist/_getTag-DNUtgXkb.js +0 -136
- package/dist/_getTag-DSIzMwlx.cjs +0 -1
- package/dist/_stringToPath-B-GSTJ2e.cjs +0 -1
- package/dist/_stringToPath-BfzwTbL6.js +0 -54
- package/dist/baseView.module--VUY4h_X.cjs +0 -1
- package/dist/basicHeading.module-BbcVMp42.cjs +0 -1
- package/dist/component-DJvMx3oL.cjs +0 -148
- package/dist/component-Rx4bNsGO.js +0 -680
- package/dist/disclaimer.module-BfrBh-Rf.cjs +0 -1
- package/dist/index.es-80RhGkCD.cjs +0 -1
- package/dist/index.es-Ba9oZK_n.js +0 -769
- package/dist/index.es-C1ojb4Lq.js +0 -106
- package/dist/index.es-CEydmFbW.cjs +0 -23
- package/dist/index.es-CKdjg72r.cjs +0 -64
- package/dist/index.es-CNBieliG.js +0 -151
- package/dist/index.es-CPRODq-I.cjs +0 -127
- package/dist/index.es-CQ3ep412.js +0 -305
- package/dist/index.es-CSD_u-fK.cjs +0 -1
- package/dist/index.es-CVCp4d0C.js +0 -45
- package/dist/index.es-Cct4Uapb.js +0 -1776
- package/dist/index.es-Cj9DW-2T.js +0 -430
- package/dist/index.es-Cm4X20_S.js +0 -673
- package/dist/index.es-Cqx46S1V.cjs +0 -540
- package/dist/index.es-DiO-sp-V.cjs +0 -1
- package/dist/index.es-DyXn5zZ8.cjs +0 -1
- package/dist/index.es-InSNsV4f.js +0 -1067
- package/dist/index.es-J3ub0jmR.cjs +0 -1
- package/dist/index.es-L0ZCcbUf.js +0 -4939
- package/dist/index.es-gvcK6-6t.cjs +0 -1
- package/dist/listArea.module-CMO-yRdf.cjs +0 -1
- package/dist/magic-string.es-EQkD18No.cjs +0 -10
- package/dist/react.esm-CMNZXU0t.cjs +0 -93
- package/dist/searchBar.module-CFi8D8zn.cjs +0 -1
- package/dist/tslib.es6-CIXEwqhg.js +0 -72
- package/dist/tslib.es6-D1TYK0An.cjs +0 -1
- package/dist/useBreakpoint-PUopk3AO.cjs +0 -1
- package/dist/verticalDivider.module-Ciw9Fnt1.cjs +0 -1
- package/dist/vi.JYQecGiw-M1q0RI3O.cjs +0 -512
|
@@ -1,4939 +0,0 @@
|
|
|
1
|
-
import { P as s, a as _n, c as F, e as Ct, _ as U, m as qe, G as Bt, j as sn, H as yn, I as gn, J as Tn, E as Cn, x as An, K as vn, L as bn, i as Sn, d as an, n as On, M as Ft, N as bt, O as xn } from "./index.es-Cct4Uapb.js";
|
|
2
|
-
import c, { forwardRef as $, useRef as oe, useImperativeHandle as ve, useMemo as ie, useState as Ae, useEffect as P, useCallback as Y, createContext as ln, useContext as lt, Fragment as St } from "react";
|
|
3
|
-
import { P as Ln } from "./index.es-Ba9oZK_n.js";
|
|
4
|
-
import { _ as Ee, a as J, d as Nn, b as Rn, c as Dn } from "./tslib.es6-CIXEwqhg.js";
|
|
5
|
-
import { a as He, b as Ke, M as je, d as $e, m as ke, f as Rt, c as Ot } from "./component-Rx4bNsGO.js";
|
|
6
|
-
import { g as Mn } from "./_commonjsHelpers-CT_km90n.js";
|
|
7
|
-
import { _ as Pn, a as kn, b as wn } from "./_getTag-DNUtgXkb.js";
|
|
8
|
-
import { R as Bn } from "./index.es-CVCp4d0C.js";
|
|
9
|
-
import { I as at } from "./index.es-InSNsV4f.js";
|
|
10
|
-
import { a as xt, e as Fn } from "./index.es-Cm4X20_S.js";
|
|
11
|
-
const Hn = {
|
|
12
|
-
/**
|
|
13
|
-
* Label to be displayed in the Badge. Usually a string, but can also be an x-small icon.
|
|
14
|
-
*
|
|
15
|
-
* Defaults to **null**.
|
|
16
|
-
*/
|
|
17
|
-
label: s.oneOfType([s.string, s.func, s.node]),
|
|
18
|
-
/**
|
|
19
|
-
* Label type to be displayed in the Badge.
|
|
20
|
-
*
|
|
21
|
-
* Defaults to **'string'**.
|
|
22
|
-
*/
|
|
23
|
-
labelType: s.oneOf(["string", "icon"]),
|
|
24
|
-
/**
|
|
25
|
-
* Adds the given Icon to the left of the label text. May not be used with `trailingIcon` or if `labelType` is icon - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. If `labelType` is set to `icon` label will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control. If a custom icon is used, the icon should not be larger than 9 x 9.
|
|
26
|
-
*
|
|
27
|
-
* Defaults to **undefined**.
|
|
28
|
-
*/
|
|
29
|
-
leadingIcon: s.oneOfType([s.string, s.func, s.node]),
|
|
30
|
-
/**
|
|
31
|
-
* Color of the badge. It will default according to your theme. For most themes that is primary.
|
|
32
|
-
*
|
|
33
|
-
* Defaults to **'themeDefault'**.
|
|
34
|
-
*/
|
|
35
|
-
themeColor: _n(s.oneOf(["themeDefault", "primary", "secondary", "danger", "success", "blue", "gray", "green", "orange", "purple", "red", "teal", "yellow", "primary-variant", "no-bg-on-dark"]), ["primaryVariant"], "LabelBadge", "Please use one of 'themeDefault','primary','secondary','danger','success','blue','gray','green','orange','purple','red','teal','yellow','primary-variant','no-bg-on-dark'."),
|
|
36
|
-
/**
|
|
37
|
-
* Adds the given Icon to the right of the label text. May not be used with `leadingIcon` or if `labelType` is icon - if `leadingIcon` and `trailingIcon` are both set, `leadingIcon` will take priority. If `labelType` is set to `icon` label will take priority. Expects the name of a valid Material.io icon, however an icon component may be passed in instead for more control.
|
|
38
|
-
*
|
|
39
|
-
* Defaults to **undefined**.
|
|
40
|
-
*/
|
|
41
|
-
trailingIcon: s.oneOfType([s.string, s.func, s.node])
|
|
42
|
-
}, Kn = {
|
|
43
|
-
label: null,
|
|
44
|
-
labelType: "string",
|
|
45
|
-
leadingIcon: void 0,
|
|
46
|
-
themeColor: "themeDefault",
|
|
47
|
-
trailingIcon: void 0
|
|
48
|
-
}, Un = {
|
|
49
|
-
/**
|
|
50
|
-
* Number to be displayed in badge. Omit for a status light badge.
|
|
51
|
-
*
|
|
52
|
-
* Defaults to **null**.
|
|
53
|
-
*/
|
|
54
|
-
counter: s.number,
|
|
55
|
-
/**
|
|
56
|
-
* Max number the badge can display.
|
|
57
|
-
*
|
|
58
|
-
* Defaults to **99**.
|
|
59
|
-
*/
|
|
60
|
-
max: s.number,
|
|
61
|
-
/**
|
|
62
|
-
* Theme color of the badge.
|
|
63
|
-
*
|
|
64
|
-
* Defaults to **'danger'**.
|
|
65
|
-
*/
|
|
66
|
-
themeColor: s.oneOf(["primary", "secondary", "danger", "success"])
|
|
67
|
-
}, Gn = {
|
|
68
|
-
counter: null,
|
|
69
|
-
max: 99,
|
|
70
|
-
themeColor: "danger"
|
|
71
|
-
}, Ht = (i, n) => !i && i !== 0 ? null : i <= n ? i : `${n}+`, Dt = /* @__PURE__ */ $((i, n) => {
|
|
72
|
-
const {
|
|
73
|
-
className: e,
|
|
74
|
-
counter: t,
|
|
75
|
-
max: r,
|
|
76
|
-
themeColor: o,
|
|
77
|
-
...a
|
|
78
|
-
} = i, l = oe(), [u, y] = Ae(Ht(t, r));
|
|
79
|
-
P(() => y(Ht(t, r)), [t, r]), ve(n, () => l.current, []);
|
|
80
|
-
const C = F("lmnt", "lmnt-badge", "lmnt-badge--notification", `lmnt-badge--notification-${o}`, "mdc-typography--caption-bold", (u || u === 0) && "lmnt-badge--notification-badge-counter", e);
|
|
81
|
-
return /* @__PURE__ */ c.createElement("div", U({
|
|
82
|
-
ref: l,
|
|
83
|
-
className: C
|
|
84
|
-
}, a), u && u);
|
|
85
|
-
});
|
|
86
|
-
Dt.displayName = "NotificationBadge";
|
|
87
|
-
Dt.propTypes = Un;
|
|
88
|
-
Dt.defaultProps = Gn;
|
|
89
|
-
const ct = /* @__PURE__ */ $((i, n) => {
|
|
90
|
-
const {
|
|
91
|
-
className: e,
|
|
92
|
-
label: t,
|
|
93
|
-
labelType: r,
|
|
94
|
-
leadingIcon: o,
|
|
95
|
-
trailingIcon: a,
|
|
96
|
-
themeColor: l,
|
|
97
|
-
...u
|
|
98
|
-
} = i, y = oe();
|
|
99
|
-
ve(n, () => y.current, []);
|
|
100
|
-
const C = F("lmnt", "lmnt-badge", "lmnt-badge--label", `lmnt-badge--label-${l}`, "mdc-typography--caption-bold", r === "icon" && "lmnt-badge--label-icon-as-label", o && "lmnt-badge--label-leading-icon", a && "lmnt-badge--label-trailing-icon", e), m = ie(() => {
|
|
101
|
-
var f;
|
|
102
|
-
return r === "icon" || !o ? null : typeof o == "string" ? /* @__PURE__ */ c.createElement(at, {
|
|
103
|
-
className: "lmnt-badge-label__leading-icon",
|
|
104
|
-
icon: o,
|
|
105
|
-
iconSize: "xsmall"
|
|
106
|
-
}) : typeof o == "function" ? o({
|
|
107
|
-
className: "lmnt-icon--xsmall lmnt-badge-label__leading-icon"
|
|
108
|
-
}) : Ct(o, {
|
|
109
|
-
className: F("lmnt-badge-label__leading-icon", o == null || (f = o.props) === null || f === void 0 ? void 0 : f.className)
|
|
110
|
-
});
|
|
111
|
-
}, [r, o]), E = ie(() => {
|
|
112
|
-
var f;
|
|
113
|
-
return r === "string" ? t : typeof t == "string" ? /* @__PURE__ */ c.createElement(at, {
|
|
114
|
-
className: "lmnt-badge-label-icon",
|
|
115
|
-
icon: t,
|
|
116
|
-
iconSize: "xsmall"
|
|
117
|
-
}) : typeof t == "function" ? t({
|
|
118
|
-
className: "lmnt-icon--xsmall lmnt-badge-label-icon"
|
|
119
|
-
}) : Ct(t, {
|
|
120
|
-
className: F("lmnt-badge-label-icon", "lmnt-icon--xsmall", t == null || (f = t.props) === null || f === void 0 ? void 0 : f.className)
|
|
121
|
-
});
|
|
122
|
-
}, [r, t]), d = ie(() => {
|
|
123
|
-
var f;
|
|
124
|
-
return !a || r === "icon" || m ? null : typeof a == "string" ? /* @__PURE__ */ c.createElement(at, {
|
|
125
|
-
className: "lmnt-badge-label__trailing-icon",
|
|
126
|
-
icon: a,
|
|
127
|
-
iconSize: "xsmall"
|
|
128
|
-
}) : typeof a == "function" ? a({
|
|
129
|
-
className: "lmnt-icon--xsmall lmnt-badge-label__trailing-icon"
|
|
130
|
-
}) : Ct(a, {
|
|
131
|
-
className: F("lmnt-badge-label__trailing-icon", a == null || (f = a.props) === null || f === void 0 ? void 0 : f.className)
|
|
132
|
-
});
|
|
133
|
-
}, [r, a, m]);
|
|
134
|
-
return /* @__PURE__ */ c.createElement("div", U({
|
|
135
|
-
ref: y,
|
|
136
|
-
className: C
|
|
137
|
-
}, u), m && m, /* @__PURE__ */ c.createElement("span", {
|
|
138
|
-
className: "lmnt-badge--label__label"
|
|
139
|
-
}, E), d && d);
|
|
140
|
-
});
|
|
141
|
-
ct.displayName = "LabelBadge";
|
|
142
|
-
ct.propTypes = Hn;
|
|
143
|
-
ct.defaultProps = Kn;
|
|
144
|
-
/**
|
|
145
|
-
* @license
|
|
146
|
-
* Copyright 2017 Google Inc.
|
|
147
|
-
*
|
|
148
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
149
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
150
|
-
* in the Software without restriction, including without limitation the rights
|
|
151
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
152
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
153
|
-
* furnished to do so, subject to the following conditions:
|
|
154
|
-
*
|
|
155
|
-
* The above copyright notice and this permission notice shall be included in
|
|
156
|
-
* all copies or substantial portions of the Software.
|
|
157
|
-
*
|
|
158
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
159
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
160
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
161
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
162
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
163
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
164
|
-
* THE SOFTWARE.
|
|
165
|
-
*/
|
|
166
|
-
var Wn = {
|
|
167
|
-
ROOT: "mdc-form-field"
|
|
168
|
-
}, jn = {
|
|
169
|
-
LABEL_SELECTOR: ".mdc-form-field > label"
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* @license
|
|
173
|
-
* Copyright 2017 Google Inc.
|
|
174
|
-
*
|
|
175
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
176
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
177
|
-
* in the Software without restriction, including without limitation the rights
|
|
178
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
179
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
180
|
-
* furnished to do so, subject to the following conditions:
|
|
181
|
-
*
|
|
182
|
-
* The above copyright notice and this permission notice shall be included in
|
|
183
|
-
* all copies or substantial portions of the Software.
|
|
184
|
-
*
|
|
185
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
186
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
187
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
188
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
189
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
190
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
191
|
-
* THE SOFTWARE.
|
|
192
|
-
*/
|
|
193
|
-
var Kt = (
|
|
194
|
-
/** @class */
|
|
195
|
-
function(i) {
|
|
196
|
-
Ee(n, i);
|
|
197
|
-
function n(e) {
|
|
198
|
-
var t = i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
199
|
-
return t.click = function() {
|
|
200
|
-
t.handleClick();
|
|
201
|
-
}, t;
|
|
202
|
-
}
|
|
203
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
204
|
-
get: function() {
|
|
205
|
-
return Wn;
|
|
206
|
-
},
|
|
207
|
-
enumerable: !1,
|
|
208
|
-
configurable: !0
|
|
209
|
-
}), Object.defineProperty(n, "strings", {
|
|
210
|
-
get: function() {
|
|
211
|
-
return jn;
|
|
212
|
-
},
|
|
213
|
-
enumerable: !1,
|
|
214
|
-
configurable: !0
|
|
215
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
216
|
-
get: function() {
|
|
217
|
-
return {
|
|
218
|
-
activateInputRipple: function() {
|
|
219
|
-
},
|
|
220
|
-
deactivateInputRipple: function() {
|
|
221
|
-
},
|
|
222
|
-
deregisterInteractionHandler: function() {
|
|
223
|
-
},
|
|
224
|
-
registerInteractionHandler: function() {
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
},
|
|
228
|
-
enumerable: !1,
|
|
229
|
-
configurable: !0
|
|
230
|
-
}), n.prototype.init = function() {
|
|
231
|
-
this.adapter.registerInteractionHandler("click", this.click);
|
|
232
|
-
}, n.prototype.destroy = function() {
|
|
233
|
-
this.adapter.deregisterInteractionHandler("click", this.click);
|
|
234
|
-
}, n.prototype.handleClick = function() {
|
|
235
|
-
var e = this;
|
|
236
|
-
this.adapter.activateInputRipple(), requestAnimationFrame(function() {
|
|
237
|
-
e.adapter.deactivateInputRipple();
|
|
238
|
-
});
|
|
239
|
-
}, n;
|
|
240
|
-
}(He)
|
|
241
|
-
);
|
|
242
|
-
/**
|
|
243
|
-
* @license
|
|
244
|
-
* Copyright 2017 Google Inc.
|
|
245
|
-
*
|
|
246
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
247
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
248
|
-
* in the Software without restriction, including without limitation the rights
|
|
249
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
250
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
251
|
-
* furnished to do so, subject to the following conditions:
|
|
252
|
-
*
|
|
253
|
-
* The above copyright notice and this permission notice shall be included in
|
|
254
|
-
* all copies or substantial portions of the Software.
|
|
255
|
-
*
|
|
256
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
257
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
258
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
259
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
260
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
261
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
262
|
-
* THE SOFTWARE.
|
|
263
|
-
*/
|
|
264
|
-
var $n = (
|
|
265
|
-
/** @class */
|
|
266
|
-
function(i) {
|
|
267
|
-
Ee(n, i);
|
|
268
|
-
function n() {
|
|
269
|
-
return i !== null && i.apply(this, arguments) || this;
|
|
270
|
-
}
|
|
271
|
-
return n.attachTo = function(e) {
|
|
272
|
-
return new n(e);
|
|
273
|
-
}, n.prototype.labelEl = function() {
|
|
274
|
-
var e = Kt.strings.LABEL_SELECTOR;
|
|
275
|
-
return this.root.querySelector(e);
|
|
276
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
277
|
-
var e = this, t = {
|
|
278
|
-
activateInputRipple: function() {
|
|
279
|
-
e.input && e.input.ripple && e.input.ripple.activate();
|
|
280
|
-
},
|
|
281
|
-
deactivateInputRipple: function() {
|
|
282
|
-
e.input && e.input.ripple && e.input.ripple.deactivate();
|
|
283
|
-
},
|
|
284
|
-
deregisterInteractionHandler: function(r, o) {
|
|
285
|
-
var a = e.labelEl();
|
|
286
|
-
a && a.removeEventListener(r, o);
|
|
287
|
-
},
|
|
288
|
-
registerInteractionHandler: function(r, o) {
|
|
289
|
-
var a = e.labelEl();
|
|
290
|
-
a && a.addEventListener(r, o);
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
return new Kt(t);
|
|
294
|
-
}, n;
|
|
295
|
-
}(Ke)
|
|
296
|
-
);
|
|
297
|
-
const Vn = {
|
|
298
|
-
/**
|
|
299
|
-
* Reverse the order of the input and label.
|
|
300
|
-
*
|
|
301
|
-
* Defaults to **false**.
|
|
302
|
-
*/
|
|
303
|
-
alignEnd: s.bool,
|
|
304
|
-
/**
|
|
305
|
-
* Content to be rendered inside the FormField. Accepts any valid markup.
|
|
306
|
-
*
|
|
307
|
-
* Defaults to **null**.
|
|
308
|
-
*/
|
|
309
|
-
children: s.node,
|
|
310
|
-
/**
|
|
311
|
-
* The css class name to be passed through to the component markup.
|
|
312
|
-
*
|
|
313
|
-
* Defaults to **undefined**.
|
|
314
|
-
*/
|
|
315
|
-
className: s.string,
|
|
316
|
-
/**
|
|
317
|
-
* The reference of the input the form field will be associated with. It enables a greater level of integration with parent components.
|
|
318
|
-
*
|
|
319
|
-
* Defaults to **null**.
|
|
320
|
-
*/
|
|
321
|
-
inputRef: s.oneOfType([
|
|
322
|
-
s.func,
|
|
323
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
324
|
-
s.shape({
|
|
325
|
-
current: s.any
|
|
326
|
-
})
|
|
327
|
-
])
|
|
328
|
-
}, qn = {
|
|
329
|
-
alignEnd: !1,
|
|
330
|
-
children: null,
|
|
331
|
-
className: void 0,
|
|
332
|
-
inputRef: null
|
|
333
|
-
}, Xe = /* @__PURE__ */ $((i, n) => {
|
|
334
|
-
const {
|
|
335
|
-
children: e,
|
|
336
|
-
inputRef: t,
|
|
337
|
-
className: r,
|
|
338
|
-
alignEnd: o,
|
|
339
|
-
...a
|
|
340
|
-
} = i, l = oe(), u = oe();
|
|
341
|
-
return ve(n, () => l.current, []), P(() => (u.current = $n.attachTo(l.current), () => {
|
|
342
|
-
u.current.destroy();
|
|
343
|
-
})), P(() => {
|
|
344
|
-
t && (u.current.input = t.current);
|
|
345
|
-
}, [t]), /* @__PURE__ */ c.createElement("div", U({
|
|
346
|
-
ref: l,
|
|
347
|
-
className: F("lmnt mdc-form-field lmnt-form-field", o && "mdc-form-field--align-end", r)
|
|
348
|
-
}, a), e);
|
|
349
|
-
});
|
|
350
|
-
Xe.displayName = "FormField";
|
|
351
|
-
Xe.propTypes = Vn;
|
|
352
|
-
Xe.defaultProps = qn;
|
|
353
|
-
const Xn = {
|
|
354
|
-
/**
|
|
355
|
-
* Content to be rendered inside the FormField. Accepts any valid markup.
|
|
356
|
-
*
|
|
357
|
-
* Defaults to **null**.
|
|
358
|
-
*/
|
|
359
|
-
children: s.node.isRequired,
|
|
360
|
-
/**
|
|
361
|
-
* The css class name to be passed through to the component markup.
|
|
362
|
-
*
|
|
363
|
-
* Defaults to **undefined**.
|
|
364
|
-
*/
|
|
365
|
-
className: s.string,
|
|
366
|
-
/**
|
|
367
|
-
* Applies disabled styling.
|
|
368
|
-
*
|
|
369
|
-
* Defaults to **false**.
|
|
370
|
-
*/
|
|
371
|
-
disabled: s.bool,
|
|
372
|
-
/**
|
|
373
|
-
* Visibly disable the label, though it will still be available to screen readers.
|
|
374
|
-
*
|
|
375
|
-
* Defaults to **false**.
|
|
376
|
-
*/
|
|
377
|
-
hideLabel: s.bool
|
|
378
|
-
}, zn = {
|
|
379
|
-
children: null,
|
|
380
|
-
className: void 0,
|
|
381
|
-
disabled: !1,
|
|
382
|
-
hideLabel: !1
|
|
383
|
-
}, rt = /* @__PURE__ */ $((i, n) => {
|
|
384
|
-
const {
|
|
385
|
-
children: e,
|
|
386
|
-
className: t,
|
|
387
|
-
disabled: r,
|
|
388
|
-
hideLabel: o,
|
|
389
|
-
targetId: a,
|
|
390
|
-
...l
|
|
391
|
-
} = i, u = oe();
|
|
392
|
-
return ve(n, () => u.current, []), /* @__PURE__ */ c.createElement("label", U({
|
|
393
|
-
ref: u,
|
|
394
|
-
className: F("lmnt-input-label", o && "sr-only", r && "lmnt-theme-on-surface-disabled", t),
|
|
395
|
-
htmlFor: a,
|
|
396
|
-
"aria-labelledby": a
|
|
397
|
-
}, l), e);
|
|
398
|
-
});
|
|
399
|
-
rt.displayName = "InputLabel";
|
|
400
|
-
rt.propTypes = Xn;
|
|
401
|
-
rt.defaultProps = zn;
|
|
402
|
-
/**
|
|
403
|
-
* @license
|
|
404
|
-
* Copyright 2016 Google Inc.
|
|
405
|
-
*
|
|
406
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
407
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
408
|
-
* in the Software without restriction, including without limitation the rights
|
|
409
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
410
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
411
|
-
* furnished to do so, subject to the following conditions:
|
|
412
|
-
*
|
|
413
|
-
* The above copyright notice and this permission notice shall be included in
|
|
414
|
-
* all copies or substantial portions of the Software.
|
|
415
|
-
*
|
|
416
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
417
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
418
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
419
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
420
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
421
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
422
|
-
* THE SOFTWARE.
|
|
423
|
-
*/
|
|
424
|
-
var Ut = {
|
|
425
|
-
animation: {
|
|
426
|
-
prefixed: "-webkit-animation",
|
|
427
|
-
standard: "animation"
|
|
428
|
-
},
|
|
429
|
-
transform: {
|
|
430
|
-
prefixed: "-webkit-transform",
|
|
431
|
-
standard: "transform"
|
|
432
|
-
},
|
|
433
|
-
transition: {
|
|
434
|
-
prefixed: "-webkit-transition",
|
|
435
|
-
standard: "transition"
|
|
436
|
-
}
|
|
437
|
-
}, Gt = {
|
|
438
|
-
animationend: {
|
|
439
|
-
cssProperty: "animation",
|
|
440
|
-
prefixed: "webkitAnimationEnd",
|
|
441
|
-
standard: "animationend"
|
|
442
|
-
},
|
|
443
|
-
animationiteration: {
|
|
444
|
-
cssProperty: "animation",
|
|
445
|
-
prefixed: "webkitAnimationIteration",
|
|
446
|
-
standard: "animationiteration"
|
|
447
|
-
},
|
|
448
|
-
animationstart: {
|
|
449
|
-
cssProperty: "animation",
|
|
450
|
-
prefixed: "webkitAnimationStart",
|
|
451
|
-
standard: "animationstart"
|
|
452
|
-
},
|
|
453
|
-
transitionend: {
|
|
454
|
-
cssProperty: "transition",
|
|
455
|
-
prefixed: "webkitTransitionEnd",
|
|
456
|
-
standard: "transitionend"
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
function cn(i) {
|
|
460
|
-
return !!i.document && typeof i.document.createElement == "function";
|
|
461
|
-
}
|
|
462
|
-
function Yn(i, n) {
|
|
463
|
-
if (cn(i) && n in Ut) {
|
|
464
|
-
var e = i.document.createElement("div"), t = Ut[n], r = t.standard, o = t.prefixed, a = r in e.style;
|
|
465
|
-
return a ? r : o;
|
|
466
|
-
}
|
|
467
|
-
return n;
|
|
468
|
-
}
|
|
469
|
-
function Wt(i, n) {
|
|
470
|
-
if (cn(i) && n in Gt) {
|
|
471
|
-
var e = i.document.createElement("div"), t = Gt[n], r = t.standard, o = t.prefixed, a = t.cssProperty, l = a in e.style;
|
|
472
|
-
return l ? r : o;
|
|
473
|
-
}
|
|
474
|
-
return n;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* @license
|
|
478
|
-
* Copyright 2016 Google Inc.
|
|
479
|
-
*
|
|
480
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
481
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
482
|
-
* in the Software without restriction, including without limitation the rights
|
|
483
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
484
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
485
|
-
* furnished to do so, subject to the following conditions:
|
|
486
|
-
*
|
|
487
|
-
* The above copyright notice and this permission notice shall be included in
|
|
488
|
-
* all copies or substantial portions of the Software.
|
|
489
|
-
*
|
|
490
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
491
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
492
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
493
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
494
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
495
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
496
|
-
* THE SOFTWARE.
|
|
497
|
-
*/
|
|
498
|
-
var Ye = {
|
|
499
|
-
ANIM_CHECKED_INDETERMINATE: "mdc-checkbox--anim-checked-indeterminate",
|
|
500
|
-
ANIM_CHECKED_UNCHECKED: "mdc-checkbox--anim-checked-unchecked",
|
|
501
|
-
ANIM_INDETERMINATE_CHECKED: "mdc-checkbox--anim-indeterminate-checked",
|
|
502
|
-
ANIM_INDETERMINATE_UNCHECKED: "mdc-checkbox--anim-indeterminate-unchecked",
|
|
503
|
-
ANIM_UNCHECKED_CHECKED: "mdc-checkbox--anim-unchecked-checked",
|
|
504
|
-
ANIM_UNCHECKED_INDETERMINATE: "mdc-checkbox--anim-unchecked-indeterminate",
|
|
505
|
-
BACKGROUND: "mdc-checkbox__background",
|
|
506
|
-
CHECKED: "mdc-checkbox--checked",
|
|
507
|
-
CHECKMARK: "mdc-checkbox__checkmark",
|
|
508
|
-
CHECKMARK_PATH: "mdc-checkbox__checkmark-path",
|
|
509
|
-
DISABLED: "mdc-checkbox--disabled",
|
|
510
|
-
INDETERMINATE: "mdc-checkbox--indeterminate",
|
|
511
|
-
MIXEDMARK: "mdc-checkbox__mixedmark",
|
|
512
|
-
NATIVE_CONTROL: "mdc-checkbox__native-control",
|
|
513
|
-
ROOT: "mdc-checkbox",
|
|
514
|
-
SELECTED: "mdc-checkbox--selected",
|
|
515
|
-
UPGRADED: "mdc-checkbox--upgraded"
|
|
516
|
-
}, me = {
|
|
517
|
-
ARIA_CHECKED_ATTR: "aria-checked",
|
|
518
|
-
ARIA_CHECKED_INDETERMINATE_VALUE: "mixed",
|
|
519
|
-
DATA_INDETERMINATE_ATTR: "data-indeterminate",
|
|
520
|
-
NATIVE_CONTROL_SELECTOR: ".mdc-checkbox__native-control",
|
|
521
|
-
TRANSITION_STATE_CHECKED: "checked",
|
|
522
|
-
TRANSITION_STATE_INDETERMINATE: "indeterminate",
|
|
523
|
-
TRANSITION_STATE_INIT: "init",
|
|
524
|
-
TRANSITION_STATE_UNCHECKED: "unchecked"
|
|
525
|
-
}, jt = {
|
|
526
|
-
ANIM_END_LATCH_MS: 250
|
|
527
|
-
};
|
|
528
|
-
/**
|
|
529
|
-
* @license
|
|
530
|
-
* Copyright 2016 Google Inc.
|
|
531
|
-
*
|
|
532
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
533
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
534
|
-
* in the Software without restriction, including without limitation the rights
|
|
535
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
536
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
537
|
-
* furnished to do so, subject to the following conditions:
|
|
538
|
-
*
|
|
539
|
-
* The above copyright notice and this permission notice shall be included in
|
|
540
|
-
* all copies or substantial portions of the Software.
|
|
541
|
-
*
|
|
542
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
543
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
544
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
545
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
546
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
547
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
548
|
-
* THE SOFTWARE.
|
|
549
|
-
*/
|
|
550
|
-
var Qn = (
|
|
551
|
-
/** @class */
|
|
552
|
-
function(i) {
|
|
553
|
-
Ee(n, i);
|
|
554
|
-
function n(e) {
|
|
555
|
-
var t = i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
556
|
-
return t.currentCheckState_ = me.TRANSITION_STATE_INIT, t.currentAnimationClass_ = "", t.animEndLatchTimer_ = 0, t.enableAnimationEndHandler_ = !1, t;
|
|
557
|
-
}
|
|
558
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
559
|
-
get: function() {
|
|
560
|
-
return Ye;
|
|
561
|
-
},
|
|
562
|
-
enumerable: !1,
|
|
563
|
-
configurable: !0
|
|
564
|
-
}), Object.defineProperty(n, "strings", {
|
|
565
|
-
get: function() {
|
|
566
|
-
return me;
|
|
567
|
-
},
|
|
568
|
-
enumerable: !1,
|
|
569
|
-
configurable: !0
|
|
570
|
-
}), Object.defineProperty(n, "numbers", {
|
|
571
|
-
get: function() {
|
|
572
|
-
return jt;
|
|
573
|
-
},
|
|
574
|
-
enumerable: !1,
|
|
575
|
-
configurable: !0
|
|
576
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
577
|
-
get: function() {
|
|
578
|
-
return {
|
|
579
|
-
addClass: function() {
|
|
580
|
-
},
|
|
581
|
-
forceLayout: function() {
|
|
582
|
-
},
|
|
583
|
-
hasNativeControl: function() {
|
|
584
|
-
return !1;
|
|
585
|
-
},
|
|
586
|
-
isAttachedToDOM: function() {
|
|
587
|
-
return !1;
|
|
588
|
-
},
|
|
589
|
-
isChecked: function() {
|
|
590
|
-
return !1;
|
|
591
|
-
},
|
|
592
|
-
isIndeterminate: function() {
|
|
593
|
-
return !1;
|
|
594
|
-
},
|
|
595
|
-
removeClass: function() {
|
|
596
|
-
},
|
|
597
|
-
removeNativeControlAttr: function() {
|
|
598
|
-
},
|
|
599
|
-
setNativeControlAttr: function() {
|
|
600
|
-
},
|
|
601
|
-
setNativeControlDisabled: function() {
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
},
|
|
605
|
-
enumerable: !1,
|
|
606
|
-
configurable: !0
|
|
607
|
-
}), n.prototype.init = function() {
|
|
608
|
-
this.currentCheckState_ = this.determineCheckState_(), this.updateAriaChecked_(), this.adapter.addClass(Ye.UPGRADED);
|
|
609
|
-
}, n.prototype.destroy = function() {
|
|
610
|
-
clearTimeout(this.animEndLatchTimer_);
|
|
611
|
-
}, n.prototype.setDisabled = function(e) {
|
|
612
|
-
this.adapter.setNativeControlDisabled(e), e ? this.adapter.addClass(Ye.DISABLED) : this.adapter.removeClass(Ye.DISABLED);
|
|
613
|
-
}, n.prototype.handleAnimationEnd = function() {
|
|
614
|
-
var e = this;
|
|
615
|
-
this.enableAnimationEndHandler_ && (clearTimeout(this.animEndLatchTimer_), this.animEndLatchTimer_ = setTimeout(function() {
|
|
616
|
-
e.adapter.removeClass(e.currentAnimationClass_), e.enableAnimationEndHandler_ = !1;
|
|
617
|
-
}, jt.ANIM_END_LATCH_MS));
|
|
618
|
-
}, n.prototype.handleChange = function() {
|
|
619
|
-
this.transitionCheckState_();
|
|
620
|
-
}, n.prototype.transitionCheckState_ = function() {
|
|
621
|
-
if (this.adapter.hasNativeControl()) {
|
|
622
|
-
var e = this.currentCheckState_, t = this.determineCheckState_();
|
|
623
|
-
if (e !== t) {
|
|
624
|
-
this.updateAriaChecked_();
|
|
625
|
-
var r = me.TRANSITION_STATE_UNCHECKED, o = Ye.SELECTED;
|
|
626
|
-
t === r ? this.adapter.removeClass(o) : this.adapter.addClass(o), this.currentAnimationClass_.length > 0 && (clearTimeout(this.animEndLatchTimer_), this.adapter.forceLayout(), this.adapter.removeClass(this.currentAnimationClass_)), this.currentAnimationClass_ = this.getTransitionAnimationClass_(e, t), this.currentCheckState_ = t, this.adapter.isAttachedToDOM() && this.currentAnimationClass_.length > 0 && (this.adapter.addClass(this.currentAnimationClass_), this.enableAnimationEndHandler_ = !0);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}, n.prototype.determineCheckState_ = function() {
|
|
630
|
-
var e = me.TRANSITION_STATE_INDETERMINATE, t = me.TRANSITION_STATE_CHECKED, r = me.TRANSITION_STATE_UNCHECKED;
|
|
631
|
-
return this.adapter.isIndeterminate() ? e : this.adapter.isChecked() ? t : r;
|
|
632
|
-
}, n.prototype.getTransitionAnimationClass_ = function(e, t) {
|
|
633
|
-
var r = me.TRANSITION_STATE_INIT, o = me.TRANSITION_STATE_CHECKED, a = me.TRANSITION_STATE_UNCHECKED, l = n.cssClasses, u = l.ANIM_UNCHECKED_CHECKED, y = l.ANIM_UNCHECKED_INDETERMINATE, C = l.ANIM_CHECKED_UNCHECKED, m = l.ANIM_CHECKED_INDETERMINATE, E = l.ANIM_INDETERMINATE_CHECKED, d = l.ANIM_INDETERMINATE_UNCHECKED;
|
|
634
|
-
switch (e) {
|
|
635
|
-
case r:
|
|
636
|
-
return t === a ? "" : t === o ? E : d;
|
|
637
|
-
case a:
|
|
638
|
-
return t === o ? u : y;
|
|
639
|
-
case o:
|
|
640
|
-
return t === a ? C : m;
|
|
641
|
-
default:
|
|
642
|
-
return t === o ? E : d;
|
|
643
|
-
}
|
|
644
|
-
}, n.prototype.updateAriaChecked_ = function() {
|
|
645
|
-
this.adapter.isIndeterminate() ? this.adapter.setNativeControlAttr(me.ARIA_CHECKED_ATTR, me.ARIA_CHECKED_INDETERMINATE_VALUE) : this.adapter.removeNativeControlAttr(me.ARIA_CHECKED_ATTR);
|
|
646
|
-
}, n;
|
|
647
|
-
}(He)
|
|
648
|
-
);
|
|
649
|
-
/**
|
|
650
|
-
* @license
|
|
651
|
-
* Copyright 2016 Google Inc.
|
|
652
|
-
*
|
|
653
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
654
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
655
|
-
* in the Software without restriction, including without limitation the rights
|
|
656
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
657
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
658
|
-
* furnished to do so, subject to the following conditions:
|
|
659
|
-
*
|
|
660
|
-
* The above copyright notice and this permission notice shall be included in
|
|
661
|
-
* all copies or substantial portions of the Software.
|
|
662
|
-
*
|
|
663
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
664
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
665
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
666
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
667
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
668
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
669
|
-
* THE SOFTWARE.
|
|
670
|
-
*/
|
|
671
|
-
var $t = ["checked", "indeterminate"], Zn = (
|
|
672
|
-
/** @class */
|
|
673
|
-
function(i) {
|
|
674
|
-
Ee(n, i);
|
|
675
|
-
function n() {
|
|
676
|
-
var e = i !== null && i.apply(this, arguments) || this;
|
|
677
|
-
return e.ripple_ = e.createRipple_(), e;
|
|
678
|
-
}
|
|
679
|
-
return n.attachTo = function(e) {
|
|
680
|
-
return new n(e);
|
|
681
|
-
}, Object.defineProperty(n.prototype, "ripple", {
|
|
682
|
-
get: function() {
|
|
683
|
-
return this.ripple_;
|
|
684
|
-
},
|
|
685
|
-
enumerable: !1,
|
|
686
|
-
configurable: !0
|
|
687
|
-
}), Object.defineProperty(n.prototype, "checked", {
|
|
688
|
-
get: function() {
|
|
689
|
-
return this.nativeControl_.checked;
|
|
690
|
-
},
|
|
691
|
-
set: function(e) {
|
|
692
|
-
this.nativeControl_.checked = e;
|
|
693
|
-
},
|
|
694
|
-
enumerable: !1,
|
|
695
|
-
configurable: !0
|
|
696
|
-
}), Object.defineProperty(n.prototype, "indeterminate", {
|
|
697
|
-
get: function() {
|
|
698
|
-
return this.nativeControl_.indeterminate;
|
|
699
|
-
},
|
|
700
|
-
set: function(e) {
|
|
701
|
-
this.nativeControl_.indeterminate = e;
|
|
702
|
-
},
|
|
703
|
-
enumerable: !1,
|
|
704
|
-
configurable: !0
|
|
705
|
-
}), Object.defineProperty(n.prototype, "disabled", {
|
|
706
|
-
get: function() {
|
|
707
|
-
return this.nativeControl_.disabled;
|
|
708
|
-
},
|
|
709
|
-
set: function(e) {
|
|
710
|
-
this.foundation.setDisabled(e);
|
|
711
|
-
},
|
|
712
|
-
enumerable: !1,
|
|
713
|
-
configurable: !0
|
|
714
|
-
}), Object.defineProperty(n.prototype, "value", {
|
|
715
|
-
get: function() {
|
|
716
|
-
return this.nativeControl_.value;
|
|
717
|
-
},
|
|
718
|
-
set: function(e) {
|
|
719
|
-
this.nativeControl_.value = e;
|
|
720
|
-
},
|
|
721
|
-
enumerable: !1,
|
|
722
|
-
configurable: !0
|
|
723
|
-
}), n.prototype.initialize = function() {
|
|
724
|
-
var e = me.DATA_INDETERMINATE_ATTR;
|
|
725
|
-
this.nativeControl_.indeterminate = this.nativeControl_.getAttribute(e) === "true", this.nativeControl_.removeAttribute(e);
|
|
726
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
727
|
-
var e = this;
|
|
728
|
-
this.handleChange_ = function() {
|
|
729
|
-
return e.foundation.handleChange();
|
|
730
|
-
}, this.handleAnimationEnd_ = function() {
|
|
731
|
-
return e.foundation.handleAnimationEnd();
|
|
732
|
-
}, this.nativeControl_.addEventListener("change", this.handleChange_), this.listen(Wt(window, "animationend"), this.handleAnimationEnd_), this.installPropertyChangeHooks_();
|
|
733
|
-
}, n.prototype.destroy = function() {
|
|
734
|
-
this.ripple_.destroy(), this.nativeControl_.removeEventListener("change", this.handleChange_), this.unlisten(Wt(window, "animationend"), this.handleAnimationEnd_), this.uninstallPropertyChangeHooks_(), i.prototype.destroy.call(this);
|
|
735
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
736
|
-
var e = this, t = {
|
|
737
|
-
addClass: function(r) {
|
|
738
|
-
return e.root.classList.add(r);
|
|
739
|
-
},
|
|
740
|
-
forceLayout: function() {
|
|
741
|
-
return e.root.offsetWidth;
|
|
742
|
-
},
|
|
743
|
-
hasNativeControl: function() {
|
|
744
|
-
return !!e.nativeControl_;
|
|
745
|
-
},
|
|
746
|
-
isAttachedToDOM: function() {
|
|
747
|
-
return !!e.root.parentNode;
|
|
748
|
-
},
|
|
749
|
-
isChecked: function() {
|
|
750
|
-
return e.checked;
|
|
751
|
-
},
|
|
752
|
-
isIndeterminate: function() {
|
|
753
|
-
return e.indeterminate;
|
|
754
|
-
},
|
|
755
|
-
removeClass: function(r) {
|
|
756
|
-
e.root.classList.remove(r);
|
|
757
|
-
},
|
|
758
|
-
removeNativeControlAttr: function(r) {
|
|
759
|
-
e.nativeControl_.removeAttribute(r);
|
|
760
|
-
},
|
|
761
|
-
setNativeControlAttr: function(r, o) {
|
|
762
|
-
e.nativeControl_.setAttribute(r, o);
|
|
763
|
-
},
|
|
764
|
-
setNativeControlDisabled: function(r) {
|
|
765
|
-
e.nativeControl_.disabled = r;
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
return new Qn(t);
|
|
769
|
-
}, n.prototype.createRipple_ = function() {
|
|
770
|
-
var e = this, t = J(J({}, je.createAdapter(this)), { deregisterInteractionHandler: function(r, o) {
|
|
771
|
-
return e.nativeControl_.removeEventListener(r, o, $e());
|
|
772
|
-
}, isSurfaceActive: function() {
|
|
773
|
-
return ke(e.nativeControl_, ":active");
|
|
774
|
-
}, isUnbounded: function() {
|
|
775
|
-
return !0;
|
|
776
|
-
}, registerInteractionHandler: function(r, o) {
|
|
777
|
-
return e.nativeControl_.addEventListener(r, o, $e());
|
|
778
|
-
} });
|
|
779
|
-
return new je(this.root, new Rt(t));
|
|
780
|
-
}, n.prototype.installPropertyChangeHooks_ = function() {
|
|
781
|
-
var e = this, t = this.nativeControl_, r = Object.getPrototypeOf(t);
|
|
782
|
-
$t.forEach(function(o) {
|
|
783
|
-
var a = Object.getOwnPropertyDescriptor(r, o);
|
|
784
|
-
if (Vt(a)) {
|
|
785
|
-
var l = a.get, u = {
|
|
786
|
-
configurable: a.configurable,
|
|
787
|
-
enumerable: a.enumerable,
|
|
788
|
-
get: l,
|
|
789
|
-
set: function(y) {
|
|
790
|
-
a.set.call(t, y), e.foundation.handleChange();
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
Object.defineProperty(t, o, u);
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
}, n.prototype.uninstallPropertyChangeHooks_ = function() {
|
|
797
|
-
var e = this.nativeControl_, t = Object.getPrototypeOf(e);
|
|
798
|
-
$t.forEach(function(r) {
|
|
799
|
-
var o = Object.getOwnPropertyDescriptor(t, r);
|
|
800
|
-
Vt(o) && Object.defineProperty(e, r, o);
|
|
801
|
-
});
|
|
802
|
-
}, Object.defineProperty(n.prototype, "nativeControl_", {
|
|
803
|
-
get: function() {
|
|
804
|
-
var e = me.NATIVE_CONTROL_SELECTOR, t = this.root.querySelector(e);
|
|
805
|
-
if (!t)
|
|
806
|
-
throw new Error("Checkbox component requires a " + e + " element");
|
|
807
|
-
return t;
|
|
808
|
-
},
|
|
809
|
-
enumerable: !1,
|
|
810
|
-
configurable: !0
|
|
811
|
-
}), n;
|
|
812
|
-
}(Ke)
|
|
813
|
-
);
|
|
814
|
-
function Vt(i) {
|
|
815
|
-
return !!i && typeof i.set == "function";
|
|
816
|
-
}
|
|
817
|
-
const Jn = {
|
|
818
|
-
/**
|
|
819
|
-
* Aligns checkbox to the right of the label.
|
|
820
|
-
*
|
|
821
|
-
* Defaults to **false**.
|
|
822
|
-
*/
|
|
823
|
-
alignEnd: s.bool,
|
|
824
|
-
/**
|
|
825
|
-
* The current state of the checkbox.
|
|
826
|
-
*
|
|
827
|
-
* Defaults to **null**.
|
|
828
|
-
*/
|
|
829
|
-
checked: s.bool,
|
|
830
|
-
/**
|
|
831
|
-
* Alternative to `label`, if both `label` and `children` are set, `label` will take priority. Expects a string, but will accept any valid markup.
|
|
832
|
-
*
|
|
833
|
-
* Defaults to **undefined**.
|
|
834
|
-
*/
|
|
835
|
-
children: s.node,
|
|
836
|
-
/**
|
|
837
|
-
* The css class name to be passed through to the component markup.
|
|
838
|
-
*
|
|
839
|
-
* Defaults to **undefined**.
|
|
840
|
-
*/
|
|
841
|
-
className: s.string,
|
|
842
|
-
/**
|
|
843
|
-
* Prevent the user from interacting with the component.
|
|
844
|
-
*
|
|
845
|
-
* Defaults to **false**.
|
|
846
|
-
*/
|
|
847
|
-
disabled: s.bool,
|
|
848
|
-
/**
|
|
849
|
-
* The label not be displayed, but will still be available to screen readers. This should only be used when the context of the checkbox is clear and understandable. An example use-case could be as a column in a table where the column header specifies the action.
|
|
850
|
-
*
|
|
851
|
-
* Defaults to **false**.
|
|
852
|
-
*/
|
|
853
|
-
hideLabel: s.bool,
|
|
854
|
-
/**
|
|
855
|
-
* Randomly generated id. May be overwritten.
|
|
856
|
-
*
|
|
857
|
-
* Defaults to **undefined**.
|
|
858
|
-
*/
|
|
859
|
-
id: s.string,
|
|
860
|
-
/**
|
|
861
|
-
* The checkbox will show an indicator if no value (true or false) is set.
|
|
862
|
-
*
|
|
863
|
-
* Defaults to **false**.
|
|
864
|
-
*/
|
|
865
|
-
indeterminate: s.bool,
|
|
866
|
-
/**
|
|
867
|
-
* Display label. The `label` should always be set even when using `hideLabel` - it will be used by screen readers.
|
|
868
|
-
*
|
|
869
|
-
* Defaults to **null**.
|
|
870
|
-
*/
|
|
871
|
-
label: s.string,
|
|
872
|
-
/**
|
|
873
|
-
* Fired when checkbox value is changed
|
|
874
|
-
*
|
|
875
|
-
* Defaults to **null**.
|
|
876
|
-
*/
|
|
877
|
-
onChange: s.func,
|
|
878
|
-
/**
|
|
879
|
-
* Override the default (`primary`) color with the `secondary` color. Most commonly used when the control is placed on a darker surface.
|
|
880
|
-
*
|
|
881
|
-
* Defaults to **'primary'**.
|
|
882
|
-
*/
|
|
883
|
-
themeColor: s.oneOf(["primary", "secondary", "danger", "success"]),
|
|
884
|
-
/**
|
|
885
|
-
* Any additional value information to be included with the event.
|
|
886
|
-
*
|
|
887
|
-
* Defaults to **null**.
|
|
888
|
-
*/
|
|
889
|
-
value: s.oneOfType([s.string, s.number, s.bool, s.object])
|
|
890
|
-
}, er = {
|
|
891
|
-
alignEnd: !1,
|
|
892
|
-
checked: null,
|
|
893
|
-
children: void 0,
|
|
894
|
-
className: void 0,
|
|
895
|
-
disabled: !1,
|
|
896
|
-
hideLabel: !1,
|
|
897
|
-
id: void 0,
|
|
898
|
-
indeterminate: !1,
|
|
899
|
-
label: null,
|
|
900
|
-
themeColor: "primary",
|
|
901
|
-
value: null
|
|
902
|
-
}, dt = /* @__PURE__ */ $((i, n) => {
|
|
903
|
-
const {
|
|
904
|
-
alignEnd: e,
|
|
905
|
-
checked: t,
|
|
906
|
-
children: r,
|
|
907
|
-
className: o,
|
|
908
|
-
disabled: a,
|
|
909
|
-
hideLabel: l,
|
|
910
|
-
id: u,
|
|
911
|
-
indeterminate: y,
|
|
912
|
-
label: C,
|
|
913
|
-
onChange: m,
|
|
914
|
-
themeColor: E,
|
|
915
|
-
value: d,
|
|
916
|
-
...f
|
|
917
|
-
} = i, [A] = Ae(() => u || qe()), v = oe(), p = oe(), h = C || r;
|
|
918
|
-
ve(n, () => v.current, []);
|
|
919
|
-
let g = !1, b = t;
|
|
920
|
-
const k = Y((se) => {
|
|
921
|
-
const O = se.target.checked;
|
|
922
|
-
g && O === b || (g = !0, b = O, m?.(b, se, d));
|
|
923
|
-
}, [m]);
|
|
924
|
-
P(() => (p.current = new Zn(v.current), () => {
|
|
925
|
-
p.current.destroy();
|
|
926
|
-
}), []), P(() => {
|
|
927
|
-
p.current.checked !== t && (p.current.checked = t);
|
|
928
|
-
}, [t]), P(() => {
|
|
929
|
-
y && t === null ? p.current.indeterminate = !0 : p.current.indeterminate = !1;
|
|
930
|
-
}, [t, y]);
|
|
931
|
-
const Q = {};
|
|
932
|
-
return d != null && (Q.value = d), /* @__PURE__ */ c.createElement(Xe, {
|
|
933
|
-
alignEnd: e,
|
|
934
|
-
input: p,
|
|
935
|
-
className: "lmnt mdc-touch-target-wrapper"
|
|
936
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
937
|
-
// onClick={handleChange}
|
|
938
|
-
ref: v,
|
|
939
|
-
className: F("lmnt mdc-checkbox lmnt-checkbox mdc-checkbox--touch", a && "mdc-checkbox--disabled", E && `lmnt-checkbox--${E}`, o)
|
|
940
|
-
}, /* @__PURE__ */ c.createElement("input", U({
|
|
941
|
-
id: A,
|
|
942
|
-
disabled: a,
|
|
943
|
-
type: "checkbox",
|
|
944
|
-
className: "mdc-checkbox__native-control",
|
|
945
|
-
onChange: k,
|
|
946
|
-
onClick: k,
|
|
947
|
-
defaultChecked: t
|
|
948
|
-
}, Q, f)), /* @__PURE__ */ c.createElement("div", {
|
|
949
|
-
className: "mdc-checkbox__background"
|
|
950
|
-
}, /* @__PURE__ */ c.createElement("svg", {
|
|
951
|
-
className: "mdc-checkbox__checkmark",
|
|
952
|
-
viewBox: "0 0 24 24"
|
|
953
|
-
}, /* @__PURE__ */ c.createElement("path", {
|
|
954
|
-
className: "mdc-checkbox__checkmark-path",
|
|
955
|
-
fill: "none",
|
|
956
|
-
stroke: "white",
|
|
957
|
-
d: "M1.73,12.91 8.1,19.28 22.79,4.59"
|
|
958
|
-
})), /* @__PURE__ */ c.createElement("div", {
|
|
959
|
-
className: "mdc-checkbox__mixedmark"
|
|
960
|
-
})), /* @__PURE__ */ c.createElement("div", {
|
|
961
|
-
className: "mdc-checkbox__ripple"
|
|
962
|
-
})), /* @__PURE__ */ c.createElement(rt, {
|
|
963
|
-
hideLabel: l,
|
|
964
|
-
targetId: A,
|
|
965
|
-
className: F(a && "lmnt-theme-on-surface-disabled"),
|
|
966
|
-
disabled: a
|
|
967
|
-
}, h));
|
|
968
|
-
});
|
|
969
|
-
dt.displayName = "Checkbox";
|
|
970
|
-
dt.propTypes = Jn;
|
|
971
|
-
dt.defaultProps = er;
|
|
972
|
-
/**
|
|
973
|
-
* @license
|
|
974
|
-
* Copyright 2020 Google Inc.
|
|
975
|
-
*
|
|
976
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
977
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
978
|
-
* in the Software without restriction, including without limitation the rights
|
|
979
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
980
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
981
|
-
* furnished to do so, subject to the following conditions:
|
|
982
|
-
*
|
|
983
|
-
* The above copyright notice and this permission notice shall be included in
|
|
984
|
-
* all copies or substantial portions of the Software.
|
|
985
|
-
*
|
|
986
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
987
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
988
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
989
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
990
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
991
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
992
|
-
* THE SOFTWARE.
|
|
993
|
-
*/
|
|
994
|
-
var D = {
|
|
995
|
-
UNKNOWN: "Unknown",
|
|
996
|
-
BACKSPACE: "Backspace",
|
|
997
|
-
ENTER: "Enter",
|
|
998
|
-
SPACEBAR: "Spacebar",
|
|
999
|
-
PAGE_UP: "PageUp",
|
|
1000
|
-
PAGE_DOWN: "PageDown",
|
|
1001
|
-
END: "End",
|
|
1002
|
-
HOME: "Home",
|
|
1003
|
-
ARROW_LEFT: "ArrowLeft",
|
|
1004
|
-
ARROW_UP: "ArrowUp",
|
|
1005
|
-
ARROW_RIGHT: "ArrowRight",
|
|
1006
|
-
ARROW_DOWN: "ArrowDown",
|
|
1007
|
-
DELETE: "Delete",
|
|
1008
|
-
ESCAPE: "Escape",
|
|
1009
|
-
TAB: "Tab"
|
|
1010
|
-
}, le = /* @__PURE__ */ new Set();
|
|
1011
|
-
le.add(D.BACKSPACE);
|
|
1012
|
-
le.add(D.ENTER);
|
|
1013
|
-
le.add(D.SPACEBAR);
|
|
1014
|
-
le.add(D.PAGE_UP);
|
|
1015
|
-
le.add(D.PAGE_DOWN);
|
|
1016
|
-
le.add(D.END);
|
|
1017
|
-
le.add(D.HOME);
|
|
1018
|
-
le.add(D.ARROW_LEFT);
|
|
1019
|
-
le.add(D.ARROW_UP);
|
|
1020
|
-
le.add(D.ARROW_RIGHT);
|
|
1021
|
-
le.add(D.ARROW_DOWN);
|
|
1022
|
-
le.add(D.DELETE);
|
|
1023
|
-
le.add(D.ESCAPE);
|
|
1024
|
-
le.add(D.TAB);
|
|
1025
|
-
var Ie = {
|
|
1026
|
-
BACKSPACE: 8,
|
|
1027
|
-
ENTER: 13,
|
|
1028
|
-
SPACEBAR: 32,
|
|
1029
|
-
PAGE_UP: 33,
|
|
1030
|
-
PAGE_DOWN: 34,
|
|
1031
|
-
END: 35,
|
|
1032
|
-
HOME: 36,
|
|
1033
|
-
ARROW_LEFT: 37,
|
|
1034
|
-
ARROW_UP: 38,
|
|
1035
|
-
ARROW_RIGHT: 39,
|
|
1036
|
-
ARROW_DOWN: 40,
|
|
1037
|
-
DELETE: 46,
|
|
1038
|
-
ESCAPE: 27,
|
|
1039
|
-
TAB: 9
|
|
1040
|
-
}, ce = /* @__PURE__ */ new Map();
|
|
1041
|
-
ce.set(Ie.BACKSPACE, D.BACKSPACE);
|
|
1042
|
-
ce.set(Ie.ENTER, D.ENTER);
|
|
1043
|
-
ce.set(Ie.SPACEBAR, D.SPACEBAR);
|
|
1044
|
-
ce.set(Ie.PAGE_UP, D.PAGE_UP);
|
|
1045
|
-
ce.set(Ie.PAGE_DOWN, D.PAGE_DOWN);
|
|
1046
|
-
ce.set(Ie.END, D.END);
|
|
1047
|
-
ce.set(Ie.HOME, D.HOME);
|
|
1048
|
-
ce.set(Ie.ARROW_LEFT, D.ARROW_LEFT);
|
|
1049
|
-
ce.set(Ie.ARROW_UP, D.ARROW_UP);
|
|
1050
|
-
ce.set(Ie.ARROW_RIGHT, D.ARROW_RIGHT);
|
|
1051
|
-
ce.set(Ie.ARROW_DOWN, D.ARROW_DOWN);
|
|
1052
|
-
ce.set(Ie.DELETE, D.DELETE);
|
|
1053
|
-
ce.set(Ie.ESCAPE, D.ESCAPE);
|
|
1054
|
-
ce.set(Ie.TAB, D.TAB);
|
|
1055
|
-
var De = /* @__PURE__ */ new Set();
|
|
1056
|
-
De.add(D.PAGE_UP);
|
|
1057
|
-
De.add(D.PAGE_DOWN);
|
|
1058
|
-
De.add(D.END);
|
|
1059
|
-
De.add(D.HOME);
|
|
1060
|
-
De.add(D.ARROW_LEFT);
|
|
1061
|
-
De.add(D.ARROW_UP);
|
|
1062
|
-
De.add(D.ARROW_RIGHT);
|
|
1063
|
-
De.add(D.ARROW_DOWN);
|
|
1064
|
-
function ae(i) {
|
|
1065
|
-
var n = i.key;
|
|
1066
|
-
if (le.has(n))
|
|
1067
|
-
return n;
|
|
1068
|
-
var e = ce.get(i.keyCode);
|
|
1069
|
-
return e || D.UNKNOWN;
|
|
1070
|
-
}
|
|
1071
|
-
/**
|
|
1072
|
-
* @license
|
|
1073
|
-
* Copyright 2018 Google Inc.
|
|
1074
|
-
*
|
|
1075
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1076
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1077
|
-
* in the Software without restriction, including without limitation the rights
|
|
1078
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1079
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1080
|
-
* furnished to do so, subject to the following conditions:
|
|
1081
|
-
*
|
|
1082
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1083
|
-
* all copies or substantial portions of the Software.
|
|
1084
|
-
*
|
|
1085
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1086
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1087
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1088
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1089
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1090
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1091
|
-
* THE SOFTWARE.
|
|
1092
|
-
*/
|
|
1093
|
-
var Ze = {
|
|
1094
|
-
ANCHOR: "mdc-menu-surface--anchor",
|
|
1095
|
-
ANIMATING_CLOSED: "mdc-menu-surface--animating-closed",
|
|
1096
|
-
ANIMATING_OPEN: "mdc-menu-surface--animating-open",
|
|
1097
|
-
FIXED: "mdc-menu-surface--fixed",
|
|
1098
|
-
IS_OPEN_BELOW: "mdc-menu-surface--is-open-below",
|
|
1099
|
-
OPEN: "mdc-menu-surface--open",
|
|
1100
|
-
ROOT: "mdc-menu-surface"
|
|
1101
|
-
}, Je = {
|
|
1102
|
-
CLOSED_EVENT: "MDCMenuSurface:closed",
|
|
1103
|
-
CLOSING_EVENT: "MDCMenuSurface:closing",
|
|
1104
|
-
OPENED_EVENT: "MDCMenuSurface:opened",
|
|
1105
|
-
FOCUSABLE_ELEMENTS: [
|
|
1106
|
-
"button:not(:disabled)",
|
|
1107
|
-
'[href]:not([aria-disabled="true"])',
|
|
1108
|
-
"input:not(:disabled)",
|
|
1109
|
-
"select:not(:disabled)",
|
|
1110
|
-
"textarea:not(:disabled)",
|
|
1111
|
-
'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'
|
|
1112
|
-
].join(", ")
|
|
1113
|
-
}, ot = {
|
|
1114
|
-
/** Total duration of menu-surface open animation. */
|
|
1115
|
-
TRANSITION_OPEN_DURATION: 120,
|
|
1116
|
-
/** Total duration of menu-surface close animation. */
|
|
1117
|
-
TRANSITION_CLOSE_DURATION: 75,
|
|
1118
|
-
/** Margin left to the edge of the viewport when menu-surface is at maximum possible height. Also used as a viewport margin. */
|
|
1119
|
-
MARGIN_TO_EDGE: 32,
|
|
1120
|
-
/** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */
|
|
1121
|
-
ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
|
|
1122
|
-
}, X;
|
|
1123
|
-
(function(i) {
|
|
1124
|
-
i[i.BOTTOM = 1] = "BOTTOM", i[i.CENTER = 2] = "CENTER", i[i.RIGHT = 4] = "RIGHT", i[i.FLIP_RTL = 8] = "FLIP_RTL";
|
|
1125
|
-
})(X || (X = {}));
|
|
1126
|
-
var Ge;
|
|
1127
|
-
(function(i) {
|
|
1128
|
-
i[i.TOP_LEFT = 0] = "TOP_LEFT", i[i.TOP_RIGHT = 4] = "TOP_RIGHT", i[i.BOTTOM_LEFT = 1] = "BOTTOM_LEFT", i[i.BOTTOM_RIGHT = 5] = "BOTTOM_RIGHT", i[i.TOP_START = 8] = "TOP_START", i[i.TOP_END = 12] = "TOP_END", i[i.BOTTOM_START = 9] = "BOTTOM_START", i[i.BOTTOM_END = 13] = "BOTTOM_END";
|
|
1129
|
-
})(Ge || (Ge = {}));
|
|
1130
|
-
/**
|
|
1131
|
-
* @license
|
|
1132
|
-
* Copyright 2018 Google Inc.
|
|
1133
|
-
*
|
|
1134
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1135
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1136
|
-
* in the Software without restriction, including without limitation the rights
|
|
1137
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1138
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1139
|
-
* furnished to do so, subject to the following conditions:
|
|
1140
|
-
*
|
|
1141
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1142
|
-
* all copies or substantial portions of the Software.
|
|
1143
|
-
*
|
|
1144
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1145
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1146
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1147
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1148
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1149
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1150
|
-
* THE SOFTWARE.
|
|
1151
|
-
*/
|
|
1152
|
-
var Ne, xe, T = {
|
|
1153
|
-
LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated",
|
|
1154
|
-
LIST_ITEM_CLASS: "mdc-list-item",
|
|
1155
|
-
LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled",
|
|
1156
|
-
LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected",
|
|
1157
|
-
LIST_ITEM_TEXT_CLASS: "mdc-list-item__text",
|
|
1158
|
-
LIST_ITEM_PRIMARY_TEXT_CLASS: "mdc-list-item__primary-text",
|
|
1159
|
-
ROOT: "mdc-list"
|
|
1160
|
-
}, tr = (Ne = {}, Ne["" + T.LIST_ITEM_ACTIVATED_CLASS] = "mdc-list-item--activated", Ne["" + T.LIST_ITEM_CLASS] = "mdc-list-item", Ne["" + T.LIST_ITEM_DISABLED_CLASS] = "mdc-list-item--disabled", Ne["" + T.LIST_ITEM_SELECTED_CLASS] = "mdc-list-item--selected", Ne["" + T.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-list-item__primary-text", Ne["" + T.ROOT] = "mdc-list", Ne), Pe = (xe = {}, xe["" + T.LIST_ITEM_ACTIVATED_CLASS] = "mdc-deprecated-list-item--activated", xe["" + T.LIST_ITEM_CLASS] = "mdc-deprecated-list-item", xe["" + T.LIST_ITEM_DISABLED_CLASS] = "mdc-deprecated-list-item--disabled", xe["" + T.LIST_ITEM_SELECTED_CLASS] = "mdc-deprecated-list-item--selected", xe["" + T.LIST_ITEM_TEXT_CLASS] = "mdc-deprecated-list-item__text", xe["" + T.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-deprecated-list-item__primary-text", xe["" + T.ROOT] = "mdc-deprecated-list", xe), G = {
|
|
1161
|
-
ACTION_EVENT: "MDCList:action",
|
|
1162
|
-
ARIA_CHECKED: "aria-checked",
|
|
1163
|
-
ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]',
|
|
1164
|
-
ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
|
|
1165
|
-
ARIA_CURRENT: "aria-current",
|
|
1166
|
-
ARIA_DISABLED: "aria-disabled",
|
|
1167
|
-
ARIA_ORIENTATION: "aria-orientation",
|
|
1168
|
-
ARIA_ORIENTATION_HORIZONTAL: "horizontal",
|
|
1169
|
-
ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]',
|
|
1170
|
-
ARIA_SELECTED: "aria-selected",
|
|
1171
|
-
ARIA_INTERACTIVE_ROLES_SELECTOR: '[role="listbox"], [role="menu"]',
|
|
1172
|
-
ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable="true"]',
|
|
1173
|
-
CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"], input[type="radio"]',
|
|
1174
|
-
CHECKBOX_SELECTOR: 'input[type="checkbox"]',
|
|
1175
|
-
CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: `
|
|
1176
|
-
.` + T.LIST_ITEM_CLASS + ` button:not(:disabled),
|
|
1177
|
-
.` + T.LIST_ITEM_CLASS + ` a,
|
|
1178
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` button:not(:disabled),
|
|
1179
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` a
|
|
1180
|
-
`,
|
|
1181
|
-
DEPRECATED_SELECTOR: ".mdc-deprecated-list",
|
|
1182
|
-
FOCUSABLE_CHILD_ELEMENTS: `
|
|
1183
|
-
.` + T.LIST_ITEM_CLASS + ` button:not(:disabled),
|
|
1184
|
-
.` + T.LIST_ITEM_CLASS + ` a,
|
|
1185
|
-
.` + T.LIST_ITEM_CLASS + ` input[type="radio"]:not(:disabled),
|
|
1186
|
-
.` + T.LIST_ITEM_CLASS + ` input[type="checkbox"]:not(:disabled),
|
|
1187
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` button:not(:disabled),
|
|
1188
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` a,
|
|
1189
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` input[type="radio"]:not(:disabled),
|
|
1190
|
-
.` + Pe[T.LIST_ITEM_CLASS] + ` input[type="checkbox"]:not(:disabled)
|
|
1191
|
-
`,
|
|
1192
|
-
RADIO_SELECTOR: 'input[type="radio"]',
|
|
1193
|
-
SELECTED_ITEM_SELECTOR: '[aria-selected="true"], [aria-current="true"]'
|
|
1194
|
-
}, ne = {
|
|
1195
|
-
UNSET_INDEX: -1,
|
|
1196
|
-
TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300
|
|
1197
|
-
}, nr = "evolution";
|
|
1198
|
-
/**
|
|
1199
|
-
* @license
|
|
1200
|
-
* Copyright 2020 Google Inc.
|
|
1201
|
-
*
|
|
1202
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1203
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1204
|
-
* in the Software without restriction, including without limitation the rights
|
|
1205
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1206
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1207
|
-
* furnished to do so, subject to the following conditions:
|
|
1208
|
-
*
|
|
1209
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1210
|
-
* all copies or substantial portions of the Software.
|
|
1211
|
-
*
|
|
1212
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1213
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1214
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1215
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1216
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1217
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1218
|
-
* THE SOFTWARE.
|
|
1219
|
-
*/
|
|
1220
|
-
var rr = ["input", "button", "textarea", "select"], we = function(i) {
|
|
1221
|
-
var n = i.target;
|
|
1222
|
-
if (n) {
|
|
1223
|
-
var e = ("" + n.tagName).toLowerCase();
|
|
1224
|
-
rr.indexOf(e) === -1 && i.preventDefault();
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
|
-
/**
|
|
1228
|
-
* @license
|
|
1229
|
-
* Copyright 2020 Google Inc.
|
|
1230
|
-
*
|
|
1231
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1232
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1233
|
-
* in the Software without restriction, including without limitation the rights
|
|
1234
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1235
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1236
|
-
* furnished to do so, subject to the following conditions:
|
|
1237
|
-
*
|
|
1238
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1239
|
-
* all copies or substantial portions of the Software.
|
|
1240
|
-
*
|
|
1241
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1242
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1243
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1244
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1245
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1246
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1247
|
-
* THE SOFTWARE.
|
|
1248
|
-
*/
|
|
1249
|
-
function ir() {
|
|
1250
|
-
var i = {
|
|
1251
|
-
bufferClearTimeout: 0,
|
|
1252
|
-
currentFirstChar: "",
|
|
1253
|
-
sortedIndexCursor: 0,
|
|
1254
|
-
typeaheadBuffer: ""
|
|
1255
|
-
};
|
|
1256
|
-
return i;
|
|
1257
|
-
}
|
|
1258
|
-
function or(i, n) {
|
|
1259
|
-
for (var e = /* @__PURE__ */ new Map(), t = 0; t < i; t++) {
|
|
1260
|
-
var r = n(t).trim();
|
|
1261
|
-
if (r) {
|
|
1262
|
-
var o = r[0].toLowerCase();
|
|
1263
|
-
e.has(o) || e.set(o, []), e.get(o).push({ text: r.toLowerCase(), index: t });
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
return e.forEach(function(a) {
|
|
1267
|
-
a.sort(function(l, u) {
|
|
1268
|
-
return l.index - u.index;
|
|
1269
|
-
});
|
|
1270
|
-
}), e;
|
|
1271
|
-
}
|
|
1272
|
-
function Lt(i, n) {
|
|
1273
|
-
var e = i.nextChar, t = i.focusItemAtIndex, r = i.sortedIndexByFirstChar, o = i.focusedItemIndex, a = i.skipFocus, l = i.isItemAtIndexDisabled;
|
|
1274
|
-
clearTimeout(n.bufferClearTimeout), n.bufferClearTimeout = setTimeout(function() {
|
|
1275
|
-
un(n);
|
|
1276
|
-
}, ne.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS), n.typeaheadBuffer = n.typeaheadBuffer + e;
|
|
1277
|
-
var u;
|
|
1278
|
-
return n.typeaheadBuffer.length === 1 ? u = sr(r, o, l, n) : u = ar(r, l, n), u !== -1 && !a && t(u), u;
|
|
1279
|
-
}
|
|
1280
|
-
function sr(i, n, e, t) {
|
|
1281
|
-
var r = t.typeaheadBuffer[0], o = i.get(r);
|
|
1282
|
-
if (!o)
|
|
1283
|
-
return -1;
|
|
1284
|
-
if (r === t.currentFirstChar && o[t.sortedIndexCursor].index === n) {
|
|
1285
|
-
t.sortedIndexCursor = (t.sortedIndexCursor + 1) % o.length;
|
|
1286
|
-
var a = o[t.sortedIndexCursor].index;
|
|
1287
|
-
if (!e(a))
|
|
1288
|
-
return a;
|
|
1289
|
-
}
|
|
1290
|
-
t.currentFirstChar = r;
|
|
1291
|
-
var l = -1, u;
|
|
1292
|
-
for (u = 0; u < o.length; u++)
|
|
1293
|
-
if (!e(o[u].index)) {
|
|
1294
|
-
l = u;
|
|
1295
|
-
break;
|
|
1296
|
-
}
|
|
1297
|
-
for (; u < o.length; u++)
|
|
1298
|
-
if (o[u].index > n && !e(o[u].index)) {
|
|
1299
|
-
l = u;
|
|
1300
|
-
break;
|
|
1301
|
-
}
|
|
1302
|
-
return l !== -1 ? (t.sortedIndexCursor = l, o[t.sortedIndexCursor].index) : -1;
|
|
1303
|
-
}
|
|
1304
|
-
function ar(i, n, e) {
|
|
1305
|
-
var t = e.typeaheadBuffer[0], r = i.get(t);
|
|
1306
|
-
if (!r)
|
|
1307
|
-
return -1;
|
|
1308
|
-
var o = r[e.sortedIndexCursor];
|
|
1309
|
-
if (o.text.lastIndexOf(e.typeaheadBuffer, 0) === 0 && !n(o.index))
|
|
1310
|
-
return o.index;
|
|
1311
|
-
for (var a = (e.sortedIndexCursor + 1) % r.length, l = -1; a !== e.sortedIndexCursor; ) {
|
|
1312
|
-
var u = r[a], y = u.text.lastIndexOf(e.typeaheadBuffer, 0) === 0, C = !n(u.index);
|
|
1313
|
-
if (y && C) {
|
|
1314
|
-
l = a;
|
|
1315
|
-
break;
|
|
1316
|
-
}
|
|
1317
|
-
a = (a + 1) % r.length;
|
|
1318
|
-
}
|
|
1319
|
-
return l !== -1 ? (e.sortedIndexCursor = l, r[e.sortedIndexCursor].index) : -1;
|
|
1320
|
-
}
|
|
1321
|
-
function dn(i) {
|
|
1322
|
-
return i.typeaheadBuffer.length > 0;
|
|
1323
|
-
}
|
|
1324
|
-
function un(i) {
|
|
1325
|
-
i.typeaheadBuffer = "";
|
|
1326
|
-
}
|
|
1327
|
-
function qt(i, n) {
|
|
1328
|
-
var e = i.event, t = i.isTargetListItem, r = i.focusedItemIndex, o = i.focusItemAtIndex, a = i.sortedIndexByFirstChar, l = i.isItemAtIndexDisabled, u = ae(e) === "ArrowLeft", y = ae(e) === "ArrowUp", C = ae(e) === "ArrowRight", m = ae(e) === "ArrowDown", E = ae(e) === "Home", d = ae(e) === "End", f = ae(e) === "Enter", A = ae(e) === "Spacebar";
|
|
1329
|
-
if (e.ctrlKey || e.metaKey || u || y || C || m || E || d || f)
|
|
1330
|
-
return -1;
|
|
1331
|
-
var v = !A && e.key.length === 1;
|
|
1332
|
-
if (v) {
|
|
1333
|
-
we(e);
|
|
1334
|
-
var p = {
|
|
1335
|
-
focusItemAtIndex: o,
|
|
1336
|
-
focusedItemIndex: r,
|
|
1337
|
-
nextChar: e.key.toLowerCase(),
|
|
1338
|
-
sortedIndexByFirstChar: a,
|
|
1339
|
-
skipFocus: !1,
|
|
1340
|
-
isItemAtIndexDisabled: l
|
|
1341
|
-
};
|
|
1342
|
-
return Lt(p, n);
|
|
1343
|
-
}
|
|
1344
|
-
if (!A)
|
|
1345
|
-
return -1;
|
|
1346
|
-
t && we(e);
|
|
1347
|
-
var h = t && dn(n);
|
|
1348
|
-
if (h) {
|
|
1349
|
-
var p = {
|
|
1350
|
-
focusItemAtIndex: o,
|
|
1351
|
-
focusedItemIndex: r,
|
|
1352
|
-
nextChar: " ",
|
|
1353
|
-
sortedIndexByFirstChar: a,
|
|
1354
|
-
skipFocus: !1,
|
|
1355
|
-
isItemAtIndexDisabled: l
|
|
1356
|
-
};
|
|
1357
|
-
return Lt(p, n);
|
|
1358
|
-
}
|
|
1359
|
-
return -1;
|
|
1360
|
-
}
|
|
1361
|
-
/**
|
|
1362
|
-
* @license
|
|
1363
|
-
* Copyright 2018 Google Inc.
|
|
1364
|
-
*
|
|
1365
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1366
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1367
|
-
* in the Software without restriction, including without limitation the rights
|
|
1368
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1369
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1370
|
-
* furnished to do so, subject to the following conditions:
|
|
1371
|
-
*
|
|
1372
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1373
|
-
* all copies or substantial portions of the Software.
|
|
1374
|
-
*
|
|
1375
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1376
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1377
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1378
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1379
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1380
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1381
|
-
* THE SOFTWARE.
|
|
1382
|
-
*/
|
|
1383
|
-
function lr(i) {
|
|
1384
|
-
return i instanceof Array;
|
|
1385
|
-
}
|
|
1386
|
-
var Nt = (
|
|
1387
|
-
/** @class */
|
|
1388
|
-
function(i) {
|
|
1389
|
-
Ee(n, i);
|
|
1390
|
-
function n(e) {
|
|
1391
|
-
var t = i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
1392
|
-
return t.wrapFocus_ = !1, t.isVertical_ = !0, t.isSingleSelectionList_ = !1, t.selectedIndex_ = ne.UNSET_INDEX, t.focusedItemIndex = ne.UNSET_INDEX, t.useActivatedClass_ = !1, t.useSelectedAttr_ = !1, t.ariaCurrentAttrValue_ = null, t.isCheckboxList_ = !1, t.isRadioList_ = !1, t.hasTypeahead = !1, t.typeaheadState = ir(), t.sortedIndexByFirstChar = /* @__PURE__ */ new Map(), t;
|
|
1393
|
-
}
|
|
1394
|
-
return Object.defineProperty(n, "strings", {
|
|
1395
|
-
get: function() {
|
|
1396
|
-
return G;
|
|
1397
|
-
},
|
|
1398
|
-
enumerable: !1,
|
|
1399
|
-
configurable: !0
|
|
1400
|
-
}), Object.defineProperty(n, "cssClasses", {
|
|
1401
|
-
get: function() {
|
|
1402
|
-
return T;
|
|
1403
|
-
},
|
|
1404
|
-
enumerable: !1,
|
|
1405
|
-
configurable: !0
|
|
1406
|
-
}), Object.defineProperty(n, "numbers", {
|
|
1407
|
-
get: function() {
|
|
1408
|
-
return ne;
|
|
1409
|
-
},
|
|
1410
|
-
enumerable: !1,
|
|
1411
|
-
configurable: !0
|
|
1412
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
1413
|
-
get: function() {
|
|
1414
|
-
return {
|
|
1415
|
-
addClassForElementIndex: function() {
|
|
1416
|
-
},
|
|
1417
|
-
focusItemAtIndex: function() {
|
|
1418
|
-
},
|
|
1419
|
-
getAttributeForElementIndex: function() {
|
|
1420
|
-
return null;
|
|
1421
|
-
},
|
|
1422
|
-
getFocusedElementIndex: function() {
|
|
1423
|
-
return 0;
|
|
1424
|
-
},
|
|
1425
|
-
getListItemCount: function() {
|
|
1426
|
-
return 0;
|
|
1427
|
-
},
|
|
1428
|
-
hasCheckboxAtIndex: function() {
|
|
1429
|
-
return !1;
|
|
1430
|
-
},
|
|
1431
|
-
hasRadioAtIndex: function() {
|
|
1432
|
-
return !1;
|
|
1433
|
-
},
|
|
1434
|
-
isCheckboxCheckedAtIndex: function() {
|
|
1435
|
-
return !1;
|
|
1436
|
-
},
|
|
1437
|
-
isFocusInsideList: function() {
|
|
1438
|
-
return !1;
|
|
1439
|
-
},
|
|
1440
|
-
isRootFocused: function() {
|
|
1441
|
-
return !1;
|
|
1442
|
-
},
|
|
1443
|
-
listItemAtIndexHasClass: function() {
|
|
1444
|
-
return !1;
|
|
1445
|
-
},
|
|
1446
|
-
notifyAction: function() {
|
|
1447
|
-
},
|
|
1448
|
-
removeClassForElementIndex: function() {
|
|
1449
|
-
},
|
|
1450
|
-
setAttributeForElementIndex: function() {
|
|
1451
|
-
},
|
|
1452
|
-
setCheckedCheckboxOrRadioAtIndex: function() {
|
|
1453
|
-
},
|
|
1454
|
-
setTabIndexForListItemChildren: function() {
|
|
1455
|
-
},
|
|
1456
|
-
getPrimaryTextAtIndex: function() {
|
|
1457
|
-
return "";
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
},
|
|
1461
|
-
enumerable: !1,
|
|
1462
|
-
configurable: !0
|
|
1463
|
-
}), n.prototype.layout = function() {
|
|
1464
|
-
this.adapter.getListItemCount() !== 0 && (this.adapter.hasCheckboxAtIndex(0) ? this.isCheckboxList_ = !0 : this.adapter.hasRadioAtIndex(0) ? this.isRadioList_ = !0 : this.maybeInitializeSingleSelection(), this.hasTypeahead && (this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex()));
|
|
1465
|
-
}, n.prototype.setWrapFocus = function(e) {
|
|
1466
|
-
this.wrapFocus_ = e;
|
|
1467
|
-
}, n.prototype.setVerticalOrientation = function(e) {
|
|
1468
|
-
this.isVertical_ = e;
|
|
1469
|
-
}, n.prototype.setSingleSelection = function(e) {
|
|
1470
|
-
this.isSingleSelectionList_ = e, e && this.maybeInitializeSingleSelection();
|
|
1471
|
-
}, n.prototype.maybeInitializeSingleSelection = function() {
|
|
1472
|
-
for (var e = this.adapter.getListItemCount(), t = 0; t < e; t++) {
|
|
1473
|
-
var r = this.adapter.listItemAtIndexHasClass(t, T.LIST_ITEM_SELECTED_CLASS), o = this.adapter.listItemAtIndexHasClass(t, T.LIST_ITEM_ACTIVATED_CLASS);
|
|
1474
|
-
if (r || o) {
|
|
1475
|
-
o && this.setUseActivatedClass(!0), this.isSingleSelectionList_ = !0, this.selectedIndex_ = t;
|
|
1476
|
-
return;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
}, n.prototype.setHasTypeahead = function(e) {
|
|
1480
|
-
this.hasTypeahead = e, e && (this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex());
|
|
1481
|
-
}, n.prototype.isTypeaheadInProgress = function() {
|
|
1482
|
-
return this.hasTypeahead && dn(this.typeaheadState);
|
|
1483
|
-
}, n.prototype.setUseActivatedClass = function(e) {
|
|
1484
|
-
this.useActivatedClass_ = e;
|
|
1485
|
-
}, n.prototype.setUseSelectedAttribute = function(e) {
|
|
1486
|
-
this.useSelectedAttr_ = e;
|
|
1487
|
-
}, n.prototype.getSelectedIndex = function() {
|
|
1488
|
-
return this.selectedIndex_;
|
|
1489
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
1490
|
-
this.isIndexValid_(e) && (this.isCheckboxList_ ? this.setCheckboxAtIndex_(e) : this.isRadioList_ ? this.setRadioAtIndex_(e) : this.setSingleSelectionAtIndex_(e));
|
|
1491
|
-
}, n.prototype.handleFocusIn = function(e, t) {
|
|
1492
|
-
t >= 0 && (this.focusedItemIndex = t, this.adapter.setAttributeForElementIndex(t, "tabindex", "0"), this.adapter.setTabIndexForListItemChildren(t, "0"));
|
|
1493
|
-
}, n.prototype.handleFocusOut = function(e, t) {
|
|
1494
|
-
var r = this;
|
|
1495
|
-
t >= 0 && (this.adapter.setAttributeForElementIndex(t, "tabindex", "-1"), this.adapter.setTabIndexForListItemChildren(t, "-1")), setTimeout(function() {
|
|
1496
|
-
r.adapter.isFocusInsideList() || r.setTabindexToFirstSelectedOrFocusedItem();
|
|
1497
|
-
}, 0);
|
|
1498
|
-
}, n.prototype.handleKeydown = function(e, t, r) {
|
|
1499
|
-
var o = this, a = ae(e) === "ArrowLeft", l = ae(e) === "ArrowUp", u = ae(e) === "ArrowRight", y = ae(e) === "ArrowDown", C = ae(e) === "Home", m = ae(e) === "End", E = ae(e) === "Enter", d = ae(e) === "Spacebar", f = e.key === "A" || e.key === "a";
|
|
1500
|
-
if (this.adapter.isRootFocused()) {
|
|
1501
|
-
if (l || m ? (e.preventDefault(), this.focusLastElement()) : (y || C) && (e.preventDefault(), this.focusFirstElement()), this.hasTypeahead) {
|
|
1502
|
-
var A = {
|
|
1503
|
-
event: e,
|
|
1504
|
-
focusItemAtIndex: function(h) {
|
|
1505
|
-
o.focusItemAtIndex(h);
|
|
1506
|
-
},
|
|
1507
|
-
focusedItemIndex: -1,
|
|
1508
|
-
isTargetListItem: t,
|
|
1509
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
1510
|
-
isItemAtIndexDisabled: function(h) {
|
|
1511
|
-
return o.adapter.listItemAtIndexHasClass(h, T.LIST_ITEM_DISABLED_CLASS);
|
|
1512
|
-
}
|
|
1513
|
-
};
|
|
1514
|
-
qt(A, this.typeaheadState);
|
|
1515
|
-
}
|
|
1516
|
-
return;
|
|
1517
|
-
}
|
|
1518
|
-
var v = this.adapter.getFocusedElementIndex();
|
|
1519
|
-
if (!(v === -1 && (v = r, v < 0))) {
|
|
1520
|
-
if (this.isVertical_ && y || !this.isVertical_ && u)
|
|
1521
|
-
we(e), this.focusNextElement(v);
|
|
1522
|
-
else if (this.isVertical_ && l || !this.isVertical_ && a)
|
|
1523
|
-
we(e), this.focusPrevElement(v);
|
|
1524
|
-
else if (C)
|
|
1525
|
-
we(e), this.focusFirstElement();
|
|
1526
|
-
else if (m)
|
|
1527
|
-
we(e), this.focusLastElement();
|
|
1528
|
-
else if (f && e.ctrlKey && this.isCheckboxList_)
|
|
1529
|
-
e.preventDefault(), this.toggleAll(this.selectedIndex_ === ne.UNSET_INDEX ? [] : this.selectedIndex_);
|
|
1530
|
-
else if ((E || d) && t) {
|
|
1531
|
-
var p = e.target;
|
|
1532
|
-
if (p && p.tagName === "A" && E || (we(e), this.adapter.listItemAtIndexHasClass(v, T.LIST_ITEM_DISABLED_CLASS)))
|
|
1533
|
-
return;
|
|
1534
|
-
this.isTypeaheadInProgress() || (this.isSelectableList_() && this.setSelectedIndexOnAction_(v), this.adapter.notifyAction(v));
|
|
1535
|
-
}
|
|
1536
|
-
if (this.hasTypeahead) {
|
|
1537
|
-
var A = {
|
|
1538
|
-
event: e,
|
|
1539
|
-
focusItemAtIndex: function(g) {
|
|
1540
|
-
o.focusItemAtIndex(g);
|
|
1541
|
-
},
|
|
1542
|
-
focusedItemIndex: this.focusedItemIndex,
|
|
1543
|
-
isTargetListItem: t,
|
|
1544
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
1545
|
-
isItemAtIndexDisabled: function(g) {
|
|
1546
|
-
return o.adapter.listItemAtIndexHasClass(g, T.LIST_ITEM_DISABLED_CLASS);
|
|
1547
|
-
}
|
|
1548
|
-
};
|
|
1549
|
-
qt(A, this.typeaheadState);
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
}, n.prototype.handleClick = function(e, t) {
|
|
1553
|
-
e !== ne.UNSET_INDEX && (this.adapter.listItemAtIndexHasClass(e, T.LIST_ITEM_DISABLED_CLASS) || (this.isSelectableList_() && this.setSelectedIndexOnAction_(e, t), this.adapter.notifyAction(e)));
|
|
1554
|
-
}, n.prototype.focusNextElement = function(e) {
|
|
1555
|
-
var t = this.adapter.getListItemCount(), r = e + 1;
|
|
1556
|
-
if (r >= t)
|
|
1557
|
-
if (this.wrapFocus_)
|
|
1558
|
-
r = 0;
|
|
1559
|
-
else
|
|
1560
|
-
return e;
|
|
1561
|
-
return this.focusItemAtIndex(r), r;
|
|
1562
|
-
}, n.prototype.focusPrevElement = function(e) {
|
|
1563
|
-
var t = e - 1;
|
|
1564
|
-
if (t < 0)
|
|
1565
|
-
if (this.wrapFocus_)
|
|
1566
|
-
t = this.adapter.getListItemCount() - 1;
|
|
1567
|
-
else
|
|
1568
|
-
return e;
|
|
1569
|
-
return this.focusItemAtIndex(t), t;
|
|
1570
|
-
}, n.prototype.focusFirstElement = function() {
|
|
1571
|
-
return this.focusItemAtIndex(0), 0;
|
|
1572
|
-
}, n.prototype.focusLastElement = function() {
|
|
1573
|
-
var e = this.adapter.getListItemCount() - 1;
|
|
1574
|
-
return this.focusItemAtIndex(e), e;
|
|
1575
|
-
}, n.prototype.focusInitialElement = function() {
|
|
1576
|
-
var e = this.getFirstSelectedOrFocusedItemIndex();
|
|
1577
|
-
return this.focusItemAtIndex(e), e;
|
|
1578
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
1579
|
-
this.isIndexValid_(e) && (t ? (this.adapter.removeClassForElementIndex(e, T.LIST_ITEM_DISABLED_CLASS), this.adapter.setAttributeForElementIndex(e, G.ARIA_DISABLED, "false")) : (this.adapter.addClassForElementIndex(e, T.LIST_ITEM_DISABLED_CLASS), this.adapter.setAttributeForElementIndex(e, G.ARIA_DISABLED, "true")));
|
|
1580
|
-
}, n.prototype.setSingleSelectionAtIndex_ = function(e) {
|
|
1581
|
-
if (this.selectedIndex_ !== e) {
|
|
1582
|
-
var t = T.LIST_ITEM_SELECTED_CLASS;
|
|
1583
|
-
this.useActivatedClass_ && (t = T.LIST_ITEM_ACTIVATED_CLASS), this.selectedIndex_ !== ne.UNSET_INDEX && this.adapter.removeClassForElementIndex(this.selectedIndex_, t), this.setAriaForSingleSelectionAtIndex_(e), this.setTabindexAtIndex(e), e !== ne.UNSET_INDEX && this.adapter.addClassForElementIndex(e, t), this.selectedIndex_ = e;
|
|
1584
|
-
}
|
|
1585
|
-
}, n.prototype.setAriaForSingleSelectionAtIndex_ = function(e) {
|
|
1586
|
-
this.selectedIndex_ === ne.UNSET_INDEX && (this.ariaCurrentAttrValue_ = this.adapter.getAttributeForElementIndex(e, G.ARIA_CURRENT));
|
|
1587
|
-
var t = this.ariaCurrentAttrValue_ !== null, r = t ? G.ARIA_CURRENT : G.ARIA_SELECTED;
|
|
1588
|
-
if (this.selectedIndex_ !== ne.UNSET_INDEX && this.adapter.setAttributeForElementIndex(this.selectedIndex_, r, "false"), e !== ne.UNSET_INDEX) {
|
|
1589
|
-
var o = t ? this.ariaCurrentAttrValue_ : "true";
|
|
1590
|
-
this.adapter.setAttributeForElementIndex(e, r, o);
|
|
1591
|
-
}
|
|
1592
|
-
}, n.prototype.getSelectionAttribute = function() {
|
|
1593
|
-
return this.useSelectedAttr_ ? G.ARIA_SELECTED : G.ARIA_CHECKED;
|
|
1594
|
-
}, n.prototype.setRadioAtIndex_ = function(e) {
|
|
1595
|
-
var t = this.getSelectionAttribute();
|
|
1596
|
-
this.adapter.setCheckedCheckboxOrRadioAtIndex(e, !0), this.selectedIndex_ !== ne.UNSET_INDEX && this.adapter.setAttributeForElementIndex(this.selectedIndex_, t, "false"), this.adapter.setAttributeForElementIndex(e, t, "true"), this.selectedIndex_ = e;
|
|
1597
|
-
}, n.prototype.setCheckboxAtIndex_ = function(e) {
|
|
1598
|
-
for (var t = this.getSelectionAttribute(), r = 0; r < this.adapter.getListItemCount(); r++) {
|
|
1599
|
-
var o = !1;
|
|
1600
|
-
e.indexOf(r) >= 0 && (o = !0), this.adapter.setCheckedCheckboxOrRadioAtIndex(r, o), this.adapter.setAttributeForElementIndex(r, t, o ? "true" : "false");
|
|
1601
|
-
}
|
|
1602
|
-
this.selectedIndex_ = e;
|
|
1603
|
-
}, n.prototype.setTabindexAtIndex = function(e) {
|
|
1604
|
-
this.focusedItemIndex === ne.UNSET_INDEX && e !== 0 ? this.adapter.setAttributeForElementIndex(0, "tabindex", "-1") : this.focusedItemIndex >= 0 && this.focusedItemIndex !== e && this.adapter.setAttributeForElementIndex(this.focusedItemIndex, "tabindex", "-1"), !(this.selectedIndex_ instanceof Array) && this.selectedIndex_ !== e && this.adapter.setAttributeForElementIndex(this.selectedIndex_, "tabindex", "-1"), e !== ne.UNSET_INDEX && this.adapter.setAttributeForElementIndex(e, "tabindex", "0");
|
|
1605
|
-
}, n.prototype.isSelectableList_ = function() {
|
|
1606
|
-
return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
|
|
1607
|
-
}, n.prototype.setTabindexToFirstSelectedOrFocusedItem = function() {
|
|
1608
|
-
var e = this.getFirstSelectedOrFocusedItemIndex();
|
|
1609
|
-
this.setTabindexAtIndex(e);
|
|
1610
|
-
}, n.prototype.getFirstSelectedOrFocusedItemIndex = function() {
|
|
1611
|
-
var e = this.focusedItemIndex >= 0 ? this.focusedItemIndex : 0;
|
|
1612
|
-
return this.isSelectableList_() && (typeof this.selectedIndex_ == "number" && this.selectedIndex_ !== ne.UNSET_INDEX ? e = this.selectedIndex_ : lr(this.selectedIndex_) && this.selectedIndex_.length > 0 && (e = this.selectedIndex_.reduce(function(t, r) {
|
|
1613
|
-
return Math.min(t, r);
|
|
1614
|
-
}))), e;
|
|
1615
|
-
}, n.prototype.isIndexValid_ = function(e) {
|
|
1616
|
-
var t = this;
|
|
1617
|
-
if (e instanceof Array) {
|
|
1618
|
-
if (!this.isCheckboxList_)
|
|
1619
|
-
throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");
|
|
1620
|
-
return e.length === 0 ? !0 : e.some(function(r) {
|
|
1621
|
-
return t.isIndexInRange_(r);
|
|
1622
|
-
});
|
|
1623
|
-
} else if (typeof e == "number") {
|
|
1624
|
-
if (this.isCheckboxList_)
|
|
1625
|
-
throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: " + e);
|
|
1626
|
-
return this.isIndexInRange_(e) || this.isSingleSelectionList_ && e === ne.UNSET_INDEX;
|
|
1627
|
-
} else
|
|
1628
|
-
return !1;
|
|
1629
|
-
}, n.prototype.isIndexInRange_ = function(e) {
|
|
1630
|
-
var t = this.adapter.getListItemCount();
|
|
1631
|
-
return e >= 0 && e < t;
|
|
1632
|
-
}, n.prototype.setSelectedIndexOnAction_ = function(e, t) {
|
|
1633
|
-
t === void 0 && (t = !0), this.isCheckboxList_ ? this.toggleCheckboxAtIndex_(e, t) : this.setSelectedIndex(e);
|
|
1634
|
-
}, n.prototype.toggleCheckboxAtIndex_ = function(e, t) {
|
|
1635
|
-
var r = this.getSelectionAttribute(), o = this.adapter.isCheckboxCheckedAtIndex(e);
|
|
1636
|
-
t && (o = !o, this.adapter.setCheckedCheckboxOrRadioAtIndex(e, o)), this.adapter.setAttributeForElementIndex(e, r, o ? "true" : "false");
|
|
1637
|
-
var a = this.selectedIndex_ === ne.UNSET_INDEX ? [] : this.selectedIndex_.slice();
|
|
1638
|
-
o ? a.push(e) : a = a.filter(function(l) {
|
|
1639
|
-
return l !== e;
|
|
1640
|
-
}), this.selectedIndex_ = a;
|
|
1641
|
-
}, n.prototype.focusItemAtIndex = function(e) {
|
|
1642
|
-
this.adapter.focusItemAtIndex(e), this.focusedItemIndex = e;
|
|
1643
|
-
}, n.prototype.toggleAll = function(e) {
|
|
1644
|
-
var t = this.adapter.getListItemCount();
|
|
1645
|
-
if (e.length === t)
|
|
1646
|
-
this.setCheckboxAtIndex_([]);
|
|
1647
|
-
else {
|
|
1648
|
-
for (var r = [], o = 0; o < t; o++)
|
|
1649
|
-
(!this.adapter.listItemAtIndexHasClass(o, T.LIST_ITEM_DISABLED_CLASS) || e.indexOf(o) > -1) && r.push(o);
|
|
1650
|
-
this.setCheckboxAtIndex_(r);
|
|
1651
|
-
}
|
|
1652
|
-
}, n.prototype.typeaheadMatchItem = function(e, t, r) {
|
|
1653
|
-
var o = this;
|
|
1654
|
-
r === void 0 && (r = !1);
|
|
1655
|
-
var a = {
|
|
1656
|
-
focusItemAtIndex: function(l) {
|
|
1657
|
-
o.focusItemAtIndex(l);
|
|
1658
|
-
},
|
|
1659
|
-
focusedItemIndex: t || this.focusedItemIndex,
|
|
1660
|
-
nextChar: e,
|
|
1661
|
-
sortedIndexByFirstChar: this.sortedIndexByFirstChar,
|
|
1662
|
-
skipFocus: r,
|
|
1663
|
-
isItemAtIndexDisabled: function(l) {
|
|
1664
|
-
return o.adapter.listItemAtIndexHasClass(l, T.LIST_ITEM_DISABLED_CLASS);
|
|
1665
|
-
}
|
|
1666
|
-
};
|
|
1667
|
-
return Lt(a, this.typeaheadState);
|
|
1668
|
-
}, n.prototype.typeaheadInitSortedIndex = function() {
|
|
1669
|
-
return or(this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);
|
|
1670
|
-
}, n.prototype.clearTypeaheadBuffer = function() {
|
|
1671
|
-
un(this.typeaheadState);
|
|
1672
|
-
}, n;
|
|
1673
|
-
}(He)
|
|
1674
|
-
);
|
|
1675
|
-
/**
|
|
1676
|
-
* @license
|
|
1677
|
-
* Copyright 2018 Google Inc.
|
|
1678
|
-
*
|
|
1679
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1680
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1681
|
-
* in the Software without restriction, including without limitation the rights
|
|
1682
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1683
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1684
|
-
* furnished to do so, subject to the following conditions:
|
|
1685
|
-
*
|
|
1686
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1687
|
-
* all copies or substantial portions of the Software.
|
|
1688
|
-
*
|
|
1689
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1690
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1691
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1692
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1693
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1694
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1695
|
-
* THE SOFTWARE.
|
|
1696
|
-
*/
|
|
1697
|
-
var fn = (
|
|
1698
|
-
/** @class */
|
|
1699
|
-
function(i) {
|
|
1700
|
-
Ee(n, i);
|
|
1701
|
-
function n() {
|
|
1702
|
-
return i !== null && i.apply(this, arguments) || this;
|
|
1703
|
-
}
|
|
1704
|
-
return Object.defineProperty(n.prototype, "vertical", {
|
|
1705
|
-
set: function(e) {
|
|
1706
|
-
this.foundation.setVerticalOrientation(e);
|
|
1707
|
-
},
|
|
1708
|
-
enumerable: !1,
|
|
1709
|
-
configurable: !0
|
|
1710
|
-
}), Object.defineProperty(n.prototype, "listElements", {
|
|
1711
|
-
get: function() {
|
|
1712
|
-
return Array.from(this.root.querySelectorAll("." + this.classNameMap[T.LIST_ITEM_CLASS]));
|
|
1713
|
-
},
|
|
1714
|
-
enumerable: !1,
|
|
1715
|
-
configurable: !0
|
|
1716
|
-
}), Object.defineProperty(n.prototype, "wrapFocus", {
|
|
1717
|
-
set: function(e) {
|
|
1718
|
-
this.foundation.setWrapFocus(e);
|
|
1719
|
-
},
|
|
1720
|
-
enumerable: !1,
|
|
1721
|
-
configurable: !0
|
|
1722
|
-
}), Object.defineProperty(n.prototype, "typeaheadInProgress", {
|
|
1723
|
-
/**
|
|
1724
|
-
* @return Whether typeahead is currently matching a user-specified prefix.
|
|
1725
|
-
*/
|
|
1726
|
-
get: function() {
|
|
1727
|
-
return this.foundation.isTypeaheadInProgress();
|
|
1728
|
-
},
|
|
1729
|
-
enumerable: !1,
|
|
1730
|
-
configurable: !0
|
|
1731
|
-
}), Object.defineProperty(n.prototype, "hasTypeahead", {
|
|
1732
|
-
/**
|
|
1733
|
-
* Sets whether typeahead functionality is enabled on the list.
|
|
1734
|
-
* @param hasTypeahead Whether typeahead is enabled.
|
|
1735
|
-
*/
|
|
1736
|
-
set: function(e) {
|
|
1737
|
-
this.foundation.setHasTypeahead(e);
|
|
1738
|
-
},
|
|
1739
|
-
enumerable: !1,
|
|
1740
|
-
configurable: !0
|
|
1741
|
-
}), Object.defineProperty(n.prototype, "singleSelection", {
|
|
1742
|
-
set: function(e) {
|
|
1743
|
-
this.foundation.setSingleSelection(e);
|
|
1744
|
-
},
|
|
1745
|
-
enumerable: !1,
|
|
1746
|
-
configurable: !0
|
|
1747
|
-
}), Object.defineProperty(n.prototype, "selectedIndex", {
|
|
1748
|
-
get: function() {
|
|
1749
|
-
return this.foundation.getSelectedIndex();
|
|
1750
|
-
},
|
|
1751
|
-
set: function(e) {
|
|
1752
|
-
this.foundation.setSelectedIndex(e);
|
|
1753
|
-
},
|
|
1754
|
-
enumerable: !1,
|
|
1755
|
-
configurable: !0
|
|
1756
|
-
}), n.attachTo = function(e) {
|
|
1757
|
-
return new n(e);
|
|
1758
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
1759
|
-
this.isEvolutionEnabled = nr in this.root.dataset, this.isEvolutionEnabled ? this.classNameMap = tr : ke(this.root, G.DEPRECATED_SELECTOR) ? this.classNameMap = Pe : this.classNameMap = Object.values(T).reduce(function(e, t) {
|
|
1760
|
-
return e[t] = t, e;
|
|
1761
|
-
}, {}), this.handleClick = this.handleClickEvent.bind(this), this.handleKeydown = this.handleKeydownEvent.bind(this), this.focusInEventListener = this.handleFocusInEvent.bind(this), this.focusOutEventListener = this.handleFocusOutEvent.bind(this), this.listen("keydown", this.handleKeydown), this.listen("click", this.handleClick), this.listen("focusin", this.focusInEventListener), this.listen("focusout", this.focusOutEventListener), this.layout(), this.initializeListType(), this.ensureFocusable();
|
|
1762
|
-
}, n.prototype.destroy = function() {
|
|
1763
|
-
this.unlisten("keydown", this.handleKeydown), this.unlisten("click", this.handleClick), this.unlisten("focusin", this.focusInEventListener), this.unlisten("focusout", this.focusOutEventListener);
|
|
1764
|
-
}, n.prototype.layout = function() {
|
|
1765
|
-
var e = this.root.getAttribute(G.ARIA_ORIENTATION);
|
|
1766
|
-
this.vertical = e !== G.ARIA_ORIENTATION_HORIZONTAL;
|
|
1767
|
-
var t = "." + this.classNameMap[T.LIST_ITEM_CLASS] + ":not([tabindex])", r = G.FOCUSABLE_CHILD_ELEMENTS, o = this.root.querySelectorAll(t);
|
|
1768
|
-
o.length && Array.prototype.forEach.call(o, function(l) {
|
|
1769
|
-
l.setAttribute("tabindex", "-1");
|
|
1770
|
-
});
|
|
1771
|
-
var a = this.root.querySelectorAll(r);
|
|
1772
|
-
a.length && Array.prototype.forEach.call(a, function(l) {
|
|
1773
|
-
l.setAttribute("tabindex", "-1");
|
|
1774
|
-
}), this.isEvolutionEnabled && this.foundation.setUseSelectedAttribute(!0), this.foundation.layout();
|
|
1775
|
-
}, n.prototype.getPrimaryText = function(e) {
|
|
1776
|
-
var t, r = e.querySelector("." + this.classNameMap[T.LIST_ITEM_PRIMARY_TEXT_CLASS]);
|
|
1777
|
-
if (this.isEvolutionEnabled || r)
|
|
1778
|
-
return (t = r?.textContent) !== null && t !== void 0 ? t : "";
|
|
1779
|
-
var o = e.querySelector("." + this.classNameMap[T.LIST_ITEM_TEXT_CLASS]);
|
|
1780
|
-
return o && o.textContent || "";
|
|
1781
|
-
}, n.prototype.initializeListType = function() {
|
|
1782
|
-
var e = this;
|
|
1783
|
-
if (this.isInteractive = ke(this.root, G.ARIA_INTERACTIVE_ROLES_SELECTOR), this.isEvolutionEnabled && this.isInteractive) {
|
|
1784
|
-
var t = Array.from(this.root.querySelectorAll(G.SELECTED_ITEM_SELECTOR), function(l) {
|
|
1785
|
-
return e.listElements.indexOf(l);
|
|
1786
|
-
});
|
|
1787
|
-
ke(this.root, G.ARIA_MULTI_SELECTABLE_SELECTOR) ? this.selectedIndex = t : t.length > 0 && (this.selectedIndex = t[0]);
|
|
1788
|
-
return;
|
|
1789
|
-
}
|
|
1790
|
-
var r = this.root.querySelectorAll(G.ARIA_ROLE_CHECKBOX_SELECTOR), o = this.root.querySelector(G.ARIA_CHECKED_RADIO_SELECTOR);
|
|
1791
|
-
if (r.length) {
|
|
1792
|
-
var a = this.root.querySelectorAll(G.ARIA_CHECKED_CHECKBOX_SELECTOR);
|
|
1793
|
-
this.selectedIndex = Array.from(a, function(l) {
|
|
1794
|
-
return e.listElements.indexOf(l);
|
|
1795
|
-
});
|
|
1796
|
-
} else
|
|
1797
|
-
o && (this.selectedIndex = this.listElements.indexOf(o));
|
|
1798
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
1799
|
-
this.foundation.setEnabled(e, t);
|
|
1800
|
-
}, n.prototype.typeaheadMatchItem = function(e, t) {
|
|
1801
|
-
return this.foundation.typeaheadMatchItem(
|
|
1802
|
-
e,
|
|
1803
|
-
t,
|
|
1804
|
-
/** skipFocus */
|
|
1805
|
-
!0
|
|
1806
|
-
);
|
|
1807
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
1808
|
-
var e = this, t = {
|
|
1809
|
-
addClassForElementIndex: function(r, o) {
|
|
1810
|
-
var a = e.listElements[r];
|
|
1811
|
-
a && a.classList.add(e.classNameMap[o]);
|
|
1812
|
-
},
|
|
1813
|
-
focusItemAtIndex: function(r) {
|
|
1814
|
-
var o = e.listElements[r];
|
|
1815
|
-
o && o.focus();
|
|
1816
|
-
},
|
|
1817
|
-
getAttributeForElementIndex: function(r, o) {
|
|
1818
|
-
return e.listElements[r].getAttribute(o);
|
|
1819
|
-
},
|
|
1820
|
-
getFocusedElementIndex: function() {
|
|
1821
|
-
return e.listElements.indexOf(document.activeElement);
|
|
1822
|
-
},
|
|
1823
|
-
getListItemCount: function() {
|
|
1824
|
-
return e.listElements.length;
|
|
1825
|
-
},
|
|
1826
|
-
getPrimaryTextAtIndex: function(r) {
|
|
1827
|
-
return e.getPrimaryText(e.listElements[r]);
|
|
1828
|
-
},
|
|
1829
|
-
hasCheckboxAtIndex: function(r) {
|
|
1830
|
-
var o = e.listElements[r];
|
|
1831
|
-
return !!o.querySelector(G.CHECKBOX_SELECTOR);
|
|
1832
|
-
},
|
|
1833
|
-
hasRadioAtIndex: function(r) {
|
|
1834
|
-
var o = e.listElements[r];
|
|
1835
|
-
return !!o.querySelector(G.RADIO_SELECTOR);
|
|
1836
|
-
},
|
|
1837
|
-
isCheckboxCheckedAtIndex: function(r) {
|
|
1838
|
-
var o = e.listElements[r], a = o.querySelector(G.CHECKBOX_SELECTOR);
|
|
1839
|
-
return a.checked;
|
|
1840
|
-
},
|
|
1841
|
-
isFocusInsideList: function() {
|
|
1842
|
-
return e.root !== document.activeElement && e.root.contains(document.activeElement);
|
|
1843
|
-
},
|
|
1844
|
-
isRootFocused: function() {
|
|
1845
|
-
return document.activeElement === e.root;
|
|
1846
|
-
},
|
|
1847
|
-
listItemAtIndexHasClass: function(r, o) {
|
|
1848
|
-
return e.listElements[r].classList.contains(e.classNameMap[o]);
|
|
1849
|
-
},
|
|
1850
|
-
notifyAction: function(r) {
|
|
1851
|
-
e.emit(
|
|
1852
|
-
G.ACTION_EVENT,
|
|
1853
|
-
{ index: r },
|
|
1854
|
-
/** shouldBubble */
|
|
1855
|
-
!0
|
|
1856
|
-
);
|
|
1857
|
-
},
|
|
1858
|
-
removeClassForElementIndex: function(r, o) {
|
|
1859
|
-
var a = e.listElements[r];
|
|
1860
|
-
a && a.classList.remove(e.classNameMap[o]);
|
|
1861
|
-
},
|
|
1862
|
-
setAttributeForElementIndex: function(r, o, a) {
|
|
1863
|
-
var l = e.listElements[r];
|
|
1864
|
-
l && l.setAttribute(o, a);
|
|
1865
|
-
},
|
|
1866
|
-
setCheckedCheckboxOrRadioAtIndex: function(r, o) {
|
|
1867
|
-
var a = e.listElements[r], l = a.querySelector(G.CHECKBOX_RADIO_SELECTOR);
|
|
1868
|
-
l.checked = o;
|
|
1869
|
-
var u = document.createEvent("Event");
|
|
1870
|
-
u.initEvent("change", !0, !0), l.dispatchEvent(u);
|
|
1871
|
-
},
|
|
1872
|
-
setTabIndexForListItemChildren: function(r, o) {
|
|
1873
|
-
var a = e.listElements[r], l = G.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;
|
|
1874
|
-
Array.prototype.forEach.call(a.querySelectorAll(l), function(u) {
|
|
1875
|
-
u.setAttribute("tabindex", o);
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
return new Nt(t);
|
|
1880
|
-
}, n.prototype.ensureFocusable = function() {
|
|
1881
|
-
if (this.isEvolutionEnabled && this.isInteractive && !this.root.querySelector("." + this.classNameMap[T.LIST_ITEM_CLASS] + '[tabindex="0"]')) {
|
|
1882
|
-
var e = this.initialFocusIndex();
|
|
1883
|
-
e !== -1 && (this.listElements[e].tabIndex = 0);
|
|
1884
|
-
}
|
|
1885
|
-
}, n.prototype.initialFocusIndex = function() {
|
|
1886
|
-
if (this.selectedIndex instanceof Array && this.selectedIndex.length > 0)
|
|
1887
|
-
return this.selectedIndex[0];
|
|
1888
|
-
if (typeof this.selectedIndex == "number" && this.selectedIndex !== ne.UNSET_INDEX)
|
|
1889
|
-
return this.selectedIndex;
|
|
1890
|
-
var e = this.root.querySelector("." + this.classNameMap[T.LIST_ITEM_CLASS] + ":not(." + this.classNameMap[T.LIST_ITEM_DISABLED_CLASS] + ")");
|
|
1891
|
-
return e === null ? -1 : this.getListItemIndex(e);
|
|
1892
|
-
}, n.prototype.getListItemIndex = function(e) {
|
|
1893
|
-
var t = Ot(e, "." + this.classNameMap[T.LIST_ITEM_CLASS] + ", ." + this.classNameMap[T.ROOT]);
|
|
1894
|
-
return t && ke(t, "." + this.classNameMap[T.LIST_ITEM_CLASS]) ? this.listElements.indexOf(t) : -1;
|
|
1895
|
-
}, n.prototype.handleFocusInEvent = function(e) {
|
|
1896
|
-
var t = this.getListItemIndex(e.target);
|
|
1897
|
-
this.foundation.handleFocusIn(e, t);
|
|
1898
|
-
}, n.prototype.handleFocusOutEvent = function(e) {
|
|
1899
|
-
var t = this.getListItemIndex(e.target);
|
|
1900
|
-
this.foundation.handleFocusOut(e, t);
|
|
1901
|
-
}, n.prototype.handleKeydownEvent = function(e) {
|
|
1902
|
-
var t = this.getListItemIndex(e.target), r = e.target;
|
|
1903
|
-
this.foundation.handleKeydown(e, r.classList.contains(this.classNameMap[T.LIST_ITEM_CLASS]), t);
|
|
1904
|
-
}, n.prototype.handleClickEvent = function(e) {
|
|
1905
|
-
var t = this.getListItemIndex(e.target), r = e.target, o = !ke(r, G.CHECKBOX_RADIO_SELECTOR);
|
|
1906
|
-
this.foundation.handleClick(t, o);
|
|
1907
|
-
}, n;
|
|
1908
|
-
}(Ke)
|
|
1909
|
-
);
|
|
1910
|
-
/**
|
|
1911
|
-
* @license
|
|
1912
|
-
* Copyright 2018 Google Inc.
|
|
1913
|
-
*
|
|
1914
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1915
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
1916
|
-
* in the Software without restriction, including without limitation the rights
|
|
1917
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1918
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
1919
|
-
* furnished to do so, subject to the following conditions:
|
|
1920
|
-
*
|
|
1921
|
-
* The above copyright notice and this permission notice shall be included in
|
|
1922
|
-
* all copies or substantial portions of the Software.
|
|
1923
|
-
*
|
|
1924
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1925
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1926
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1927
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1928
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1929
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1930
|
-
* THE SOFTWARE.
|
|
1931
|
-
*/
|
|
1932
|
-
var Be = (
|
|
1933
|
-
/** @class */
|
|
1934
|
-
function(i) {
|
|
1935
|
-
Ee(n, i);
|
|
1936
|
-
function n(e) {
|
|
1937
|
-
var t = i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
1938
|
-
return t.isSurfaceOpen = !1, t.isQuickOpen = !1, t.isHoistedElement = !1, t.isFixedPosition = !1, t.isHorizontallyCenteredOnViewport = !1, t.maxHeight = 0, t.openAnimationEndTimerId = 0, t.closeAnimationEndTimerId = 0, t.animationRequestId = 0, t.anchorCorner = Ge.TOP_START, t.originCorner = Ge.TOP_START, t.anchorMargin = { top: 0, right: 0, bottom: 0, left: 0 }, t.position = { x: 0, y: 0 }, t;
|
|
1939
|
-
}
|
|
1940
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
1941
|
-
get: function() {
|
|
1942
|
-
return Ze;
|
|
1943
|
-
},
|
|
1944
|
-
enumerable: !1,
|
|
1945
|
-
configurable: !0
|
|
1946
|
-
}), Object.defineProperty(n, "strings", {
|
|
1947
|
-
get: function() {
|
|
1948
|
-
return Je;
|
|
1949
|
-
},
|
|
1950
|
-
enumerable: !1,
|
|
1951
|
-
configurable: !0
|
|
1952
|
-
}), Object.defineProperty(n, "numbers", {
|
|
1953
|
-
get: function() {
|
|
1954
|
-
return ot;
|
|
1955
|
-
},
|
|
1956
|
-
enumerable: !1,
|
|
1957
|
-
configurable: !0
|
|
1958
|
-
}), Object.defineProperty(n, "Corner", {
|
|
1959
|
-
get: function() {
|
|
1960
|
-
return Ge;
|
|
1961
|
-
},
|
|
1962
|
-
enumerable: !1,
|
|
1963
|
-
configurable: !0
|
|
1964
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
1965
|
-
/**
|
|
1966
|
-
* @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.
|
|
1967
|
-
*/
|
|
1968
|
-
get: function() {
|
|
1969
|
-
return {
|
|
1970
|
-
addClass: function() {
|
|
1971
|
-
},
|
|
1972
|
-
removeClass: function() {
|
|
1973
|
-
},
|
|
1974
|
-
hasClass: function() {
|
|
1975
|
-
return !1;
|
|
1976
|
-
},
|
|
1977
|
-
hasAnchor: function() {
|
|
1978
|
-
return !1;
|
|
1979
|
-
},
|
|
1980
|
-
isElementInContainer: function() {
|
|
1981
|
-
return !1;
|
|
1982
|
-
},
|
|
1983
|
-
isFocused: function() {
|
|
1984
|
-
return !1;
|
|
1985
|
-
},
|
|
1986
|
-
isRtl: function() {
|
|
1987
|
-
return !1;
|
|
1988
|
-
},
|
|
1989
|
-
getInnerDimensions: function() {
|
|
1990
|
-
return { height: 0, width: 0 };
|
|
1991
|
-
},
|
|
1992
|
-
getAnchorDimensions: function() {
|
|
1993
|
-
return null;
|
|
1994
|
-
},
|
|
1995
|
-
getWindowDimensions: function() {
|
|
1996
|
-
return { height: 0, width: 0 };
|
|
1997
|
-
},
|
|
1998
|
-
getBodyDimensions: function() {
|
|
1999
|
-
return { height: 0, width: 0 };
|
|
2000
|
-
},
|
|
2001
|
-
getWindowScroll: function() {
|
|
2002
|
-
return { x: 0, y: 0 };
|
|
2003
|
-
},
|
|
2004
|
-
setPosition: function() {
|
|
2005
|
-
},
|
|
2006
|
-
setMaxHeight: function() {
|
|
2007
|
-
},
|
|
2008
|
-
setTransformOrigin: function() {
|
|
2009
|
-
},
|
|
2010
|
-
saveFocus: function() {
|
|
2011
|
-
},
|
|
2012
|
-
restoreFocus: function() {
|
|
2013
|
-
},
|
|
2014
|
-
notifyClose: function() {
|
|
2015
|
-
},
|
|
2016
|
-
notifyOpen: function() {
|
|
2017
|
-
},
|
|
2018
|
-
notifyClosing: function() {
|
|
2019
|
-
}
|
|
2020
|
-
};
|
|
2021
|
-
},
|
|
2022
|
-
enumerable: !1,
|
|
2023
|
-
configurable: !0
|
|
2024
|
-
}), n.prototype.init = function() {
|
|
2025
|
-
var e = n.cssClasses, t = e.ROOT, r = e.OPEN;
|
|
2026
|
-
if (!this.adapter.hasClass(t))
|
|
2027
|
-
throw new Error(t + " class required in root element.");
|
|
2028
|
-
this.adapter.hasClass(r) && (this.isSurfaceOpen = !0);
|
|
2029
|
-
}, n.prototype.destroy = function() {
|
|
2030
|
-
clearTimeout(this.openAnimationEndTimerId), clearTimeout(this.closeAnimationEndTimerId), cancelAnimationFrame(this.animationRequestId);
|
|
2031
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
2032
|
-
this.anchorCorner = e;
|
|
2033
|
-
}, n.prototype.flipCornerHorizontally = function() {
|
|
2034
|
-
this.originCorner = this.originCorner ^ X.RIGHT;
|
|
2035
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
2036
|
-
this.anchorMargin.top = e.top || 0, this.anchorMargin.right = e.right || 0, this.anchorMargin.bottom = e.bottom || 0, this.anchorMargin.left = e.left || 0;
|
|
2037
|
-
}, n.prototype.setIsHoisted = function(e) {
|
|
2038
|
-
this.isHoistedElement = e;
|
|
2039
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
2040
|
-
this.isFixedPosition = e;
|
|
2041
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
2042
|
-
this.position.x = this.isFinite(e) ? e : 0, this.position.y = this.isFinite(t) ? t : 0;
|
|
2043
|
-
}, n.prototype.setIsHorizontallyCenteredOnViewport = function(e) {
|
|
2044
|
-
this.isHorizontallyCenteredOnViewport = e;
|
|
2045
|
-
}, n.prototype.setQuickOpen = function(e) {
|
|
2046
|
-
this.isQuickOpen = e;
|
|
2047
|
-
}, n.prototype.setMaxHeight = function(e) {
|
|
2048
|
-
this.maxHeight = e;
|
|
2049
|
-
}, n.prototype.isOpen = function() {
|
|
2050
|
-
return this.isSurfaceOpen;
|
|
2051
|
-
}, n.prototype.open = function() {
|
|
2052
|
-
var e = this;
|
|
2053
|
-
this.isSurfaceOpen || (this.adapter.saveFocus(), this.isQuickOpen ? (this.isSurfaceOpen = !0, this.adapter.addClass(n.cssClasses.OPEN), this.dimensions = this.adapter.getInnerDimensions(), this.autoposition(), this.adapter.notifyOpen()) : (this.adapter.addClass(n.cssClasses.ANIMATING_OPEN), this.animationRequestId = requestAnimationFrame(function() {
|
|
2054
|
-
e.adapter.addClass(n.cssClasses.OPEN), e.dimensions = e.adapter.getInnerDimensions(), e.autoposition(), e.openAnimationEndTimerId = setTimeout(function() {
|
|
2055
|
-
e.openAnimationEndTimerId = 0, e.adapter.removeClass(n.cssClasses.ANIMATING_OPEN), e.adapter.notifyOpen();
|
|
2056
|
-
}, ot.TRANSITION_OPEN_DURATION);
|
|
2057
|
-
}), this.isSurfaceOpen = !0));
|
|
2058
|
-
}, n.prototype.close = function(e) {
|
|
2059
|
-
var t = this;
|
|
2060
|
-
if (e === void 0 && (e = !1), !!this.isSurfaceOpen) {
|
|
2061
|
-
if (this.adapter.notifyClosing(), this.isQuickOpen) {
|
|
2062
|
-
this.isSurfaceOpen = !1, e || this.maybeRestoreFocus(), this.adapter.removeClass(n.cssClasses.OPEN), this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW), this.adapter.notifyClose();
|
|
2063
|
-
return;
|
|
2064
|
-
}
|
|
2065
|
-
this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED), requestAnimationFrame(function() {
|
|
2066
|
-
t.adapter.removeClass(n.cssClasses.OPEN), t.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW), t.closeAnimationEndTimerId = setTimeout(function() {
|
|
2067
|
-
t.closeAnimationEndTimerId = 0, t.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED), t.adapter.notifyClose();
|
|
2068
|
-
}, ot.TRANSITION_CLOSE_DURATION);
|
|
2069
|
-
}), this.isSurfaceOpen = !1, e || this.maybeRestoreFocus();
|
|
2070
|
-
}
|
|
2071
|
-
}, n.prototype.handleBodyClick = function(e) {
|
|
2072
|
-
var t = e.target;
|
|
2073
|
-
this.adapter.isElementInContainer(t) || this.close();
|
|
2074
|
-
}, n.prototype.handleKeydown = function(e) {
|
|
2075
|
-
var t = e.keyCode, r = e.key, o = r === "Escape" || t === 27;
|
|
2076
|
-
o && this.close();
|
|
2077
|
-
}, n.prototype.autoposition = function() {
|
|
2078
|
-
var e;
|
|
2079
|
-
this.measurements = this.getAutoLayoutmeasurements();
|
|
2080
|
-
var t = this.getoriginCorner(), r = this.getMenuSurfaceMaxHeight(t), o = this.hasBit(t, X.BOTTOM) ? "bottom" : "top", a = this.hasBit(t, X.RIGHT) ? "right" : "left", l = this.getHorizontalOriginOffset(t), u = this.getVerticalOriginOffset(t), y = this.measurements, C = y.anchorSize, m = y.surfaceSize, E = (e = {}, e[a] = l, e[o] = u, e);
|
|
2081
|
-
C.width / m.width > ot.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO && (a = "center"), (this.isHoistedElement || this.isFixedPosition) && this.adjustPositionForHoistedElement(E), this.adapter.setTransformOrigin(a + " " + o), this.adapter.setPosition(E), this.adapter.setMaxHeight(r ? r + "px" : ""), this.hasBit(t, X.BOTTOM) || this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW);
|
|
2082
|
-
}, n.prototype.getAutoLayoutmeasurements = function() {
|
|
2083
|
-
var e = this.adapter.getAnchorDimensions(), t = this.adapter.getBodyDimensions(), r = this.adapter.getWindowDimensions(), o = this.adapter.getWindowScroll();
|
|
2084
|
-
return e || (e = {
|
|
2085
|
-
top: this.position.y,
|
|
2086
|
-
right: this.position.x,
|
|
2087
|
-
bottom: this.position.y,
|
|
2088
|
-
left: this.position.x,
|
|
2089
|
-
width: 0,
|
|
2090
|
-
height: 0
|
|
2091
|
-
}), {
|
|
2092
|
-
anchorSize: e,
|
|
2093
|
-
bodySize: t,
|
|
2094
|
-
surfaceSize: this.dimensions,
|
|
2095
|
-
viewportDistance: {
|
|
2096
|
-
// tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together
|
|
2097
|
-
top: e.top,
|
|
2098
|
-
right: r.width - e.right,
|
|
2099
|
-
bottom: r.height - e.bottom,
|
|
2100
|
-
left: e.left
|
|
2101
|
-
// tslint:enable:object-literal-sort-keys
|
|
2102
|
-
},
|
|
2103
|
-
viewportSize: r,
|
|
2104
|
-
windowScroll: o
|
|
2105
|
-
};
|
|
2106
|
-
}, n.prototype.getoriginCorner = function() {
|
|
2107
|
-
var e = this.originCorner, t = this.measurements, r = t.viewportDistance, o = t.anchorSize, a = t.surfaceSize, l = n.numbers.MARGIN_TO_EDGE, u = this.hasBit(this.anchorCorner, X.BOTTOM), y, C;
|
|
2108
|
-
u ? (y = r.top - l + this.anchorMargin.bottom, C = r.bottom - l - this.anchorMargin.bottom) : (y = r.top - l + this.anchorMargin.top, C = r.bottom - l + o.height - this.anchorMargin.top);
|
|
2109
|
-
var m = C - a.height > 0;
|
|
2110
|
-
!m && y > C && (e = this.setBit(e, X.BOTTOM));
|
|
2111
|
-
var E = this.adapter.isRtl(), d = this.hasBit(this.anchorCorner, X.FLIP_RTL), f = this.hasBit(this.anchorCorner, X.RIGHT) || this.hasBit(e, X.RIGHT), A = !1;
|
|
2112
|
-
E && d ? A = !f : A = f;
|
|
2113
|
-
var v, p;
|
|
2114
|
-
A ? (v = r.left + o.width + this.anchorMargin.right, p = r.right - this.anchorMargin.right) : (v = r.left + this.anchorMargin.left, p = r.right + o.width - this.anchorMargin.left);
|
|
2115
|
-
var h = v - a.width > 0, g = p - a.width > 0, b = this.hasBit(e, X.FLIP_RTL) && this.hasBit(e, X.RIGHT);
|
|
2116
|
-
return g && b && E || !h && b ? e = this.unsetBit(e, X.RIGHT) : (h && A && E || h && !A && f || !g && v >= p) && (e = this.setBit(e, X.RIGHT)), e;
|
|
2117
|
-
}, n.prototype.getMenuSurfaceMaxHeight = function(e) {
|
|
2118
|
-
if (this.maxHeight > 0)
|
|
2119
|
-
return this.maxHeight;
|
|
2120
|
-
var t = this.measurements.viewportDistance, r = 0, o = this.hasBit(e, X.BOTTOM), a = this.hasBit(this.anchorCorner, X.BOTTOM), l = n.numbers.MARGIN_TO_EDGE;
|
|
2121
|
-
return o ? (r = t.top + this.anchorMargin.top - l, a || (r += this.measurements.anchorSize.height)) : (r = t.bottom - this.anchorMargin.bottom + this.measurements.anchorSize.height - l, a && (r -= this.measurements.anchorSize.height)), r;
|
|
2122
|
-
}, n.prototype.getHorizontalOriginOffset = function(e) {
|
|
2123
|
-
var t = this.measurements.anchorSize, r = this.hasBit(e, X.RIGHT), o = this.hasBit(this.anchorCorner, X.RIGHT);
|
|
2124
|
-
if (r) {
|
|
2125
|
-
var a = o ? t.width - this.anchorMargin.left : this.anchorMargin.right;
|
|
2126
|
-
return this.isHoistedElement || this.isFixedPosition ? a - (this.measurements.viewportSize.width - this.measurements.bodySize.width) : a;
|
|
2127
|
-
}
|
|
2128
|
-
return o ? t.width - this.anchorMargin.right : this.anchorMargin.left;
|
|
2129
|
-
}, n.prototype.getVerticalOriginOffset = function(e) {
|
|
2130
|
-
var t = this.measurements.anchorSize, r = this.hasBit(e, X.BOTTOM), o = this.hasBit(this.anchorCorner, X.BOTTOM), a = 0;
|
|
2131
|
-
return r ? a = o ? t.height - this.anchorMargin.top : -this.anchorMargin.bottom : a = o ? t.height + this.anchorMargin.bottom : this.anchorMargin.top, a;
|
|
2132
|
-
}, n.prototype.adjustPositionForHoistedElement = function(e) {
|
|
2133
|
-
var t, r, o = this.measurements, a = o.windowScroll, l = o.viewportDistance, u = o.surfaceSize, y = o.viewportSize, C = Object.keys(e);
|
|
2134
|
-
try {
|
|
2135
|
-
for (var m = Nn(C), E = m.next(); !E.done; E = m.next()) {
|
|
2136
|
-
var d = E.value, f = e[d] || 0;
|
|
2137
|
-
if (this.isHorizontallyCenteredOnViewport && (d === "left" || d === "right")) {
|
|
2138
|
-
e[d] = (y.width - u.width) / 2;
|
|
2139
|
-
continue;
|
|
2140
|
-
}
|
|
2141
|
-
f += l[d], this.isFixedPosition || (d === "top" ? f += a.y : d === "bottom" ? f -= a.y : d === "left" ? f += a.x : f -= a.x), e[d] = f;
|
|
2142
|
-
}
|
|
2143
|
-
} catch (A) {
|
|
2144
|
-
t = { error: A };
|
|
2145
|
-
} finally {
|
|
2146
|
-
try {
|
|
2147
|
-
E && !E.done && (r = m.return) && r.call(m);
|
|
2148
|
-
} finally {
|
|
2149
|
-
if (t)
|
|
2150
|
-
throw t.error;
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
}, n.prototype.maybeRestoreFocus = function() {
|
|
2154
|
-
var e = this.adapter.isFocused(), t = document.activeElement && this.adapter.isElementInContainer(document.activeElement);
|
|
2155
|
-
(e || t) && this.adapter.restoreFocus();
|
|
2156
|
-
}, n.prototype.hasBit = function(e, t) {
|
|
2157
|
-
return !!(e & t);
|
|
2158
|
-
}, n.prototype.setBit = function(e, t) {
|
|
2159
|
-
return e | t;
|
|
2160
|
-
}, n.prototype.unsetBit = function(e, t) {
|
|
2161
|
-
return e ^ t;
|
|
2162
|
-
}, n.prototype.isFinite = function(e) {
|
|
2163
|
-
return typeof e == "number" && isFinite(e);
|
|
2164
|
-
}, n;
|
|
2165
|
-
}(He)
|
|
2166
|
-
);
|
|
2167
|
-
/**
|
|
2168
|
-
* @license
|
|
2169
|
-
* Copyright 2018 Google Inc.
|
|
2170
|
-
*
|
|
2171
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2172
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
2173
|
-
* in the Software without restriction, including without limitation the rights
|
|
2174
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2175
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
2176
|
-
* furnished to do so, subject to the following conditions:
|
|
2177
|
-
*
|
|
2178
|
-
* The above copyright notice and this permission notice shall be included in
|
|
2179
|
-
* all copies or substantial portions of the Software.
|
|
2180
|
-
*
|
|
2181
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2182
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2183
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2184
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2185
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2186
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
2187
|
-
* THE SOFTWARE.
|
|
2188
|
-
*/
|
|
2189
|
-
var hn = (
|
|
2190
|
-
/** @class */
|
|
2191
|
-
function(i) {
|
|
2192
|
-
Ee(n, i);
|
|
2193
|
-
function n() {
|
|
2194
|
-
return i !== null && i.apply(this, arguments) || this;
|
|
2195
|
-
}
|
|
2196
|
-
return n.attachTo = function(e) {
|
|
2197
|
-
return new n(e);
|
|
2198
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
2199
|
-
var e = this, t = this.root.parentElement;
|
|
2200
|
-
this.anchorElement = t && t.classList.contains(Ze.ANCHOR) ? t : null, this.root.classList.contains(Ze.FIXED) && this.setFixedPosition(!0), this.handleKeydown = function(r) {
|
|
2201
|
-
e.foundation.handleKeydown(r);
|
|
2202
|
-
}, this.handleBodyClick = function(r) {
|
|
2203
|
-
e.foundation.handleBodyClick(r);
|
|
2204
|
-
}, this.registerBodyClickListener = function() {
|
|
2205
|
-
document.body.addEventListener("click", e.handleBodyClick, { capture: !0 });
|
|
2206
|
-
}, this.deregisterBodyClickListener = function() {
|
|
2207
|
-
document.body.removeEventListener("click", e.handleBodyClick, { capture: !0 });
|
|
2208
|
-
}, this.listen("keydown", this.handleKeydown), this.listen(Je.OPENED_EVENT, this.registerBodyClickListener), this.listen(Je.CLOSED_EVENT, this.deregisterBodyClickListener);
|
|
2209
|
-
}, n.prototype.destroy = function() {
|
|
2210
|
-
this.unlisten("keydown", this.handleKeydown), this.unlisten(Je.OPENED_EVENT, this.registerBodyClickListener), this.unlisten(Je.CLOSED_EVENT, this.deregisterBodyClickListener), i.prototype.destroy.call(this);
|
|
2211
|
-
}, n.prototype.isOpen = function() {
|
|
2212
|
-
return this.foundation.isOpen();
|
|
2213
|
-
}, n.prototype.open = function() {
|
|
2214
|
-
this.foundation.open();
|
|
2215
|
-
}, n.prototype.close = function(e) {
|
|
2216
|
-
e === void 0 && (e = !1), this.foundation.close(e);
|
|
2217
|
-
}, Object.defineProperty(n.prototype, "quickOpen", {
|
|
2218
|
-
set: function(e) {
|
|
2219
|
-
this.foundation.setQuickOpen(e);
|
|
2220
|
-
},
|
|
2221
|
-
enumerable: !1,
|
|
2222
|
-
configurable: !0
|
|
2223
|
-
}), n.prototype.setIsHoisted = function(e) {
|
|
2224
|
-
this.foundation.setIsHoisted(e);
|
|
2225
|
-
}, n.prototype.setMenuSurfaceAnchorElement = function(e) {
|
|
2226
|
-
this.anchorElement = e;
|
|
2227
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
2228
|
-
e ? this.root.classList.add(Ze.FIXED) : this.root.classList.remove(Ze.FIXED), this.foundation.setFixedPosition(e);
|
|
2229
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
2230
|
-
this.foundation.setAbsolutePosition(e, t), this.setIsHoisted(!0);
|
|
2231
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
2232
|
-
this.foundation.setAnchorCorner(e);
|
|
2233
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
2234
|
-
this.foundation.setAnchorMargin(e);
|
|
2235
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
2236
|
-
var e = this, t = {
|
|
2237
|
-
addClass: function(r) {
|
|
2238
|
-
return e.root.classList.add(r);
|
|
2239
|
-
},
|
|
2240
|
-
removeClass: function(r) {
|
|
2241
|
-
return e.root.classList.remove(r);
|
|
2242
|
-
},
|
|
2243
|
-
hasClass: function(r) {
|
|
2244
|
-
return e.root.classList.contains(r);
|
|
2245
|
-
},
|
|
2246
|
-
hasAnchor: function() {
|
|
2247
|
-
return !!e.anchorElement;
|
|
2248
|
-
},
|
|
2249
|
-
notifyClose: function() {
|
|
2250
|
-
return e.emit(Be.strings.CLOSED_EVENT, {});
|
|
2251
|
-
},
|
|
2252
|
-
notifyClosing: function() {
|
|
2253
|
-
e.emit(Be.strings.CLOSING_EVENT, {});
|
|
2254
|
-
},
|
|
2255
|
-
notifyOpen: function() {
|
|
2256
|
-
return e.emit(Be.strings.OPENED_EVENT, {});
|
|
2257
|
-
},
|
|
2258
|
-
isElementInContainer: function(r) {
|
|
2259
|
-
return e.root.contains(r);
|
|
2260
|
-
},
|
|
2261
|
-
isRtl: function() {
|
|
2262
|
-
return getComputedStyle(e.root).getPropertyValue("direction") === "rtl";
|
|
2263
|
-
},
|
|
2264
|
-
setTransformOrigin: function(r) {
|
|
2265
|
-
var o = Yn(window, "transform") + "-origin";
|
|
2266
|
-
e.root.style.setProperty(o, r);
|
|
2267
|
-
},
|
|
2268
|
-
isFocused: function() {
|
|
2269
|
-
return document.activeElement === e.root;
|
|
2270
|
-
},
|
|
2271
|
-
saveFocus: function() {
|
|
2272
|
-
e.previousFocus = document.activeElement;
|
|
2273
|
-
},
|
|
2274
|
-
restoreFocus: function() {
|
|
2275
|
-
e.root.contains(document.activeElement) && e.previousFocus && e.previousFocus.focus && e.previousFocus.focus();
|
|
2276
|
-
},
|
|
2277
|
-
getInnerDimensions: function() {
|
|
2278
|
-
return {
|
|
2279
|
-
width: e.root.offsetWidth,
|
|
2280
|
-
height: e.root.offsetHeight
|
|
2281
|
-
};
|
|
2282
|
-
},
|
|
2283
|
-
getAnchorDimensions: function() {
|
|
2284
|
-
return e.anchorElement ? e.anchorElement.getBoundingClientRect() : null;
|
|
2285
|
-
},
|
|
2286
|
-
getWindowDimensions: function() {
|
|
2287
|
-
return { width: window.innerWidth, height: window.innerHeight };
|
|
2288
|
-
},
|
|
2289
|
-
getBodyDimensions: function() {
|
|
2290
|
-
return { width: document.body.clientWidth, height: document.body.clientHeight };
|
|
2291
|
-
},
|
|
2292
|
-
getWindowScroll: function() {
|
|
2293
|
-
return { x: window.pageXOffset, y: window.pageYOffset };
|
|
2294
|
-
},
|
|
2295
|
-
setPosition: function(r) {
|
|
2296
|
-
var o = e.root;
|
|
2297
|
-
o.style.left = "left" in r ? r.left + "px" : "", o.style.right = "right" in r ? r.right + "px" : "", o.style.top = "top" in r ? r.top + "px" : "", o.style.bottom = "bottom" in r ? r.bottom + "px" : "";
|
|
2298
|
-
},
|
|
2299
|
-
setMaxHeight: function(r) {
|
|
2300
|
-
e.root.style.maxHeight = r;
|
|
2301
|
-
}
|
|
2302
|
-
};
|
|
2303
|
-
return new Be(t);
|
|
2304
|
-
}, n;
|
|
2305
|
-
}(Ke)
|
|
2306
|
-
);
|
|
2307
|
-
/**
|
|
2308
|
-
* @license
|
|
2309
|
-
* Copyright 2018 Google Inc.
|
|
2310
|
-
*
|
|
2311
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2312
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
2313
|
-
* in the Software without restriction, including without limitation the rights
|
|
2314
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2315
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
2316
|
-
* furnished to do so, subject to the following conditions:
|
|
2317
|
-
*
|
|
2318
|
-
* The above copyright notice and this permission notice shall be included in
|
|
2319
|
-
* all copies or substantial portions of the Software.
|
|
2320
|
-
*
|
|
2321
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2322
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2323
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2324
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2325
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2326
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
2327
|
-
* THE SOFTWARE.
|
|
2328
|
-
*/
|
|
2329
|
-
var We = {
|
|
2330
|
-
MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected",
|
|
2331
|
-
MENU_SELECTION_GROUP: "mdc-menu__selection-group",
|
|
2332
|
-
ROOT: "mdc-menu"
|
|
2333
|
-
}, Re = {
|
|
2334
|
-
ARIA_CHECKED_ATTR: "aria-checked",
|
|
2335
|
-
ARIA_DISABLED_ATTR: "aria-disabled",
|
|
2336
|
-
CHECKBOX_SELECTOR: 'input[type="checkbox"]',
|
|
2337
|
-
LIST_SELECTOR: ".mdc-list,.mdc-deprecated-list",
|
|
2338
|
-
SELECTED_EVENT: "MDCMenu:selected"
|
|
2339
|
-
}, cr = {
|
|
2340
|
-
FOCUS_ROOT_INDEX: -1
|
|
2341
|
-
}, Ue;
|
|
2342
|
-
(function(i) {
|
|
2343
|
-
i[i.NONE = 0] = "NONE", i[i.LIST_ROOT = 1] = "LIST_ROOT", i[i.FIRST_ITEM = 2] = "FIRST_ITEM", i[i.LAST_ITEM = 3] = "LAST_ITEM";
|
|
2344
|
-
})(Ue || (Ue = {}));
|
|
2345
|
-
/**
|
|
2346
|
-
* @license
|
|
2347
|
-
* Copyright 2018 Google Inc.
|
|
2348
|
-
*
|
|
2349
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2350
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
2351
|
-
* in the Software without restriction, including without limitation the rights
|
|
2352
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2353
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
2354
|
-
* furnished to do so, subject to the following conditions:
|
|
2355
|
-
*
|
|
2356
|
-
* The above copyright notice and this permission notice shall be included in
|
|
2357
|
-
* all copies or substantial portions of the Software.
|
|
2358
|
-
*
|
|
2359
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2360
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2361
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2362
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2363
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2364
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
2365
|
-
* THE SOFTWARE.
|
|
2366
|
-
*/
|
|
2367
|
-
var dr = (
|
|
2368
|
-
/** @class */
|
|
2369
|
-
function(i) {
|
|
2370
|
-
Ee(n, i);
|
|
2371
|
-
function n(e) {
|
|
2372
|
-
var t = i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
2373
|
-
return t.closeAnimationEndTimerId_ = 0, t.defaultFocusState_ = Ue.LIST_ROOT, t;
|
|
2374
|
-
}
|
|
2375
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
2376
|
-
get: function() {
|
|
2377
|
-
return We;
|
|
2378
|
-
},
|
|
2379
|
-
enumerable: !1,
|
|
2380
|
-
configurable: !0
|
|
2381
|
-
}), Object.defineProperty(n, "strings", {
|
|
2382
|
-
get: function() {
|
|
2383
|
-
return Re;
|
|
2384
|
-
},
|
|
2385
|
-
enumerable: !1,
|
|
2386
|
-
configurable: !0
|
|
2387
|
-
}), Object.defineProperty(n, "numbers", {
|
|
2388
|
-
get: function() {
|
|
2389
|
-
return cr;
|
|
2390
|
-
},
|
|
2391
|
-
enumerable: !1,
|
|
2392
|
-
configurable: !0
|
|
2393
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
2394
|
-
/**
|
|
2395
|
-
* @see {@link MDCMenuAdapter} for typing information on parameters and return types.
|
|
2396
|
-
*/
|
|
2397
|
-
get: function() {
|
|
2398
|
-
return {
|
|
2399
|
-
addClassToElementAtIndex: function() {
|
|
2400
|
-
},
|
|
2401
|
-
removeClassFromElementAtIndex: function() {
|
|
2402
|
-
},
|
|
2403
|
-
addAttributeToElementAtIndex: function() {
|
|
2404
|
-
},
|
|
2405
|
-
removeAttributeFromElementAtIndex: function() {
|
|
2406
|
-
},
|
|
2407
|
-
elementContainsClass: function() {
|
|
2408
|
-
return !1;
|
|
2409
|
-
},
|
|
2410
|
-
closeSurface: function() {
|
|
2411
|
-
},
|
|
2412
|
-
getElementIndex: function() {
|
|
2413
|
-
return -1;
|
|
2414
|
-
},
|
|
2415
|
-
notifySelected: function() {
|
|
2416
|
-
},
|
|
2417
|
-
getMenuItemCount: function() {
|
|
2418
|
-
return 0;
|
|
2419
|
-
},
|
|
2420
|
-
focusItemAtIndex: function() {
|
|
2421
|
-
},
|
|
2422
|
-
focusListRoot: function() {
|
|
2423
|
-
},
|
|
2424
|
-
getSelectedSiblingOfItemAtIndex: function() {
|
|
2425
|
-
return -1;
|
|
2426
|
-
},
|
|
2427
|
-
isSelectableItemAtIndex: function() {
|
|
2428
|
-
return !1;
|
|
2429
|
-
}
|
|
2430
|
-
};
|
|
2431
|
-
},
|
|
2432
|
-
enumerable: !1,
|
|
2433
|
-
configurable: !0
|
|
2434
|
-
}), n.prototype.destroy = function() {
|
|
2435
|
-
this.closeAnimationEndTimerId_ && clearTimeout(this.closeAnimationEndTimerId_), this.adapter.closeSurface();
|
|
2436
|
-
}, n.prototype.handleKeydown = function(e) {
|
|
2437
|
-
var t = e.key, r = e.keyCode, o = t === "Tab" || r === 9;
|
|
2438
|
-
o && this.adapter.closeSurface(
|
|
2439
|
-
/** skipRestoreFocus */
|
|
2440
|
-
!0
|
|
2441
|
-
);
|
|
2442
|
-
}, n.prototype.handleItemAction = function(e) {
|
|
2443
|
-
var t = this, r = this.adapter.getElementIndex(e);
|
|
2444
|
-
r < 0 || (this.adapter.notifySelected({ index: r }), this.adapter.closeSurface(), this.closeAnimationEndTimerId_ = setTimeout(function() {
|
|
2445
|
-
var o = t.adapter.getElementIndex(e);
|
|
2446
|
-
o >= 0 && t.adapter.isSelectableItemAtIndex(o) && t.setSelectedIndex(o);
|
|
2447
|
-
}, Be.numbers.TRANSITION_CLOSE_DURATION));
|
|
2448
|
-
}, n.prototype.handleMenuSurfaceOpened = function() {
|
|
2449
|
-
switch (this.defaultFocusState_) {
|
|
2450
|
-
case Ue.FIRST_ITEM:
|
|
2451
|
-
this.adapter.focusItemAtIndex(0);
|
|
2452
|
-
break;
|
|
2453
|
-
case Ue.LAST_ITEM:
|
|
2454
|
-
this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);
|
|
2455
|
-
break;
|
|
2456
|
-
case Ue.NONE:
|
|
2457
|
-
break;
|
|
2458
|
-
default:
|
|
2459
|
-
this.adapter.focusListRoot();
|
|
2460
|
-
break;
|
|
2461
|
-
}
|
|
2462
|
-
}, n.prototype.setDefaultFocusState = function(e) {
|
|
2463
|
-
this.defaultFocusState_ = e;
|
|
2464
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
2465
|
-
if (this.validatedIndex_(e), !this.adapter.isSelectableItemAtIndex(e))
|
|
2466
|
-
throw new Error("MDCMenuFoundation: No selection group at specified index.");
|
|
2467
|
-
var t = this.adapter.getSelectedSiblingOfItemAtIndex(e);
|
|
2468
|
-
t >= 0 && (this.adapter.removeAttributeFromElementAtIndex(t, Re.ARIA_CHECKED_ATTR), this.adapter.removeClassFromElementAtIndex(t, We.MENU_SELECTED_LIST_ITEM)), this.adapter.addClassToElementAtIndex(e, We.MENU_SELECTED_LIST_ITEM), this.adapter.addAttributeToElementAtIndex(e, Re.ARIA_CHECKED_ATTR, "true");
|
|
2469
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
2470
|
-
this.validatedIndex_(e), t ? (this.adapter.removeClassFromElementAtIndex(e, T.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(e, Re.ARIA_DISABLED_ATTR, "false")) : (this.adapter.addClassToElementAtIndex(e, T.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(e, Re.ARIA_DISABLED_ATTR, "true"));
|
|
2471
|
-
}, n.prototype.validatedIndex_ = function(e) {
|
|
2472
|
-
var t = this.adapter.getMenuItemCount(), r = e >= 0 && e < t;
|
|
2473
|
-
if (!r)
|
|
2474
|
-
throw new Error("MDCMenuFoundation: No list item at specified index.");
|
|
2475
|
-
}, n;
|
|
2476
|
-
}(He)
|
|
2477
|
-
);
|
|
2478
|
-
/**
|
|
2479
|
-
* @license
|
|
2480
|
-
* Copyright 2018 Google Inc.
|
|
2481
|
-
*
|
|
2482
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2483
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
2484
|
-
* in the Software without restriction, including without limitation the rights
|
|
2485
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2486
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
2487
|
-
* furnished to do so, subject to the following conditions:
|
|
2488
|
-
*
|
|
2489
|
-
* The above copyright notice and this permission notice shall be included in
|
|
2490
|
-
* all copies or substantial portions of the Software.
|
|
2491
|
-
*
|
|
2492
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2493
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2494
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2495
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2496
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2497
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
2498
|
-
* THE SOFTWARE.
|
|
2499
|
-
*/
|
|
2500
|
-
var ur = (
|
|
2501
|
-
/** @class */
|
|
2502
|
-
function(i) {
|
|
2503
|
-
Ee(n, i);
|
|
2504
|
-
function n() {
|
|
2505
|
-
return i !== null && i.apply(this, arguments) || this;
|
|
2506
|
-
}
|
|
2507
|
-
return n.attachTo = function(e) {
|
|
2508
|
-
return new n(e);
|
|
2509
|
-
}, n.prototype.initialize = function(e, t) {
|
|
2510
|
-
e === void 0 && (e = function(r) {
|
|
2511
|
-
return new hn(r);
|
|
2512
|
-
}), t === void 0 && (t = function(r) {
|
|
2513
|
-
return new fn(r);
|
|
2514
|
-
}), this.menuSurfaceFactory_ = e, this.listFactory_ = t;
|
|
2515
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
2516
|
-
var e = this;
|
|
2517
|
-
this.menuSurface_ = this.menuSurfaceFactory_(this.root);
|
|
2518
|
-
var t = this.root.querySelector(Re.LIST_SELECTOR);
|
|
2519
|
-
t ? (this.list_ = this.listFactory_(t), this.list_.wrapFocus = !0) : this.list_ = null, this.handleKeydown_ = function(r) {
|
|
2520
|
-
return e.foundation.handleKeydown(r);
|
|
2521
|
-
}, this.handleItemAction_ = function(r) {
|
|
2522
|
-
return e.foundation.handleItemAction(e.items[r.detail.index]);
|
|
2523
|
-
}, this.handleMenuSurfaceOpened_ = function() {
|
|
2524
|
-
return e.foundation.handleMenuSurfaceOpened();
|
|
2525
|
-
}, this.menuSurface_.listen(Be.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_), this.listen("keydown", this.handleKeydown_), this.listen(Nt.strings.ACTION_EVENT, this.handleItemAction_);
|
|
2526
|
-
}, n.prototype.destroy = function() {
|
|
2527
|
-
this.list_ && this.list_.destroy(), this.menuSurface_.destroy(), this.menuSurface_.unlisten(Be.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_), this.unlisten("keydown", this.handleKeydown_), this.unlisten(Nt.strings.ACTION_EVENT, this.handleItemAction_), i.prototype.destroy.call(this);
|
|
2528
|
-
}, Object.defineProperty(n.prototype, "open", {
|
|
2529
|
-
get: function() {
|
|
2530
|
-
return this.menuSurface_.isOpen();
|
|
2531
|
-
},
|
|
2532
|
-
set: function(e) {
|
|
2533
|
-
e ? this.menuSurface_.open() : this.menuSurface_.close();
|
|
2534
|
-
},
|
|
2535
|
-
enumerable: !1,
|
|
2536
|
-
configurable: !0
|
|
2537
|
-
}), Object.defineProperty(n.prototype, "wrapFocus", {
|
|
2538
|
-
get: function() {
|
|
2539
|
-
return this.list_ ? this.list_.wrapFocus : !1;
|
|
2540
|
-
},
|
|
2541
|
-
set: function(e) {
|
|
2542
|
-
this.list_ && (this.list_.wrapFocus = e);
|
|
2543
|
-
},
|
|
2544
|
-
enumerable: !1,
|
|
2545
|
-
configurable: !0
|
|
2546
|
-
}), Object.defineProperty(n.prototype, "hasTypeahead", {
|
|
2547
|
-
/**
|
|
2548
|
-
* Sets whether the menu has typeahead functionality.
|
|
2549
|
-
* @param value Whether typeahead is enabled.
|
|
2550
|
-
*/
|
|
2551
|
-
set: function(e) {
|
|
2552
|
-
this.list_ && (this.list_.hasTypeahead = e);
|
|
2553
|
-
},
|
|
2554
|
-
enumerable: !1,
|
|
2555
|
-
configurable: !0
|
|
2556
|
-
}), Object.defineProperty(n.prototype, "typeaheadInProgress", {
|
|
2557
|
-
/**
|
|
2558
|
-
* @return Whether typeahead logic is currently matching some user prefix.
|
|
2559
|
-
*/
|
|
2560
|
-
get: function() {
|
|
2561
|
-
return this.list_ ? this.list_.typeaheadInProgress : !1;
|
|
2562
|
-
},
|
|
2563
|
-
enumerable: !1,
|
|
2564
|
-
configurable: !0
|
|
2565
|
-
}), n.prototype.typeaheadMatchItem = function(e, t) {
|
|
2566
|
-
return this.list_ ? this.list_.typeaheadMatchItem(e, t) : -1;
|
|
2567
|
-
}, n.prototype.layout = function() {
|
|
2568
|
-
this.list_ && this.list_.layout();
|
|
2569
|
-
}, Object.defineProperty(n.prototype, "items", {
|
|
2570
|
-
/**
|
|
2571
|
-
* Return the items within the menu. Note that this only contains the set of elements within
|
|
2572
|
-
* the items container that are proper list items, and not supplemental / presentational DOM
|
|
2573
|
-
* elements.
|
|
2574
|
-
*/
|
|
2575
|
-
get: function() {
|
|
2576
|
-
return this.list_ ? this.list_.listElements : [];
|
|
2577
|
-
},
|
|
2578
|
-
enumerable: !1,
|
|
2579
|
-
configurable: !0
|
|
2580
|
-
}), Object.defineProperty(n.prototype, "singleSelection", {
|
|
2581
|
-
/**
|
|
2582
|
-
* Turns on/off the underlying list's single selection mode. Used mainly
|
|
2583
|
-
* by select menu.
|
|
2584
|
-
*
|
|
2585
|
-
* @param singleSelection Whether to enable single selection mode.
|
|
2586
|
-
*/
|
|
2587
|
-
set: function(e) {
|
|
2588
|
-
this.list_ && (this.list_.singleSelection = e);
|
|
2589
|
-
},
|
|
2590
|
-
enumerable: !1,
|
|
2591
|
-
configurable: !0
|
|
2592
|
-
}), Object.defineProperty(n.prototype, "selectedIndex", {
|
|
2593
|
-
/**
|
|
2594
|
-
* Retrieves the selected index. Only applicable to select menus.
|
|
2595
|
-
* @return The selected index, which is a number for single selection and
|
|
2596
|
-
* radio lists, and an array of numbers for checkbox lists.
|
|
2597
|
-
*/
|
|
2598
|
-
get: function() {
|
|
2599
|
-
return this.list_ ? this.list_.selectedIndex : ne.UNSET_INDEX;
|
|
2600
|
-
},
|
|
2601
|
-
/**
|
|
2602
|
-
* Sets the selected index of the list. Only applicable to select menus.
|
|
2603
|
-
* @param index The selected index, which is a number for single selection and
|
|
2604
|
-
* radio lists, and an array of numbers for checkbox lists.
|
|
2605
|
-
*/
|
|
2606
|
-
set: function(e) {
|
|
2607
|
-
this.list_ && (this.list_.selectedIndex = e);
|
|
2608
|
-
},
|
|
2609
|
-
enumerable: !1,
|
|
2610
|
-
configurable: !0
|
|
2611
|
-
}), Object.defineProperty(n.prototype, "quickOpen", {
|
|
2612
|
-
set: function(e) {
|
|
2613
|
-
this.menuSurface_.quickOpen = e;
|
|
2614
|
-
},
|
|
2615
|
-
enumerable: !1,
|
|
2616
|
-
configurable: !0
|
|
2617
|
-
}), n.prototype.setDefaultFocusState = function(e) {
|
|
2618
|
-
this.foundation.setDefaultFocusState(e);
|
|
2619
|
-
}, n.prototype.setAnchorCorner = function(e) {
|
|
2620
|
-
this.menuSurface_.setAnchorCorner(e);
|
|
2621
|
-
}, n.prototype.setAnchorMargin = function(e) {
|
|
2622
|
-
this.menuSurface_.setAnchorMargin(e);
|
|
2623
|
-
}, n.prototype.setSelectedIndex = function(e) {
|
|
2624
|
-
this.foundation.setSelectedIndex(e);
|
|
2625
|
-
}, n.prototype.setEnabled = function(e, t) {
|
|
2626
|
-
this.foundation.setEnabled(e, t);
|
|
2627
|
-
}, n.prototype.getOptionByIndex = function(e) {
|
|
2628
|
-
var t = this.items;
|
|
2629
|
-
return e < t.length ? this.items[e] : null;
|
|
2630
|
-
}, n.prototype.getPrimaryTextAtIndex = function(e) {
|
|
2631
|
-
var t = this.getOptionByIndex(e);
|
|
2632
|
-
return t && this.list_ && this.list_.getPrimaryText(t) || "";
|
|
2633
|
-
}, n.prototype.setFixedPosition = function(e) {
|
|
2634
|
-
this.menuSurface_.setFixedPosition(e);
|
|
2635
|
-
}, n.prototype.setIsHoisted = function(e) {
|
|
2636
|
-
this.menuSurface_.setIsHoisted(e);
|
|
2637
|
-
}, n.prototype.setAbsolutePosition = function(e, t) {
|
|
2638
|
-
this.menuSurface_.setAbsolutePosition(e, t);
|
|
2639
|
-
}, n.prototype.setAnchorElement = function(e) {
|
|
2640
|
-
this.menuSurface_.anchorElement = e;
|
|
2641
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
2642
|
-
var e = this, t = {
|
|
2643
|
-
addClassToElementAtIndex: function(r, o) {
|
|
2644
|
-
var a = e.items;
|
|
2645
|
-
a[r].classList.add(o);
|
|
2646
|
-
},
|
|
2647
|
-
removeClassFromElementAtIndex: function(r, o) {
|
|
2648
|
-
var a = e.items;
|
|
2649
|
-
a[r].classList.remove(o);
|
|
2650
|
-
},
|
|
2651
|
-
addAttributeToElementAtIndex: function(r, o, a) {
|
|
2652
|
-
var l = e.items;
|
|
2653
|
-
l[r].setAttribute(o, a);
|
|
2654
|
-
},
|
|
2655
|
-
removeAttributeFromElementAtIndex: function(r, o) {
|
|
2656
|
-
var a = e.items;
|
|
2657
|
-
a[r].removeAttribute(o);
|
|
2658
|
-
},
|
|
2659
|
-
elementContainsClass: function(r, o) {
|
|
2660
|
-
return r.classList.contains(o);
|
|
2661
|
-
},
|
|
2662
|
-
closeSurface: function(r) {
|
|
2663
|
-
return e.menuSurface_.close(r);
|
|
2664
|
-
},
|
|
2665
|
-
getElementIndex: function(r) {
|
|
2666
|
-
return e.items.indexOf(r);
|
|
2667
|
-
},
|
|
2668
|
-
notifySelected: function(r) {
|
|
2669
|
-
return e.emit(Re.SELECTED_EVENT, {
|
|
2670
|
-
index: r.index,
|
|
2671
|
-
item: e.items[r.index]
|
|
2672
|
-
});
|
|
2673
|
-
},
|
|
2674
|
-
getMenuItemCount: function() {
|
|
2675
|
-
return e.items.length;
|
|
2676
|
-
},
|
|
2677
|
-
focusItemAtIndex: function(r) {
|
|
2678
|
-
return e.items[r].focus();
|
|
2679
|
-
},
|
|
2680
|
-
focusListRoot: function() {
|
|
2681
|
-
return e.root.querySelector(Re.LIST_SELECTOR).focus();
|
|
2682
|
-
},
|
|
2683
|
-
isSelectableItemAtIndex: function(r) {
|
|
2684
|
-
return !!Ot(e.items[r], "." + We.MENU_SELECTION_GROUP);
|
|
2685
|
-
},
|
|
2686
|
-
getSelectedSiblingOfItemAtIndex: function(r) {
|
|
2687
|
-
var o = Ot(e.items[r], "." + We.MENU_SELECTION_GROUP), a = o.querySelector("." + We.MENU_SELECTED_LIST_ITEM);
|
|
2688
|
-
return a ? e.items.indexOf(a) : -1;
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
return new dr(t);
|
|
2692
|
-
}, n;
|
|
2693
|
-
}(Ke)
|
|
2694
|
-
);
|
|
2695
|
-
const fr = {
|
|
2696
|
-
/**
|
|
2697
|
-
* The horizontal position of the menu, when visible. The menu surface will be hoisted to the body of the DOM. This should only be used when the menu needs to be explicitly positioned and cannot be combined with MenuAnchor.
|
|
2698
|
-
*
|
|
2699
|
-
* Defaults to **null**.
|
|
2700
|
-
*/
|
|
2701
|
-
absolutePositionX: s.number,
|
|
2702
|
-
/**
|
|
2703
|
-
* The vertical position of the menu, when visible. The menu surface will be hoisted to the body of the DOM. This should only be used when the menu needs to be explicitly positioned and cannot be combined with MenuAnchor.
|
|
2704
|
-
*
|
|
2705
|
-
* Defaults to **null**.
|
|
2706
|
-
*/
|
|
2707
|
-
absolutePositionY: s.number,
|
|
2708
|
-
/**
|
|
2709
|
-
* Sets the display position of the menu relative to the parent element. It must be used with Menu Anchor.
|
|
2710
|
-
*
|
|
2711
|
-
* Defaults to **'BOTTOM_START'**.
|
|
2712
|
-
*/
|
|
2713
|
-
anchorCorner: s.oneOf(["TOP_LEFT", "TOP_RIGHT", "BOTTOM_LEFT", "BOTTOM_RIGHT", "TOP_START", "TOP_END", "BOTTOM_START", "BOTTOM_END"]),
|
|
2714
|
-
/**
|
|
2715
|
-
* Sets the distance from the anchor point that the menu surface should be shown. The object properties should include at least one of `top`, `bottom`, `left` or `right`.
|
|
2716
|
-
*
|
|
2717
|
-
* Defaults to **null**.
|
|
2718
|
-
*/
|
|
2719
|
-
anchorMargin: s.object,
|
|
2720
|
-
/**
|
|
2721
|
-
* Custom props to be sent to the MenuAnchor wrapper of the `trigger`
|
|
2722
|
-
*
|
|
2723
|
-
* Defaults to **{}**.
|
|
2724
|
-
*/
|
|
2725
|
-
anchorProps: s.object,
|
|
2726
|
-
/**
|
|
2727
|
-
* Expects a List or ListGroup component but accepts any valid markup or components.
|
|
2728
|
-
*
|
|
2729
|
-
* Defaults to **null**.
|
|
2730
|
-
*/
|
|
2731
|
-
children: s.node,
|
|
2732
|
-
/**
|
|
2733
|
-
* Sets the direction property for the menu. For right to left languages use `rtl`.
|
|
2734
|
-
*
|
|
2735
|
-
* Defaults to **'ltr'**.
|
|
2736
|
-
*/
|
|
2737
|
-
direction: s.oneOf(["ltr", "rtl"]),
|
|
2738
|
-
/**
|
|
2739
|
-
* Prevents the use of absolute position (x/y) props.
|
|
2740
|
-
*
|
|
2741
|
-
* Defaults to **false**.
|
|
2742
|
-
*/
|
|
2743
|
-
fixed: s.bool,
|
|
2744
|
-
/**
|
|
2745
|
-
* Sets the width of the menu to the full width of the body. It is to be used with `hoistToBody`. Useful when creating navigation menus for mobile devices.
|
|
2746
|
-
*
|
|
2747
|
-
* Defaults to **false**.
|
|
2748
|
-
*/
|
|
2749
|
-
fullScreen: s.bool,
|
|
2750
|
-
/**
|
|
2751
|
-
* Sets the width of the menu to the full width of the parent. Cannot be used with `hoistToBody` or when `absolutePositionY` or `absolutePositionY` is set.
|
|
2752
|
-
*
|
|
2753
|
-
* Defaults to **false**.
|
|
2754
|
-
*/
|
|
2755
|
-
fullWidth: s.bool,
|
|
2756
|
-
/**
|
|
2757
|
-
* Fired when html body is clicked. Default behavior is to close the menu.
|
|
2758
|
-
*
|
|
2759
|
-
* Defaults to **null**.
|
|
2760
|
-
*/
|
|
2761
|
-
handleBodyClick: s.func,
|
|
2762
|
-
/**
|
|
2763
|
-
* Enables the menu to be rendered as part of the body, enables higher z-index. Requires `surfaceOnly` to be true. This can improve menu to behavior better inside a table. Use with caution: may cause unintended side-effects.
|
|
2764
|
-
*
|
|
2765
|
-
* Defaults to **false**.
|
|
2766
|
-
*/
|
|
2767
|
-
hoistToBody: s.bool,
|
|
2768
|
-
/**
|
|
2769
|
-
* Sets the max height of the menu.
|
|
2770
|
-
*
|
|
2771
|
-
* Defaults to **275**.
|
|
2772
|
-
*/
|
|
2773
|
-
maxHeight: s.number,
|
|
2774
|
-
/**
|
|
2775
|
-
* Fired after the menu surface is closed. For best performance, this method should be memoized or wrapped with useCallback.
|
|
2776
|
-
*
|
|
2777
|
-
* Defaults to **null**.
|
|
2778
|
-
*/
|
|
2779
|
-
onClose: s.func,
|
|
2780
|
-
/**
|
|
2781
|
-
* Fired after the menu surface is opened. For best performance, this method should be memoized or wrapped with useCallback.
|
|
2782
|
-
*
|
|
2783
|
-
* Defaults to **null**.
|
|
2784
|
-
*/
|
|
2785
|
-
onOpen: s.func,
|
|
2786
|
-
/**
|
|
2787
|
-
* Fired when a menu item is selected . It is not available if `surfaceOnly` is true. For best performance, this method should be memoized or wrapped with useCallback.
|
|
2788
|
-
*
|
|
2789
|
-
* Defaults to **null**.
|
|
2790
|
-
*/
|
|
2791
|
-
onSelect: s.func,
|
|
2792
|
-
/**
|
|
2793
|
-
* Controls the visibility of the menu.
|
|
2794
|
-
*
|
|
2795
|
-
* Defaults to **false**.
|
|
2796
|
-
*/
|
|
2797
|
-
open: s.bool,
|
|
2798
|
-
/**
|
|
2799
|
-
* Passthrough style object.
|
|
2800
|
-
*
|
|
2801
|
-
* Defaults to **null**.
|
|
2802
|
-
*/
|
|
2803
|
-
style: s.object,
|
|
2804
|
-
/**
|
|
2805
|
-
* Renders as just the menu surface. While Menu expects a list of items, when surfaceOnly is true any content can go inside the menu.
|
|
2806
|
-
*
|
|
2807
|
-
* Defaults to **false**.
|
|
2808
|
-
*/
|
|
2809
|
-
surfaceOnly: s.bool,
|
|
2810
|
-
/**
|
|
2811
|
-
* Background color of the menu.
|
|
2812
|
-
*
|
|
2813
|
-
* Defaults to **'surface'**.
|
|
2814
|
-
*/
|
|
2815
|
-
themeColor: s.oneOf(["surface", "primary", "secondary"]),
|
|
2816
|
-
/**
|
|
2817
|
-
* Node used to trigger open the menu or menu surface. Will also serve as the anchor.
|
|
2818
|
-
*
|
|
2819
|
-
* Defaults to **null**.
|
|
2820
|
-
*/
|
|
2821
|
-
trigger: s.node,
|
|
2822
|
-
/**
|
|
2823
|
-
* When used with a List component `wrapFocus` allows keyboard navigation to jump to the top or bottom of the list to enable continuous navigation.
|
|
2824
|
-
*
|
|
2825
|
-
* Defaults to **true**.
|
|
2826
|
-
*/
|
|
2827
|
-
wrapFocus: s.bool
|
|
2828
|
-
}, hr = {
|
|
2829
|
-
absolutePositionX: null,
|
|
2830
|
-
absolutePositionY: null,
|
|
2831
|
-
anchorCorner: "BOTTOM_START",
|
|
2832
|
-
anchorMargin: null,
|
|
2833
|
-
anchorProps: {},
|
|
2834
|
-
children: null,
|
|
2835
|
-
direction: "ltr",
|
|
2836
|
-
fixed: !1,
|
|
2837
|
-
fullScreen: !1,
|
|
2838
|
-
fullWidth: !1,
|
|
2839
|
-
hoistToBody: !1,
|
|
2840
|
-
maxHeight: 275,
|
|
2841
|
-
open: !1,
|
|
2842
|
-
style: null,
|
|
2843
|
-
surfaceOnly: !1,
|
|
2844
|
-
themeColor: "surface",
|
|
2845
|
-
trigger: null,
|
|
2846
|
-
wrapFocus: !0
|
|
2847
|
-
}, pr = {
|
|
2848
|
-
/**
|
|
2849
|
-
* Expects a clickable component such as Button or IconButton and the Menu component.
|
|
2850
|
-
*
|
|
2851
|
-
* Defaults to **null**.
|
|
2852
|
-
*/
|
|
2853
|
-
children: s.node
|
|
2854
|
-
}, mr = {
|
|
2855
|
-
children: null
|
|
2856
|
-
}, ut = /* @__PURE__ */ $((i, n) => {
|
|
2857
|
-
const {
|
|
2858
|
-
children: e,
|
|
2859
|
-
className: t,
|
|
2860
|
-
...r
|
|
2861
|
-
} = i;
|
|
2862
|
-
return /* @__PURE__ */ c.createElement("div", U({
|
|
2863
|
-
ref: n,
|
|
2864
|
-
className: F("lmnt", "mdc-menu-surface--anchor", t)
|
|
2865
|
-
}, r), e);
|
|
2866
|
-
});
|
|
2867
|
-
ut.displayName = "MenuAnchor";
|
|
2868
|
-
ut.propTypes = pr;
|
|
2869
|
-
ut.defaultProps = mr;
|
|
2870
|
-
const pn = /* @__PURE__ */ ln({}), Er = (i, n, e) => (t) => /* @__PURE__ */ c.createElement(ut, U({}, i, {
|
|
2871
|
-
ref: e
|
|
2872
|
-
}), n, t), Ir = (i) => (n) => /* @__PURE__ */ c.createElement(Ln, {
|
|
2873
|
-
disabled: !i
|
|
2874
|
-
}, n), Mt = /* @__PURE__ */ $((i, n) => {
|
|
2875
|
-
const {
|
|
2876
|
-
absolutePositionX: e,
|
|
2877
|
-
absolutePositionY: t,
|
|
2878
|
-
anchorCorner: r,
|
|
2879
|
-
anchorMargin: o,
|
|
2880
|
-
anchorProps: a,
|
|
2881
|
-
children: l,
|
|
2882
|
-
className: u,
|
|
2883
|
-
direction: y,
|
|
2884
|
-
fixed: C,
|
|
2885
|
-
fullScreen: m,
|
|
2886
|
-
fullWidth: E,
|
|
2887
|
-
handleBodyClick: d,
|
|
2888
|
-
hoistToBody: f,
|
|
2889
|
-
iconMenu: A,
|
|
2890
|
-
id: v,
|
|
2891
|
-
maxHeight: p,
|
|
2892
|
-
onClose: h,
|
|
2893
|
-
onOpen: g,
|
|
2894
|
-
onSelect: b,
|
|
2895
|
-
open: k,
|
|
2896
|
-
quickOpen: Q,
|
|
2897
|
-
style: se,
|
|
2898
|
-
surfaceOnly: O,
|
|
2899
|
-
themeColor: K,
|
|
2900
|
-
trigger: V,
|
|
2901
|
-
unexposed: H,
|
|
2902
|
-
wrapFocus: ee,
|
|
2903
|
-
...de
|
|
2904
|
-
} = i, [Me] = Ae(() => v || qe()), [Te, Ce] = Ae(), M = oe(), I = oe(), _e = oe();
|
|
2905
|
-
ve(n, () => M.current, []);
|
|
2906
|
-
const Z = Y((te) => {
|
|
2907
|
-
const x = O ? I.current.foundation.getoriginCorner() : I.current.menuSurface_.foundation.getoriginCorner(), N = O && I.current.foundation.hasBit(x, X.BOTTOM) || !O && I.current.menuSurface_.foundation.hasBit(x, X.BOTTOM) ? "bottom" : "top";
|
|
2908
|
-
Ce(N === "bottom"), g && g(te);
|
|
2909
|
-
}, [g, O]), W = Y((te) => {
|
|
2910
|
-
b && b(te.detail);
|
|
2911
|
-
}, [b]);
|
|
2912
|
-
P(() => (I.current = O ? hn.attachTo(M.current) : ur.attachTo(M.current), () => {
|
|
2913
|
-
I.current.destroy();
|
|
2914
|
-
}), [O]), P(() => (O || I.current.listen("MDCMenu:selected", W), () => {
|
|
2915
|
-
O || I.current.unlisten("MDCMenu:selected", W);
|
|
2916
|
-
}), [W, O]), P(() => (I.current.listen("MDCMenuSurface:closed", h), () => {
|
|
2917
|
-
I.current.unlisten("MDCMenuSurface:closed", h);
|
|
2918
|
-
}), [h]), P(() => (I.current.listen("MDCMenuSurface:opened", Z), () => {
|
|
2919
|
-
I.current.unlisten("MDCMenuSurface:opened", Z);
|
|
2920
|
-
}), [Z]), P(() => {
|
|
2921
|
-
O ? I.current.foundation.setMaxHeight(p) : I.current.menuSurface_.foundation.setMaxHeight(p);
|
|
2922
|
-
}, [p, O]), P(() => {
|
|
2923
|
-
o && (O ? I.current.foundation.setAnchorMargin(o) : I.current.menuSurface_.foundation.setAnchorMargin(o));
|
|
2924
|
-
}, [o, O]), P(() => {
|
|
2925
|
-
d && (I.current.handleBodyClick = d);
|
|
2926
|
-
}, [d]), P(() => {
|
|
2927
|
-
(!C && e && e > -1 || !C && t && t > -1) && (I.current.setAbsolutePosition(e, t), I.current.foundation.getAutoLayoutmeasurements().surfaceSize && I.current.foundation.autoposition());
|
|
2928
|
-
}, [e, t, C]), P(() => {
|
|
2929
|
-
I.current.setFixedPosition(C);
|
|
2930
|
-
}, [C]), P(() => {
|
|
2931
|
-
I.current.wrapFocus = ee;
|
|
2932
|
-
}, [ee]), P(() => {
|
|
2933
|
-
r && !(e || t) && I.current.setAnchorCorner(Ge[r.toUpperCase()]);
|
|
2934
|
-
}, [I, r, e, t]), P(() => {
|
|
2935
|
-
I.current.setIsHoisted(f), O ? I.current.setMenuSurfaceAnchorElement(_e.current) : I.current.setAnchorElement(_e.current);
|
|
2936
|
-
}, [f, O, V]), P(() => {
|
|
2937
|
-
I.current.quickOpen = Q;
|
|
2938
|
-
}, [Q]), P(() => {
|
|
2939
|
-
k ? !O && !I.current.open ? I.current.open = k : I.current.foundation.isSurfaceOpen || I.current.open() : !O && I.current.open ? I.current.open = !1 : I.current.foundation.isSurfaceOpen && I.current.close();
|
|
2940
|
-
}, [I, k, O]);
|
|
2941
|
-
const B = ie(() => ({
|
|
2942
|
-
inMenu: !0
|
|
2943
|
-
}), []), ue = ie(() => {
|
|
2944
|
-
var te, x;
|
|
2945
|
-
return F("lmnt", "mdc-menu-surface", "lmnt-menu-container", (O && ((te = I.current) === null || te === void 0 ? void 0 : te.foundation.isOpen()) || !O && ((x = I.current) === null || x === void 0 ? void 0 : x.menuSurface_.foundation.isOpen())) && "mdc-menu-surface--open", Te && "lmnt-menu-open-up", !O && "mdc-menu", !f && E && "mdc-menu-surface--fullwidth", f && m && "lmnt-menu-surface--fullScreen", `lmnt-theme-${K}-bg`, u);
|
|
2946
|
-
}, [u, m, E, f, Te, O, K]), re = ie(() => Er(a, V, _e), [a, V]), fe = ie(() => Ir(f), [f]), ye = ie(() => ({
|
|
2947
|
-
...se,
|
|
2948
|
-
direction: y
|
|
2949
|
-
}), [se, y]);
|
|
2950
|
-
return /* @__PURE__ */ c.createElement(Bt, {
|
|
2951
|
-
condition: V,
|
|
2952
|
-
wrapper: re
|
|
2953
|
-
}, /* @__PURE__ */ c.createElement(Bt, {
|
|
2954
|
-
condition: f,
|
|
2955
|
-
wrapper: fe
|
|
2956
|
-
}, /* @__PURE__ */ c.createElement("div", U({
|
|
2957
|
-
ref: M,
|
|
2958
|
-
id: Me,
|
|
2959
|
-
style: ye,
|
|
2960
|
-
className: ue,
|
|
2961
|
-
tabIndex: "-1"
|
|
2962
|
-
}, de), /* @__PURE__ */ c.createElement(pn.Provider, {
|
|
2963
|
-
value: B
|
|
2964
|
-
}, l))));
|
|
2965
|
-
});
|
|
2966
|
-
Mt.displayName = "Menu";
|
|
2967
|
-
Mt.propTypes = fr;
|
|
2968
|
-
Mt.defaultProps = hr;
|
|
2969
|
-
function _r(i, n) {
|
|
2970
|
-
for (var e = -1, t = n.length, r = i.length; ++e < t; )
|
|
2971
|
-
i[r + e] = n[e];
|
|
2972
|
-
return i;
|
|
2973
|
-
}
|
|
2974
|
-
var yr = _r, gr = yr, Tr = sn;
|
|
2975
|
-
function Cr(i, n, e) {
|
|
2976
|
-
var t = n(i);
|
|
2977
|
-
return Tr(i) ? t : gr(t, e(i));
|
|
2978
|
-
}
|
|
2979
|
-
var Ar = Cr;
|
|
2980
|
-
function vr(i, n) {
|
|
2981
|
-
for (var e = -1, t = i == null ? 0 : i.length, r = 0, o = []; ++e < t; ) {
|
|
2982
|
-
var a = i[e];
|
|
2983
|
-
n(a, e, i) && (o[r++] = a);
|
|
2984
|
-
}
|
|
2985
|
-
return o;
|
|
2986
|
-
}
|
|
2987
|
-
var br = vr;
|
|
2988
|
-
function Sr() {
|
|
2989
|
-
return [];
|
|
2990
|
-
}
|
|
2991
|
-
var Or = Sr, xr = br, Lr = Or, Nr = Object.prototype, Rr = Nr.propertyIsEnumerable, Xt = Object.getOwnPropertySymbols, Dr = Xt ? function(i) {
|
|
2992
|
-
return i == null ? [] : (i = Object(i), xr(Xt(i), function(n) {
|
|
2993
|
-
return Rr.call(i, n);
|
|
2994
|
-
}));
|
|
2995
|
-
} : Lr, Mr = Dr, Pr = yn, kr = Pr(Object.keys, Object), wr = kr, Br = gn, Fr = wr, Hr = Object.prototype, Kr = Hr.hasOwnProperty;
|
|
2996
|
-
function Ur(i) {
|
|
2997
|
-
if (!Br(i))
|
|
2998
|
-
return Fr(i);
|
|
2999
|
-
var n = [];
|
|
3000
|
-
for (var e in Object(i))
|
|
3001
|
-
Kr.call(i, e) && e != "constructor" && n.push(e);
|
|
3002
|
-
return n;
|
|
3003
|
-
}
|
|
3004
|
-
var Gr = Ur, Wr = Tn, jr = Gr, $r = Cn;
|
|
3005
|
-
function Vr(i) {
|
|
3006
|
-
return $r(i) ? Wr(i) : jr(i);
|
|
3007
|
-
}
|
|
3008
|
-
var qr = Vr, Xr = Ar, zr = Mr, Yr = qr;
|
|
3009
|
-
function Qr(i) {
|
|
3010
|
-
return Xr(i, Yr, zr);
|
|
3011
|
-
}
|
|
3012
|
-
var Zr = Qr, zt = Zr, Jr = 1, ei = Object.prototype, ti = ei.hasOwnProperty;
|
|
3013
|
-
function ni(i, n, e, t, r, o) {
|
|
3014
|
-
var a = e & Jr, l = zt(i), u = l.length, y = zt(n), C = y.length;
|
|
3015
|
-
if (u != C && !a)
|
|
3016
|
-
return !1;
|
|
3017
|
-
for (var m = u; m--; ) {
|
|
3018
|
-
var E = l[m];
|
|
3019
|
-
if (!(a ? E in n : ti.call(n, E)))
|
|
3020
|
-
return !1;
|
|
3021
|
-
}
|
|
3022
|
-
var d = o.get(i), f = o.get(n);
|
|
3023
|
-
if (d && f)
|
|
3024
|
-
return d == n && f == i;
|
|
3025
|
-
var A = !0;
|
|
3026
|
-
o.set(i, n), o.set(n, i);
|
|
3027
|
-
for (var v = a; ++m < u; ) {
|
|
3028
|
-
E = l[m];
|
|
3029
|
-
var p = i[E], h = n[E];
|
|
3030
|
-
if (t)
|
|
3031
|
-
var g = a ? t(h, p, E, n, i, o) : t(p, h, E, i, n, o);
|
|
3032
|
-
if (!(g === void 0 ? p === h || r(p, h, e, t, o) : g)) {
|
|
3033
|
-
A = !1;
|
|
3034
|
-
break;
|
|
3035
|
-
}
|
|
3036
|
-
v || (v = E == "constructor");
|
|
3037
|
-
}
|
|
3038
|
-
if (A && !v) {
|
|
3039
|
-
var b = i.constructor, k = n.constructor;
|
|
3040
|
-
b != k && "constructor" in i && "constructor" in n && !(typeof b == "function" && b instanceof b && typeof k == "function" && k instanceof k) && (A = !1);
|
|
3041
|
-
}
|
|
3042
|
-
return o.delete(i), o.delete(n), A;
|
|
3043
|
-
}
|
|
3044
|
-
var ri = ni, At = An, ii = Pn, oi = kn, si = ri, Yt = wn, Qt = sn, Zt = vn, ai = bn, li = 1, Jt = "[object Arguments]", en = "[object Array]", st = "[object Object]", ci = Object.prototype, tn = ci.hasOwnProperty;
|
|
3045
|
-
function di(i, n, e, t, r, o) {
|
|
3046
|
-
var a = Qt(i), l = Qt(n), u = a ? en : Yt(i), y = l ? en : Yt(n);
|
|
3047
|
-
u = u == Jt ? st : u, y = y == Jt ? st : y;
|
|
3048
|
-
var C = u == st, m = y == st, E = u == y;
|
|
3049
|
-
if (E && Zt(i)) {
|
|
3050
|
-
if (!Zt(n))
|
|
3051
|
-
return !1;
|
|
3052
|
-
a = !0, C = !1;
|
|
3053
|
-
}
|
|
3054
|
-
if (E && !C)
|
|
3055
|
-
return o || (o = new At()), a || ai(i) ? ii(i, n, e, t, r, o) : oi(i, n, u, e, t, r, o);
|
|
3056
|
-
if (!(e & li)) {
|
|
3057
|
-
var d = C && tn.call(i, "__wrapped__"), f = m && tn.call(n, "__wrapped__");
|
|
3058
|
-
if (d || f) {
|
|
3059
|
-
var A = d ? i.value() : i, v = f ? n.value() : n;
|
|
3060
|
-
return o || (o = new At()), r(A, v, e, t, o);
|
|
3061
|
-
}
|
|
3062
|
-
}
|
|
3063
|
-
return E ? (o || (o = new At()), si(i, n, e, t, r, o)) : !1;
|
|
3064
|
-
}
|
|
3065
|
-
var ui = di, fi = ui, nn = Sn;
|
|
3066
|
-
function mn(i, n, e, t, r) {
|
|
3067
|
-
return i === n ? !0 : i == null || n == null || !nn(i) && !nn(n) ? i !== i && n !== n : fi(i, n, e, t, mn, r);
|
|
3068
|
-
}
|
|
3069
|
-
var hi = mn, pi = hi;
|
|
3070
|
-
function mi(i, n) {
|
|
3071
|
-
return pi(i, n);
|
|
3072
|
-
}
|
|
3073
|
-
var Ei = mi;
|
|
3074
|
-
const Ii = /* @__PURE__ */ Mn(Ei);
|
|
3075
|
-
/**
|
|
3076
|
-
* @license
|
|
3077
|
-
* Copyright 2016 Google Inc.
|
|
3078
|
-
*
|
|
3079
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3080
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3081
|
-
* in the Software without restriction, including without limitation the rights
|
|
3082
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3083
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3084
|
-
* furnished to do so, subject to the following conditions:
|
|
3085
|
-
*
|
|
3086
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3087
|
-
* all copies or substantial portions of the Software.
|
|
3088
|
-
*
|
|
3089
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3090
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3091
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3092
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3093
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3094
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3095
|
-
* THE SOFTWARE.
|
|
3096
|
-
*/
|
|
3097
|
-
var _i = {
|
|
3098
|
-
NATIVE_CONTROL_SELECTOR: ".mdc-radio__native-control"
|
|
3099
|
-
}, yi = {
|
|
3100
|
-
DISABLED: "mdc-radio--disabled",
|
|
3101
|
-
ROOT: "mdc-radio"
|
|
3102
|
-
};
|
|
3103
|
-
/**
|
|
3104
|
-
* @license
|
|
3105
|
-
* Copyright 2016 Google Inc.
|
|
3106
|
-
*
|
|
3107
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3108
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3109
|
-
* in the Software without restriction, including without limitation the rights
|
|
3110
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3111
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3112
|
-
* furnished to do so, subject to the following conditions:
|
|
3113
|
-
*
|
|
3114
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3115
|
-
* all copies or substantial portions of the Software.
|
|
3116
|
-
*
|
|
3117
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3118
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3119
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3120
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3121
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3122
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3123
|
-
* THE SOFTWARE.
|
|
3124
|
-
*/
|
|
3125
|
-
var rn = (
|
|
3126
|
-
/** @class */
|
|
3127
|
-
function(i) {
|
|
3128
|
-
Ee(n, i);
|
|
3129
|
-
function n(e) {
|
|
3130
|
-
return i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
3131
|
-
}
|
|
3132
|
-
return Object.defineProperty(n, "cssClasses", {
|
|
3133
|
-
get: function() {
|
|
3134
|
-
return yi;
|
|
3135
|
-
},
|
|
3136
|
-
enumerable: !1,
|
|
3137
|
-
configurable: !0
|
|
3138
|
-
}), Object.defineProperty(n, "strings", {
|
|
3139
|
-
get: function() {
|
|
3140
|
-
return _i;
|
|
3141
|
-
},
|
|
3142
|
-
enumerable: !1,
|
|
3143
|
-
configurable: !0
|
|
3144
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
3145
|
-
get: function() {
|
|
3146
|
-
return {
|
|
3147
|
-
addClass: function() {
|
|
3148
|
-
},
|
|
3149
|
-
removeClass: function() {
|
|
3150
|
-
},
|
|
3151
|
-
setNativeControlDisabled: function() {
|
|
3152
|
-
}
|
|
3153
|
-
};
|
|
3154
|
-
},
|
|
3155
|
-
enumerable: !1,
|
|
3156
|
-
configurable: !0
|
|
3157
|
-
}), n.prototype.setDisabled = function(e) {
|
|
3158
|
-
var t = n.cssClasses.DISABLED;
|
|
3159
|
-
this.adapter.setNativeControlDisabled(e), e ? this.adapter.addClass(t) : this.adapter.removeClass(t);
|
|
3160
|
-
}, n;
|
|
3161
|
-
}(He)
|
|
3162
|
-
);
|
|
3163
|
-
/**
|
|
3164
|
-
* @license
|
|
3165
|
-
* Copyright 2016 Google Inc.
|
|
3166
|
-
*
|
|
3167
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3168
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3169
|
-
* in the Software without restriction, including without limitation the rights
|
|
3170
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3171
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3172
|
-
* furnished to do so, subject to the following conditions:
|
|
3173
|
-
*
|
|
3174
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3175
|
-
* all copies or substantial portions of the Software.
|
|
3176
|
-
*
|
|
3177
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3178
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3179
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3180
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3181
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3182
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3183
|
-
* THE SOFTWARE.
|
|
3184
|
-
*/
|
|
3185
|
-
var gi = (
|
|
3186
|
-
/** @class */
|
|
3187
|
-
function(i) {
|
|
3188
|
-
Ee(n, i);
|
|
3189
|
-
function n() {
|
|
3190
|
-
var e = i !== null && i.apply(this, arguments) || this;
|
|
3191
|
-
return e.ripple_ = e.createRipple_(), e;
|
|
3192
|
-
}
|
|
3193
|
-
return n.attachTo = function(e) {
|
|
3194
|
-
return new n(e);
|
|
3195
|
-
}, Object.defineProperty(n.prototype, "checked", {
|
|
3196
|
-
get: function() {
|
|
3197
|
-
return this.nativeControl_.checked;
|
|
3198
|
-
},
|
|
3199
|
-
set: function(e) {
|
|
3200
|
-
this.nativeControl_.checked = e;
|
|
3201
|
-
},
|
|
3202
|
-
enumerable: !1,
|
|
3203
|
-
configurable: !0
|
|
3204
|
-
}), Object.defineProperty(n.prototype, "disabled", {
|
|
3205
|
-
get: function() {
|
|
3206
|
-
return this.nativeControl_.disabled;
|
|
3207
|
-
},
|
|
3208
|
-
set: function(e) {
|
|
3209
|
-
this.foundation.setDisabled(e);
|
|
3210
|
-
},
|
|
3211
|
-
enumerable: !1,
|
|
3212
|
-
configurable: !0
|
|
3213
|
-
}), Object.defineProperty(n.prototype, "value", {
|
|
3214
|
-
get: function() {
|
|
3215
|
-
return this.nativeControl_.value;
|
|
3216
|
-
},
|
|
3217
|
-
set: function(e) {
|
|
3218
|
-
this.nativeControl_.value = e;
|
|
3219
|
-
},
|
|
3220
|
-
enumerable: !1,
|
|
3221
|
-
configurable: !0
|
|
3222
|
-
}), Object.defineProperty(n.prototype, "ripple", {
|
|
3223
|
-
get: function() {
|
|
3224
|
-
return this.ripple_;
|
|
3225
|
-
},
|
|
3226
|
-
enumerable: !1,
|
|
3227
|
-
configurable: !0
|
|
3228
|
-
}), n.prototype.destroy = function() {
|
|
3229
|
-
this.ripple_.destroy(), i.prototype.destroy.call(this);
|
|
3230
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
3231
|
-
var e = this, t = {
|
|
3232
|
-
addClass: function(r) {
|
|
3233
|
-
return e.root.classList.add(r);
|
|
3234
|
-
},
|
|
3235
|
-
removeClass: function(r) {
|
|
3236
|
-
return e.root.classList.remove(r);
|
|
3237
|
-
},
|
|
3238
|
-
setNativeControlDisabled: function(r) {
|
|
3239
|
-
return e.nativeControl_.disabled = r;
|
|
3240
|
-
}
|
|
3241
|
-
};
|
|
3242
|
-
return new rn(t);
|
|
3243
|
-
}, n.prototype.createRipple_ = function() {
|
|
3244
|
-
var e = this, t = J(J({}, je.createAdapter(this)), {
|
|
3245
|
-
registerInteractionHandler: function(r, o) {
|
|
3246
|
-
return e.nativeControl_.addEventListener(r, o, $e());
|
|
3247
|
-
},
|
|
3248
|
-
deregisterInteractionHandler: function(r, o) {
|
|
3249
|
-
return e.nativeControl_.removeEventListener(r, o, $e());
|
|
3250
|
-
},
|
|
3251
|
-
// Radio buttons technically go "active" whenever there is *any* keyboard interaction.
|
|
3252
|
-
// This is not the UI we desire.
|
|
3253
|
-
isSurfaceActive: function() {
|
|
3254
|
-
return !1;
|
|
3255
|
-
},
|
|
3256
|
-
isUnbounded: function() {
|
|
3257
|
-
return !0;
|
|
3258
|
-
}
|
|
3259
|
-
});
|
|
3260
|
-
return new je(this.root, new Rt(t));
|
|
3261
|
-
}, Object.defineProperty(n.prototype, "nativeControl_", {
|
|
3262
|
-
get: function() {
|
|
3263
|
-
var e = rn.strings.NATIVE_CONTROL_SELECTOR, t = this.root.querySelector(e);
|
|
3264
|
-
if (!t)
|
|
3265
|
-
throw new Error("Radio component requires a " + e + " element");
|
|
3266
|
-
return t;
|
|
3267
|
-
},
|
|
3268
|
-
enumerable: !1,
|
|
3269
|
-
configurable: !0
|
|
3270
|
-
}), n;
|
|
3271
|
-
}(Ke)
|
|
3272
|
-
);
|
|
3273
|
-
const Ti = {
|
|
3274
|
-
/**
|
|
3275
|
-
* Aligns radio to the right of the label.
|
|
3276
|
-
*
|
|
3277
|
-
* Defaults to **false**.
|
|
3278
|
-
*/
|
|
3279
|
-
alignEnd: s.bool,
|
|
3280
|
-
/**
|
|
3281
|
-
* Applies selected state when `checked` equals `value` or when `checked` is set to true.
|
|
3282
|
-
*
|
|
3283
|
-
* Defaults to **null**.
|
|
3284
|
-
*/
|
|
3285
|
-
checked: s.oneOfType([s.string, s.bool]),
|
|
3286
|
-
/**
|
|
3287
|
-
* @deprecated _Use `label` instead._
|
|
3288
|
-
*
|
|
3289
|
-
* Content to be rendered as the radio label. Can be used instead of `label` to provide more flexibility. Accepts any valid markup. _Warning, if `label` is set, it will be used instead of child content._
|
|
3290
|
-
*
|
|
3291
|
-
* Defaults to **undefined**.
|
|
3292
|
-
*/
|
|
3293
|
-
children: an(s.node, "Radio", "Use `label` instead."),
|
|
3294
|
-
/**
|
|
3295
|
-
* The css class name to be passed through to the component markup.
|
|
3296
|
-
*
|
|
3297
|
-
* Defaults to **undefined**.
|
|
3298
|
-
*/
|
|
3299
|
-
className: s.string,
|
|
3300
|
-
/**
|
|
3301
|
-
* Prevents user for interacting with component.
|
|
3302
|
-
*
|
|
3303
|
-
* Defaults to **false**.
|
|
3304
|
-
*/
|
|
3305
|
-
disabled: s.bool,
|
|
3306
|
-
/**
|
|
3307
|
-
* The label not be displayed, but will still be available to screen readers. This should only be used when the context of the radio button is clear and understandable. An example use-case could be as a column in a table where the column header specifies the action.
|
|
3308
|
-
*
|
|
3309
|
-
* Defaults to **false**.
|
|
3310
|
-
*/
|
|
3311
|
-
hideLabel: s.bool,
|
|
3312
|
-
/**
|
|
3313
|
-
* Randomly generated id. May be overwritten.
|
|
3314
|
-
*
|
|
3315
|
-
* Defaults to **undefined**.
|
|
3316
|
-
*/
|
|
3317
|
-
id: s.string,
|
|
3318
|
-
/**
|
|
3319
|
-
* Display label. The `label` should always be set even when using `hideLabel` - it will be used by screen readers.
|
|
3320
|
-
*
|
|
3321
|
-
* Defaults to **null**.
|
|
3322
|
-
*/
|
|
3323
|
-
label: s.string.isRequired,
|
|
3324
|
-
/**
|
|
3325
|
-
* Name of the radio button group.
|
|
3326
|
-
*
|
|
3327
|
-
* Defaults to **null**.
|
|
3328
|
-
*/
|
|
3329
|
-
name: s.string.isRequired,
|
|
3330
|
-
/**
|
|
3331
|
-
* Fired when value of the radio button is changed.
|
|
3332
|
-
*
|
|
3333
|
-
* Defaults to **null**.
|
|
3334
|
-
*/
|
|
3335
|
-
onChange: s.func,
|
|
3336
|
-
/**
|
|
3337
|
-
* Override the default (`primary`) color with the `secondary` color. Most commonly used when the control is placed on a darker surface.
|
|
3338
|
-
*
|
|
3339
|
-
* Defaults to **'primary'**.
|
|
3340
|
-
*/
|
|
3341
|
-
themeColor: s.oneOf(["primary", "secondary", "danger", "success"]),
|
|
3342
|
-
/**
|
|
3343
|
-
* A custom value will be returned as the second parameter of the `change` handler.
|
|
3344
|
-
*
|
|
3345
|
-
* Defaults to **null**.
|
|
3346
|
-
*/
|
|
3347
|
-
value: s.oneOfType([s.string, s.number])
|
|
3348
|
-
}, Ci = {
|
|
3349
|
-
alignEnd: !1,
|
|
3350
|
-
checked: null,
|
|
3351
|
-
children: void 0,
|
|
3352
|
-
className: void 0,
|
|
3353
|
-
disabled: !1,
|
|
3354
|
-
hideLabel: !1,
|
|
3355
|
-
id: void 0,
|
|
3356
|
-
label: null,
|
|
3357
|
-
name: null,
|
|
3358
|
-
themeColor: "primary",
|
|
3359
|
-
value: null
|
|
3360
|
-
}, ft = /* @__PURE__ */ $((i, n) => {
|
|
3361
|
-
const {
|
|
3362
|
-
alignEnd: e,
|
|
3363
|
-
checked: t,
|
|
3364
|
-
children: r,
|
|
3365
|
-
className: o,
|
|
3366
|
-
disabled: a,
|
|
3367
|
-
hideLabel: l,
|
|
3368
|
-
id: u,
|
|
3369
|
-
label: y,
|
|
3370
|
-
name: C,
|
|
3371
|
-
onChange: m,
|
|
3372
|
-
themeColor: E,
|
|
3373
|
-
value: d,
|
|
3374
|
-
...f
|
|
3375
|
-
} = i, [A] = Ae(() => u || qe()), v = oe(), p = oe();
|
|
3376
|
-
ve(n, () => v.current, []);
|
|
3377
|
-
const h = (g) => {
|
|
3378
|
-
if (m) {
|
|
3379
|
-
m(g, d);
|
|
3380
|
-
return;
|
|
3381
|
-
}
|
|
3382
|
-
p.current.checked = g.target.checked;
|
|
3383
|
-
};
|
|
3384
|
-
return P(() => (p.current = gi.attachTo(v.current), () => {
|
|
3385
|
-
var g;
|
|
3386
|
-
(g = p.current) === null || g === void 0 || g.destroy();
|
|
3387
|
-
}), [p]), P(() => {
|
|
3388
|
-
p.current.value = d;
|
|
3389
|
-
}, [d]), P(() => {
|
|
3390
|
-
p.current.checked = t;
|
|
3391
|
-
}, [t]), P(() => {
|
|
3392
|
-
p.current.disabled = a;
|
|
3393
|
-
}, [a]), /* @__PURE__ */ c.createElement(Xe, {
|
|
3394
|
-
alignEnd: e,
|
|
3395
|
-
inputRef: p
|
|
3396
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
3397
|
-
ref: v,
|
|
3398
|
-
className: F("lmnt mdc-radio lmnt-radio", a && "mdc-radio--disabled", E && `lmnt-radio--${E}`, o, "mdc-touch-target-wrapper")
|
|
3399
|
-
}, /* @__PURE__ */ c.createElement("input", U({
|
|
3400
|
-
id: A,
|
|
3401
|
-
onChange: h,
|
|
3402
|
-
disabled: a,
|
|
3403
|
-
name: C,
|
|
3404
|
-
type: "radio",
|
|
3405
|
-
className: "mdc-radio__native-control"
|
|
3406
|
-
}, f)), /* @__PURE__ */ c.createElement("div", {
|
|
3407
|
-
className: "mdc-radio__background"
|
|
3408
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
3409
|
-
className: "mdc-radio__outer-circle"
|
|
3410
|
-
}), /* @__PURE__ */ c.createElement("div", {
|
|
3411
|
-
className: "mdc-radio__inner-circle"
|
|
3412
|
-
})), /* @__PURE__ */ c.createElement("div", {
|
|
3413
|
-
className: "mdc-radio__ripple"
|
|
3414
|
-
})), /* @__PURE__ */ c.createElement(rt, {
|
|
3415
|
-
hideLabel: l,
|
|
3416
|
-
targetId: A,
|
|
3417
|
-
className: F(a && "lmnt-theme-on-surface-disabled"),
|
|
3418
|
-
disabled: a
|
|
3419
|
-
}, y || r));
|
|
3420
|
-
});
|
|
3421
|
-
ft.displayName = "Radio";
|
|
3422
|
-
ft.propTypes = Ti;
|
|
3423
|
-
ft.defaultProps = Ci;
|
|
3424
|
-
/**
|
|
3425
|
-
* @license
|
|
3426
|
-
* Copyright 2018 Google Inc.
|
|
3427
|
-
*
|
|
3428
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3429
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3430
|
-
* in the Software without restriction, including without limitation the rights
|
|
3431
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3432
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3433
|
-
* furnished to do so, subject to the following conditions:
|
|
3434
|
-
*
|
|
3435
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3436
|
-
* all copies or substantial portions of the Software.
|
|
3437
|
-
*
|
|
3438
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3439
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3440
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3441
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3442
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3443
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3444
|
-
* THE SOFTWARE.
|
|
3445
|
-
*/
|
|
3446
|
-
var Qe = {
|
|
3447
|
-
/** Class used for a switch that is in the "checked" (on) position. */
|
|
3448
|
-
CHECKED: "mdc-switch--checked",
|
|
3449
|
-
/** Class used for a switch that is disabled. */
|
|
3450
|
-
DISABLED: "mdc-switch--disabled"
|
|
3451
|
-
}, on = {
|
|
3452
|
-
/** Aria attribute for checked or unchecked state of switch */
|
|
3453
|
-
ARIA_CHECKED_ATTR: "aria-checked",
|
|
3454
|
-
/** A CSS selector used to locate the native HTML control for the switch. */
|
|
3455
|
-
NATIVE_CONTROL_SELECTOR: ".mdc-switch__native-control",
|
|
3456
|
-
/** A CSS selector used to locate the ripple surface element for the switch. */
|
|
3457
|
-
RIPPLE_SURFACE_SELECTOR: ".mdc-switch__thumb-underlay"
|
|
3458
|
-
};
|
|
3459
|
-
/**
|
|
3460
|
-
* @license
|
|
3461
|
-
* Copyright 2018 Google Inc.
|
|
3462
|
-
*
|
|
3463
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3464
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3465
|
-
* in the Software without restriction, including without limitation the rights
|
|
3466
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3467
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3468
|
-
* furnished to do so, subject to the following conditions:
|
|
3469
|
-
*
|
|
3470
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3471
|
-
* all copies or substantial portions of the Software.
|
|
3472
|
-
*
|
|
3473
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3474
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3475
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3476
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3477
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3478
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3479
|
-
* THE SOFTWARE.
|
|
3480
|
-
*/
|
|
3481
|
-
var vt = (
|
|
3482
|
-
/** @class */
|
|
3483
|
-
function(i) {
|
|
3484
|
-
Ee(n, i);
|
|
3485
|
-
function n(e) {
|
|
3486
|
-
return i.call(this, J(J({}, n.defaultAdapter), e)) || this;
|
|
3487
|
-
}
|
|
3488
|
-
return Object.defineProperty(n, "strings", {
|
|
3489
|
-
/** The string constants used by the switch. */
|
|
3490
|
-
get: function() {
|
|
3491
|
-
return on;
|
|
3492
|
-
},
|
|
3493
|
-
enumerable: !1,
|
|
3494
|
-
configurable: !0
|
|
3495
|
-
}), Object.defineProperty(n, "cssClasses", {
|
|
3496
|
-
/** The CSS classes used by the switch. */
|
|
3497
|
-
get: function() {
|
|
3498
|
-
return Qe;
|
|
3499
|
-
},
|
|
3500
|
-
enumerable: !1,
|
|
3501
|
-
configurable: !0
|
|
3502
|
-
}), Object.defineProperty(n, "defaultAdapter", {
|
|
3503
|
-
/** The default Adapter for the switch. */
|
|
3504
|
-
get: function() {
|
|
3505
|
-
return {
|
|
3506
|
-
addClass: function() {
|
|
3507
|
-
},
|
|
3508
|
-
removeClass: function() {
|
|
3509
|
-
},
|
|
3510
|
-
setNativeControlChecked: function() {
|
|
3511
|
-
},
|
|
3512
|
-
setNativeControlDisabled: function() {
|
|
3513
|
-
},
|
|
3514
|
-
setNativeControlAttr: function() {
|
|
3515
|
-
}
|
|
3516
|
-
};
|
|
3517
|
-
},
|
|
3518
|
-
enumerable: !1,
|
|
3519
|
-
configurable: !0
|
|
3520
|
-
}), n.prototype.setChecked = function(e) {
|
|
3521
|
-
this.adapter.setNativeControlChecked(e), this.updateAriaChecked_(e), this.updateCheckedStyling_(e);
|
|
3522
|
-
}, n.prototype.setDisabled = function(e) {
|
|
3523
|
-
this.adapter.setNativeControlDisabled(e), e ? this.adapter.addClass(Qe.DISABLED) : this.adapter.removeClass(Qe.DISABLED);
|
|
3524
|
-
}, n.prototype.handleChange = function(e) {
|
|
3525
|
-
var t = e.target;
|
|
3526
|
-
this.updateAriaChecked_(t.checked), this.updateCheckedStyling_(t.checked);
|
|
3527
|
-
}, n.prototype.updateCheckedStyling_ = function(e) {
|
|
3528
|
-
e ? this.adapter.addClass(Qe.CHECKED) : this.adapter.removeClass(Qe.CHECKED);
|
|
3529
|
-
}, n.prototype.updateAriaChecked_ = function(e) {
|
|
3530
|
-
this.adapter.setNativeControlAttr(on.ARIA_CHECKED_ATTR, "" + !!e);
|
|
3531
|
-
}, n;
|
|
3532
|
-
}(He)
|
|
3533
|
-
);
|
|
3534
|
-
/**
|
|
3535
|
-
* @license
|
|
3536
|
-
* Copyright 2018 Google Inc.
|
|
3537
|
-
*
|
|
3538
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3539
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
3540
|
-
* in the Software without restriction, including without limitation the rights
|
|
3541
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3542
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
3543
|
-
* furnished to do so, subject to the following conditions:
|
|
3544
|
-
*
|
|
3545
|
-
* The above copyright notice and this permission notice shall be included in
|
|
3546
|
-
* all copies or substantial portions of the Software.
|
|
3547
|
-
*
|
|
3548
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3549
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3550
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3551
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3552
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3553
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3554
|
-
* THE SOFTWARE.
|
|
3555
|
-
*/
|
|
3556
|
-
var Ai = (
|
|
3557
|
-
/** @class */
|
|
3558
|
-
function(i) {
|
|
3559
|
-
Ee(n, i);
|
|
3560
|
-
function n() {
|
|
3561
|
-
var e = i !== null && i.apply(this, arguments) || this;
|
|
3562
|
-
return e.ripple_ = e.createRipple_(), e;
|
|
3563
|
-
}
|
|
3564
|
-
return n.attachTo = function(e) {
|
|
3565
|
-
return new n(e);
|
|
3566
|
-
}, n.prototype.destroy = function() {
|
|
3567
|
-
i.prototype.destroy.call(this), this.ripple_.destroy(), this.nativeControl_.removeEventListener("change", this.changeHandler_);
|
|
3568
|
-
}, n.prototype.initialSyncWithDOM = function() {
|
|
3569
|
-
var e = this;
|
|
3570
|
-
this.changeHandler_ = function() {
|
|
3571
|
-
for (var t, r = [], o = 0; o < arguments.length; o++)
|
|
3572
|
-
r[o] = arguments[o];
|
|
3573
|
-
return (t = e.foundation).handleChange.apply(t, Rn([], Dn(r)));
|
|
3574
|
-
}, this.nativeControl_.addEventListener("change", this.changeHandler_), this.checked = this.checked;
|
|
3575
|
-
}, n.prototype.getDefaultFoundation = function() {
|
|
3576
|
-
var e = this, t = {
|
|
3577
|
-
addClass: function(r) {
|
|
3578
|
-
return e.root.classList.add(r);
|
|
3579
|
-
},
|
|
3580
|
-
removeClass: function(r) {
|
|
3581
|
-
return e.root.classList.remove(r);
|
|
3582
|
-
},
|
|
3583
|
-
setNativeControlChecked: function(r) {
|
|
3584
|
-
return e.nativeControl_.checked = r;
|
|
3585
|
-
},
|
|
3586
|
-
setNativeControlDisabled: function(r) {
|
|
3587
|
-
return e.nativeControl_.disabled = r;
|
|
3588
|
-
},
|
|
3589
|
-
setNativeControlAttr: function(r, o) {
|
|
3590
|
-
return e.nativeControl_.setAttribute(r, o);
|
|
3591
|
-
}
|
|
3592
|
-
};
|
|
3593
|
-
return new vt(t);
|
|
3594
|
-
}, Object.defineProperty(n.prototype, "ripple", {
|
|
3595
|
-
get: function() {
|
|
3596
|
-
return this.ripple_;
|
|
3597
|
-
},
|
|
3598
|
-
enumerable: !1,
|
|
3599
|
-
configurable: !0
|
|
3600
|
-
}), Object.defineProperty(n.prototype, "checked", {
|
|
3601
|
-
get: function() {
|
|
3602
|
-
return this.nativeControl_.checked;
|
|
3603
|
-
},
|
|
3604
|
-
set: function(e) {
|
|
3605
|
-
this.foundation.setChecked(e);
|
|
3606
|
-
},
|
|
3607
|
-
enumerable: !1,
|
|
3608
|
-
configurable: !0
|
|
3609
|
-
}), Object.defineProperty(n.prototype, "disabled", {
|
|
3610
|
-
get: function() {
|
|
3611
|
-
return this.nativeControl_.disabled;
|
|
3612
|
-
},
|
|
3613
|
-
set: function(e) {
|
|
3614
|
-
this.foundation.setDisabled(e);
|
|
3615
|
-
},
|
|
3616
|
-
enumerable: !1,
|
|
3617
|
-
configurable: !0
|
|
3618
|
-
}), n.prototype.createRipple_ = function() {
|
|
3619
|
-
var e = this, t = vt.strings.RIPPLE_SURFACE_SELECTOR, r = this.root.querySelector(t), o = J(J({}, je.createAdapter(this)), { addClass: function(a) {
|
|
3620
|
-
return r.classList.add(a);
|
|
3621
|
-
}, computeBoundingRect: function() {
|
|
3622
|
-
return r.getBoundingClientRect();
|
|
3623
|
-
}, deregisterInteractionHandler: function(a, l) {
|
|
3624
|
-
e.nativeControl_.removeEventListener(a, l, $e());
|
|
3625
|
-
}, isSurfaceActive: function() {
|
|
3626
|
-
return ke(e.nativeControl_, ":active");
|
|
3627
|
-
}, isUnbounded: function() {
|
|
3628
|
-
return !0;
|
|
3629
|
-
}, registerInteractionHandler: function(a, l) {
|
|
3630
|
-
e.nativeControl_.addEventListener(a, l, $e());
|
|
3631
|
-
}, removeClass: function(a) {
|
|
3632
|
-
r.classList.remove(a);
|
|
3633
|
-
}, updateCssVariable: function(a, l) {
|
|
3634
|
-
r.style.setProperty(a, l);
|
|
3635
|
-
} });
|
|
3636
|
-
return new je(this.root, new Rt(o));
|
|
3637
|
-
}, Object.defineProperty(n.prototype, "nativeControl_", {
|
|
3638
|
-
get: function() {
|
|
3639
|
-
var e = vt.strings.NATIVE_CONTROL_SELECTOR;
|
|
3640
|
-
return this.root.querySelector(e);
|
|
3641
|
-
},
|
|
3642
|
-
enumerable: !1,
|
|
3643
|
-
configurable: !0
|
|
3644
|
-
}), n;
|
|
3645
|
-
}(Ke)
|
|
3646
|
-
);
|
|
3647
|
-
const vi = {
|
|
3648
|
-
/**
|
|
3649
|
-
* Aligns switch to the right of the label.
|
|
3650
|
-
*
|
|
3651
|
-
* Defaults to **false**.
|
|
3652
|
-
*/
|
|
3653
|
-
alignEnd: s.bool,
|
|
3654
|
-
/**
|
|
3655
|
-
* The current value of the switch.
|
|
3656
|
-
*
|
|
3657
|
-
* Defaults to **false**.
|
|
3658
|
-
*/
|
|
3659
|
-
checked: s.bool,
|
|
3660
|
-
/**
|
|
3661
|
-
* @deprecated _Use `label` instead._
|
|
3662
|
-
*
|
|
3663
|
-
* Primary content of the switch. Expects a valid string. If `children` and `label` are both set, `label` will take priority.
|
|
3664
|
-
*
|
|
3665
|
-
* Defaults to **undefined**.
|
|
3666
|
-
*/
|
|
3667
|
-
children: an(s.node, "Switch", "Use `label` instead."),
|
|
3668
|
-
/**
|
|
3669
|
-
* The css class name to be passed through to the component markup.
|
|
3670
|
-
*
|
|
3671
|
-
* Defaults to **undefined**.
|
|
3672
|
-
*/
|
|
3673
|
-
className: s.string,
|
|
3674
|
-
/**
|
|
3675
|
-
* Prevent the user from interacting with the control.
|
|
3676
|
-
*
|
|
3677
|
-
* Defaults to **false**.
|
|
3678
|
-
*/
|
|
3679
|
-
disabled: s.bool,
|
|
3680
|
-
/**
|
|
3681
|
-
* The label not be displayed, but will still be available to screen readers.
|
|
3682
|
-
*
|
|
3683
|
-
* Defaults to **false**.
|
|
3684
|
-
*/
|
|
3685
|
-
hideLabel: s.bool,
|
|
3686
|
-
/**
|
|
3687
|
-
* The html id for the input.
|
|
3688
|
-
*
|
|
3689
|
-
* Defaults to **undefined**.
|
|
3690
|
-
*/
|
|
3691
|
-
id: s.string,
|
|
3692
|
-
/**
|
|
3693
|
-
* Props to send to the html input
|
|
3694
|
-
*
|
|
3695
|
-
* Defaults to **undefined**.
|
|
3696
|
-
*/
|
|
3697
|
-
inputProps: s.object,
|
|
3698
|
-
/**
|
|
3699
|
-
* Display label. The `label` should always be set even when using `hideLabel` - it will be used by screen readers.
|
|
3700
|
-
*
|
|
3701
|
-
* Defaults to **'Off|On'**.
|
|
3702
|
-
*/
|
|
3703
|
-
label: s.string.isRequired,
|
|
3704
|
-
/**
|
|
3705
|
-
* Fired when the control is clicked.
|
|
3706
|
-
*
|
|
3707
|
-
* Defaults to **null**.
|
|
3708
|
-
*/
|
|
3709
|
-
onChange: s.func,
|
|
3710
|
-
/**
|
|
3711
|
-
* Color of the switch according to the theme.
|
|
3712
|
-
*
|
|
3713
|
-
* Defaults to **'primary'**.
|
|
3714
|
-
*/
|
|
3715
|
-
themeColor: s.oneOf(["primary", "secondary", "danger", "success"]),
|
|
3716
|
-
/**
|
|
3717
|
-
* When a switch button is checked, this value will be returned as the second parameter of the `change` handler.
|
|
3718
|
-
*
|
|
3719
|
-
* Defaults to **null**.
|
|
3720
|
-
*/
|
|
3721
|
-
value: s.oneOfType([s.string, s.number, s.bool, s.object])
|
|
3722
|
-
}, bi = {
|
|
3723
|
-
alignEnd: !1,
|
|
3724
|
-
checked: !1,
|
|
3725
|
-
children: void 0,
|
|
3726
|
-
className: void 0,
|
|
3727
|
-
disabled: !1,
|
|
3728
|
-
hideLabel: !1,
|
|
3729
|
-
id: void 0,
|
|
3730
|
-
inputProps: void 0,
|
|
3731
|
-
label: "Off|On",
|
|
3732
|
-
themeColor: "primary",
|
|
3733
|
-
value: null
|
|
3734
|
-
}, ht = /* @__PURE__ */ $((i, n) => {
|
|
3735
|
-
const {
|
|
3736
|
-
alignEnd: e,
|
|
3737
|
-
checked: t,
|
|
3738
|
-
children: r,
|
|
3739
|
-
className: o,
|
|
3740
|
-
disabled: a,
|
|
3741
|
-
hideLabel: l,
|
|
3742
|
-
id: u,
|
|
3743
|
-
inputProps: y,
|
|
3744
|
-
label: C,
|
|
3745
|
-
onChange: m,
|
|
3746
|
-
themeColor: E,
|
|
3747
|
-
value: d,
|
|
3748
|
-
...f
|
|
3749
|
-
} = i, [A] = Ae(() => u || qe()), v = oe(), p = oe(), h = C || r;
|
|
3750
|
-
ve(n, () => v.current, []);
|
|
3751
|
-
const g = (b) => {
|
|
3752
|
-
m?.(b.target.checked, d, b);
|
|
3753
|
-
};
|
|
3754
|
-
return P(() => (p.current = Ai.attachTo(v.current), () => {
|
|
3755
|
-
var b;
|
|
3756
|
-
(b = p.current) === null || b === void 0 || b.destroy();
|
|
3757
|
-
}), []), P(() => {
|
|
3758
|
-
p.current.checked = !!t;
|
|
3759
|
-
}, [t]), /* @__PURE__ */ c.createElement(Xe, {
|
|
3760
|
-
inputRef: p,
|
|
3761
|
-
alignEnd: e
|
|
3762
|
-
}, /* @__PURE__ */ c.createElement("div", U({
|
|
3763
|
-
ref: v,
|
|
3764
|
-
className: F("lmnt mdc-switch lmnt-switch", a && "mdc-switch--disabled", E && `lmnt-switch--${E}`, o)
|
|
3765
|
-
}, f), /* @__PURE__ */ c.createElement("div", {
|
|
3766
|
-
className: "mdc-switch__track"
|
|
3767
|
-
}), /* @__PURE__ */ c.createElement("div", {
|
|
3768
|
-
className: "mdc-switch__thumb-underlay"
|
|
3769
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
3770
|
-
className: "mdc-switch__thumb"
|
|
3771
|
-
}), /* @__PURE__ */ c.createElement("input", U({
|
|
3772
|
-
onChange: g,
|
|
3773
|
-
disabled: a,
|
|
3774
|
-
type: "checkbox",
|
|
3775
|
-
id: A,
|
|
3776
|
-
role: "switch"
|
|
3777
|
-
}, y, {
|
|
3778
|
-
className: F("mdc-switch__native-control", y?.className),
|
|
3779
|
-
value: d
|
|
3780
|
-
})))), /* @__PURE__ */ c.createElement("label", {
|
|
3781
|
-
className: F("lmnt-switch-label mdc-switch-label", l && "sr-only"),
|
|
3782
|
-
htmlFor: A
|
|
3783
|
-
}, h));
|
|
3784
|
-
});
|
|
3785
|
-
ht.displayName = "Switch";
|
|
3786
|
-
ht.propTypes = vi;
|
|
3787
|
-
ht.SwitchDefaultProps = bi;
|
|
3788
|
-
const pt = /* @__PURE__ */ ln({}), En = {
|
|
3789
|
-
/**
|
|
3790
|
-
* Name of the key for category ID in `items`.
|
|
3791
|
-
*
|
|
3792
|
-
* Defaults to **'id'**.
|
|
3793
|
-
*/
|
|
3794
|
-
categoryIdKey: s.string,
|
|
3795
|
-
/**
|
|
3796
|
-
* Name of the key for category name in `items`.
|
|
3797
|
-
*
|
|
3798
|
-
* Defaults to **'categoryName'**.
|
|
3799
|
-
*/
|
|
3800
|
-
categoryNameKey: s.string,
|
|
3801
|
-
/**
|
|
3802
|
-
* List content. Expects a 'ListItem'.
|
|
3803
|
-
*
|
|
3804
|
-
* Defaults to **null**.
|
|
3805
|
-
*/
|
|
3806
|
-
children: s.node,
|
|
3807
|
-
/**
|
|
3808
|
-
* Name of the key for group ID in `items`. custom props to apply to each list item.
|
|
3809
|
-
*
|
|
3810
|
-
* Defaults to **'componentProps'**.
|
|
3811
|
-
*/
|
|
3812
|
-
componentPropsKey: s.string,
|
|
3813
|
-
/**
|
|
3814
|
-
* Reduced height of list items.
|
|
3815
|
-
*
|
|
3816
|
-
* Defaults to **false**.
|
|
3817
|
-
*/
|
|
3818
|
-
dense: s.bool,
|
|
3819
|
-
/**
|
|
3820
|
-
* Variant of divider padding.
|
|
3821
|
-
*
|
|
3822
|
-
* Defaults to **'full'**.
|
|
3823
|
-
*/
|
|
3824
|
-
dividerVariant: s.oneOf(["full", "padded", "inset", "insetPadded"]),
|
|
3825
|
-
/**
|
|
3826
|
-
* Name of the key for group ID in `items`.
|
|
3827
|
-
*
|
|
3828
|
-
* Defaults to **'id'**.
|
|
3829
|
-
*/
|
|
3830
|
-
groupIdKey: s.string,
|
|
3831
|
-
/**
|
|
3832
|
-
* Name of the key for group name in `items`.
|
|
3833
|
-
*
|
|
3834
|
-
* Defaults to **'groupName'**.
|
|
3835
|
-
*/
|
|
3836
|
-
groupNameKey: s.string,
|
|
3837
|
-
/**
|
|
3838
|
-
* Name of the key for the id of the item in `items`.
|
|
3839
|
-
*
|
|
3840
|
-
* Defaults to **'id'**.
|
|
3841
|
-
*/
|
|
3842
|
-
itemIdKey: s.string,
|
|
3843
|
-
/**
|
|
3844
|
-
* An array of objects to be rendered as `ListItems`. If `items` is set children will be ignored.
|
|
3845
|
-
*
|
|
3846
|
-
* Defaults to **null**.
|
|
3847
|
-
*/
|
|
3848
|
-
items: s.oneOfType([s.arrayOf(s.object), s.arrayOf(s.string)]),
|
|
3849
|
-
/**
|
|
3850
|
-
* Name of the key for `items` in list schema.
|
|
3851
|
-
*
|
|
3852
|
-
* Defaults to **'items'**.
|
|
3853
|
-
*/
|
|
3854
|
-
itemsKey: s.string,
|
|
3855
|
-
/**
|
|
3856
|
-
* The type of media that will render in the leading block of the `ListItems`. See README for size constraints. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
3857
|
-
*
|
|
3858
|
-
* Defaults to **undefined**.
|
|
3859
|
-
*/
|
|
3860
|
-
leadingBlockType: s.oneOf(["", "avatar", "checkbox", "icon", "image", "lgImage", "radio", "switch", "thumbnail"]),
|
|
3861
|
-
/**
|
|
3862
|
-
* Enables support for lists of navigation links. Each list item will be rendered as an anchor element by default unless overridden via the `component` prop on each list item.
|
|
3863
|
-
*
|
|
3864
|
-
* Defaults to **false**.
|
|
3865
|
-
*/
|
|
3866
|
-
navigation: s.bool,
|
|
3867
|
-
/**
|
|
3868
|
-
* Use for a list that does not require interaction.
|
|
3869
|
-
*
|
|
3870
|
-
* Defaults to **false**.
|
|
3871
|
-
*/
|
|
3872
|
-
nonInteractive: s.bool,
|
|
3873
|
-
/**
|
|
3874
|
-
* Fired when a List Item is activated.
|
|
3875
|
-
*
|
|
3876
|
-
* Defaults to **null**.
|
|
3877
|
-
*/
|
|
3878
|
-
onAction: s.func,
|
|
3879
|
-
/**
|
|
3880
|
-
* Name of the key for `overlineText` in `items`.
|
|
3881
|
-
*
|
|
3882
|
-
* Defaults to **'overlineText'**.
|
|
3883
|
-
*/
|
|
3884
|
-
overlineTextKey: s.string,
|
|
3885
|
-
/**
|
|
3886
|
-
* Name of the key for `primaryText` in `items`.
|
|
3887
|
-
*
|
|
3888
|
-
* Defaults to **'primaryText'**.
|
|
3889
|
-
*/
|
|
3890
|
-
primaryTextKey: s.string,
|
|
3891
|
-
/**
|
|
3892
|
-
* The aria role of the list. For selection list use `listbox`. For menu list use `menu`. For radio list use `radiogroup`. For checkbox list use `group`. For non-interactive list do not set.
|
|
3893
|
-
*
|
|
3894
|
-
* Defaults to **'listbox'**.
|
|
3895
|
-
*/
|
|
3896
|
-
role: s.oneOf(["", "listbox", "menu", "radiogroup", "group"]),
|
|
3897
|
-
/**
|
|
3898
|
-
* Name of the key for `secondaryText` in `items`.
|
|
3899
|
-
*
|
|
3900
|
-
* Defaults to **'secondaryText'**.
|
|
3901
|
-
*/
|
|
3902
|
-
secondaryTextKey: s.string,
|
|
3903
|
-
/**
|
|
3904
|
-
* Item or array of selected `ListItems`.
|
|
3905
|
-
*
|
|
3906
|
-
* Defaults to **null**.
|
|
3907
|
-
*/
|
|
3908
|
-
selected: s.oneOfType([s.string, s.number, s.object, s.arrayOf(s.string), s.arrayOf(s.number), s.arrayOf(s.object)]),
|
|
3909
|
-
/**
|
|
3910
|
-
* Whether or not to show a divider between list items, groups, or categories.
|
|
3911
|
-
*
|
|
3912
|
-
* Defaults to **true**.
|
|
3913
|
-
*/
|
|
3914
|
-
showDivider: s.bool,
|
|
3915
|
-
/**
|
|
3916
|
-
* When true group and category lists will be treated like one list for single selection type lists.
|
|
3917
|
-
*
|
|
3918
|
-
* Defaults to **true**.
|
|
3919
|
-
*/
|
|
3920
|
-
singleList: s.bool,
|
|
3921
|
-
/**
|
|
3922
|
-
* Customized background color.
|
|
3923
|
-
*
|
|
3924
|
-
* Defaults to **empty string**.
|
|
3925
|
-
*/
|
|
3926
|
-
themeColor: s.oneOf(["", "surface", "primary", "secondary"]),
|
|
3927
|
-
/**
|
|
3928
|
-
* The type of media that will render in the trailing block of the `ListItems`. See README for size constraints. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
3929
|
-
*
|
|
3930
|
-
* Defaults to **undefined**.
|
|
3931
|
-
*/
|
|
3932
|
-
trailingBlockType: s.oneOf(["", "avatar", "badge", "checkbox", "icon", "image", "lgImage", "meta", "radio", "switch", "thumbnail"]),
|
|
3933
|
-
/**
|
|
3934
|
-
* Allows keyboard navigation to jump to the top or bottom of the list to enable continuous navigation.
|
|
3935
|
-
*
|
|
3936
|
-
* Defaults to **true**.
|
|
3937
|
-
*/
|
|
3938
|
-
wrapFocus: s.bool
|
|
3939
|
-
}, In = {
|
|
3940
|
-
categoryIdKey: "id",
|
|
3941
|
-
categoryNameKey: "categoryName",
|
|
3942
|
-
children: null,
|
|
3943
|
-
componentPropsKey: "componentProps",
|
|
3944
|
-
dense: !1,
|
|
3945
|
-
dividerVariant: "full",
|
|
3946
|
-
groupIdKey: "id",
|
|
3947
|
-
groupNameKey: "groupName",
|
|
3948
|
-
itemIdKey: "id",
|
|
3949
|
-
items: null,
|
|
3950
|
-
itemsKey: "items",
|
|
3951
|
-
leadingBlockType: void 0,
|
|
3952
|
-
navigation: !1,
|
|
3953
|
-
nonInteractive: !1,
|
|
3954
|
-
overlineTextKey: "overlineText",
|
|
3955
|
-
primaryTextKey: "primaryText",
|
|
3956
|
-
role: "listbox",
|
|
3957
|
-
secondaryTextKey: "secondaryText",
|
|
3958
|
-
selected: null,
|
|
3959
|
-
showDivider: !0,
|
|
3960
|
-
singleList: !0,
|
|
3961
|
-
themeColor: "",
|
|
3962
|
-
trailingBlockType: void 0,
|
|
3963
|
-
wrapFocus: !0
|
|
3964
|
-
}, Si = {
|
|
3965
|
-
/**
|
|
3966
|
-
* Variant of the divider padding.
|
|
3967
|
-
*
|
|
3968
|
-
* Defaults to **'full'**.
|
|
3969
|
-
*/
|
|
3970
|
-
variant: s.oneOf(["full", "padded", "inset", "insetPadded"])
|
|
3971
|
-
}, Oi = {
|
|
3972
|
-
variant: "full"
|
|
3973
|
-
}, xi = {
|
|
3974
|
-
/**
|
|
3975
|
-
* Expects one or more List or ListGroupSubHeader.
|
|
3976
|
-
*
|
|
3977
|
-
* Defaults to **null**.
|
|
3978
|
-
*/
|
|
3979
|
-
children: s.node
|
|
3980
|
-
}, Li = {
|
|
3981
|
-
children: null
|
|
3982
|
-
}, Ni = {}, Ri = {};
|
|
3983
|
-
s.node;
|
|
3984
|
-
const Di = {
|
|
3985
|
-
/**
|
|
3986
|
-
* Alternate styling for selected interactive items without a control. Activation represents a status with more permanence (e.g., current page in a navigation list).
|
|
3987
|
-
*
|
|
3988
|
-
* Defaults to **false**.
|
|
3989
|
-
*/
|
|
3990
|
-
activated: s.bool,
|
|
3991
|
-
/**
|
|
3992
|
-
* Whether or not the list item's radio or checkbox is selected for radio or checkbox lists.
|
|
3993
|
-
*
|
|
3994
|
-
* Defaults to **false**.
|
|
3995
|
-
*/
|
|
3996
|
-
ariaChecked: s.bool,
|
|
3997
|
-
/**
|
|
3998
|
-
* Content to be rendered inside the list item content block. Most often a string, but accepts any valid markup. When using primaryText, secondaryText or overlineText the children will be ignored.
|
|
3999
|
-
*
|
|
4000
|
-
* Defaults to **null**.
|
|
4001
|
-
*/
|
|
4002
|
-
children: s.node,
|
|
4003
|
-
/**
|
|
4004
|
-
* Tells list item not to put selected class to add background to the list item.
|
|
4005
|
-
*
|
|
4006
|
-
* Defaults to **false**.
|
|
4007
|
-
*/
|
|
4008
|
-
disableHighlight: s.bool,
|
|
4009
|
-
/**
|
|
4010
|
-
* Disable interaction for the ListItem within an interactive List.
|
|
4011
|
-
*
|
|
4012
|
-
* Defaults to **false**.
|
|
4013
|
-
*/
|
|
4014
|
-
disabled: s.bool,
|
|
4015
|
-
/**
|
|
4016
|
-
* Used with Select.
|
|
4017
|
-
*
|
|
4018
|
-
* Defaults to **false**.
|
|
4019
|
-
*/
|
|
4020
|
-
isChildOption: s.bool,
|
|
4021
|
-
/**
|
|
4022
|
-
* Content to be displayed in the leading block container. See README for types supported. If a string is sent for a control type, it will used for the `name` attribute on the control. For radio type controls, send the same name for every item.
|
|
4023
|
-
*
|
|
4024
|
-
* Defaults to **null**.
|
|
4025
|
-
*/
|
|
4026
|
-
leadingBlock: s.node,
|
|
4027
|
-
/**
|
|
4028
|
-
* The type of media that will render in the leading block. See README for size constraints. If `leadingBlockType` is set on the parent List, it will take precedence. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
4029
|
-
*
|
|
4030
|
-
* Defaults to **empty string**.
|
|
4031
|
-
*/
|
|
4032
|
-
leadingBlockType: s.oneOf(["", "avatar", "checkbox", "icon", "image", "lgImage", "radio", "switch", "thumbnail"]),
|
|
4033
|
-
/**
|
|
4034
|
-
* A hover style will not be applied.
|
|
4035
|
-
*
|
|
4036
|
-
* Defaults to **false**.
|
|
4037
|
-
*/
|
|
4038
|
-
noHover: s.bool,
|
|
4039
|
-
/**
|
|
4040
|
-
* Used within a list that does not require interaction. See `disabled` for disabling an item within an interactive list.
|
|
4041
|
-
*
|
|
4042
|
-
* Defaults to **false**.
|
|
4043
|
-
*/
|
|
4044
|
-
nonInteractive: s.bool,
|
|
4045
|
-
/**
|
|
4046
|
-
* Fired when the user clicks the ListItem. Returns the event as the first argument and any specified value as the second argument.
|
|
4047
|
-
*
|
|
4048
|
-
* Defaults to **null**.
|
|
4049
|
-
*/
|
|
4050
|
-
onClick: s.func,
|
|
4051
|
-
/**
|
|
4052
|
-
* Fired when the user presses a key down.
|
|
4053
|
-
*
|
|
4054
|
-
* Defaults to **null**.
|
|
4055
|
-
*/
|
|
4056
|
-
onKeyPress: s.func,
|
|
4057
|
-
/**
|
|
4058
|
-
* Text that will appear above the standard text.
|
|
4059
|
-
*
|
|
4060
|
-
* Defaults to **null**.
|
|
4061
|
-
*/
|
|
4062
|
-
overlineText: s.node,
|
|
4063
|
-
/**
|
|
4064
|
-
* Standard list text.
|
|
4065
|
-
*
|
|
4066
|
-
* Defaults to **null**.
|
|
4067
|
-
*/
|
|
4068
|
-
primaryText: s.node,
|
|
4069
|
-
/**
|
|
4070
|
-
* Text that will appear below the standard text.
|
|
4071
|
-
*
|
|
4072
|
-
* Defaults to **null**.
|
|
4073
|
-
*/
|
|
4074
|
-
secondaryText: s.node,
|
|
4075
|
-
/**
|
|
4076
|
-
* A selected style will be applied. Selection represents a choice that might change frequently (e.g., option in a list). Required by selected interactive items without a control.
|
|
4077
|
-
*
|
|
4078
|
-
* Defaults to **false**.
|
|
4079
|
-
*/
|
|
4080
|
-
selected: s.bool,
|
|
4081
|
-
/**
|
|
4082
|
-
* Component to be rendered as each list item. Normal lists use `li` elements, nav lists use `a` elements. You would use this for example if you want to use a router link component as each list item.
|
|
4083
|
-
*
|
|
4084
|
-
* Defaults to **null**.
|
|
4085
|
-
*/
|
|
4086
|
-
tag: s.oneOfType([s.string, s.elementType, s.instanceOf(c.Component)]),
|
|
4087
|
-
/**
|
|
4088
|
-
* Customized background color.
|
|
4089
|
-
*
|
|
4090
|
-
* Defaults to **empty string**.
|
|
4091
|
-
*/
|
|
4092
|
-
themeColor: s.oneOf(["", "surface", "primary", "secondary"]),
|
|
4093
|
-
/**
|
|
4094
|
-
* Content to be displayed in the trailing block container. See README for types supported. If a string is sent for a control type, it will used for the `name` attribute on the control. For radio type controls, send the same name for every item.
|
|
4095
|
-
*
|
|
4096
|
-
* Defaults to **null**.
|
|
4097
|
-
*/
|
|
4098
|
-
trailingBlock: s.node,
|
|
4099
|
-
/**
|
|
4100
|
-
* The type of media that will render in the trailing block. See README for size constraints. If `trailingBlockType` is set on the parent List, it will take precedence. If `leadingBlockType` and `trailingBlockType` are both set to a control type (checkbox, radio or switch) `trailingBlockType` will be ignored.
|
|
4101
|
-
*
|
|
4102
|
-
* Defaults to **undefined**.
|
|
4103
|
-
*/
|
|
4104
|
-
trailingBlockType: s.oneOf(["", "avatar", "badge", "checkbox", "icon", "image", "lgImage", "meta", "radio", "switch", "thumbnail"]),
|
|
4105
|
-
/**
|
|
4106
|
-
* A custom value to be returned as the second onClick argument.
|
|
4107
|
-
*
|
|
4108
|
-
* Defaults to **null**.
|
|
4109
|
-
*/
|
|
4110
|
-
value: s.node,
|
|
4111
|
-
/**
|
|
4112
|
-
* Used to adjust the padding of the `ListItem` when used as a category or group header.
|
|
4113
|
-
*
|
|
4114
|
-
* Defaults to **'standard'**.
|
|
4115
|
-
*/
|
|
4116
|
-
variant: s.oneOf(["standard", "category", "group"]),
|
|
4117
|
-
/**
|
|
4118
|
-
* Determines the text wrapping mode of the list item: `wrap` will wrap text like normal, `truncate` will truncate text with an ellipsis and `noWrap` will truncate the text by clipping.
|
|
4119
|
-
*
|
|
4120
|
-
* Defaults to **'wrap'**.
|
|
4121
|
-
*/
|
|
4122
|
-
wrapMode: s.oneOf(["wrap", "noWrap", "truncate"])
|
|
4123
|
-
}, Mi = {
|
|
4124
|
-
activated: !1,
|
|
4125
|
-
ariaChecked: !1,
|
|
4126
|
-
children: null,
|
|
4127
|
-
disableHighlight: !1,
|
|
4128
|
-
disabled: !1,
|
|
4129
|
-
isChildOption: !1,
|
|
4130
|
-
leadingBlock: null,
|
|
4131
|
-
leadingBlockType: "",
|
|
4132
|
-
noHover: !1,
|
|
4133
|
-
nonInteractive: !1,
|
|
4134
|
-
overlineText: null,
|
|
4135
|
-
primaryText: null,
|
|
4136
|
-
secondaryText: null,
|
|
4137
|
-
selected: !1,
|
|
4138
|
-
tag: null,
|
|
4139
|
-
themeColor: "",
|
|
4140
|
-
trailingBlock: null,
|
|
4141
|
-
trailingBlockType: void 0,
|
|
4142
|
-
value: null,
|
|
4143
|
-
variant: "standard",
|
|
4144
|
-
wrapMode: "wrap"
|
|
4145
|
-
}, Pi = {
|
|
4146
|
-
/**
|
|
4147
|
-
* Content to be rendered inside the list item primary text content block. Most often a string, but accepts any valid markup. When using primaryText, secondaryText or overlineText the children will be ignored.
|
|
4148
|
-
*
|
|
4149
|
-
* Defaults to **null**.
|
|
4150
|
-
*/
|
|
4151
|
-
children: s.node,
|
|
4152
|
-
/**
|
|
4153
|
-
* Text that will appear above the standard text.
|
|
4154
|
-
*
|
|
4155
|
-
* Defaults to **null**.
|
|
4156
|
-
*/
|
|
4157
|
-
overlineText: s.node,
|
|
4158
|
-
/**
|
|
4159
|
-
* Standard list text. `children` may also be used but will require additional styling. Use `primaryText` instead of `children` when using overline or secondary text.
|
|
4160
|
-
*
|
|
4161
|
-
* Defaults to **null**.
|
|
4162
|
-
*/
|
|
4163
|
-
primaryText: s.node,
|
|
4164
|
-
/**
|
|
4165
|
-
* Text that will appear below the standard text.
|
|
4166
|
-
*
|
|
4167
|
-
* Defaults to **null**.
|
|
4168
|
-
*/
|
|
4169
|
-
secondaryText: s.node
|
|
4170
|
-
}, ki = {
|
|
4171
|
-
children: null,
|
|
4172
|
-
overlineText: null,
|
|
4173
|
-
primaryText: null,
|
|
4174
|
-
secondaryText: null
|
|
4175
|
-
}, wi = {
|
|
4176
|
-
/**
|
|
4177
|
-
* Media or control to be rendered in the List Item's Leading Block
|
|
4178
|
-
*
|
|
4179
|
-
* Defaults to **null**.
|
|
4180
|
-
*/
|
|
4181
|
-
children: s.node
|
|
4182
|
-
}, Bi = {
|
|
4183
|
-
children: null
|
|
4184
|
-
}, Fi = {
|
|
4185
|
-
/**
|
|
4186
|
-
* Expects a string but accepts any valid markup or components.
|
|
4187
|
-
*
|
|
4188
|
-
* Defaults to **null**.
|
|
4189
|
-
*/
|
|
4190
|
-
children: s.node
|
|
4191
|
-
}, Hi = {
|
|
4192
|
-
children: null
|
|
4193
|
-
}, Ki = {
|
|
4194
|
-
/**
|
|
4195
|
-
* Expects a string but accepts any valid markup or components.
|
|
4196
|
-
*
|
|
4197
|
-
* Defaults to **null**.
|
|
4198
|
-
*/
|
|
4199
|
-
children: s.node
|
|
4200
|
-
}, Ui = {
|
|
4201
|
-
children: null
|
|
4202
|
-
}, Gi = {
|
|
4203
|
-
/**
|
|
4204
|
-
* Expects a string but accepts any valid markup or components.
|
|
4205
|
-
*
|
|
4206
|
-
* Defaults to **null**.
|
|
4207
|
-
*/
|
|
4208
|
-
children: s.node
|
|
4209
|
-
}, Wi = {
|
|
4210
|
-
children: null
|
|
4211
|
-
}, ji = {
|
|
4212
|
-
/**
|
|
4213
|
-
* Media, control or text to be rendered in the List Item's Trailing Block
|
|
4214
|
-
*
|
|
4215
|
-
* Defaults to **null**.
|
|
4216
|
-
*/
|
|
4217
|
-
children: s.node
|
|
4218
|
-
}, $i = {
|
|
4219
|
-
children: null
|
|
4220
|
-
}, Vi = {
|
|
4221
|
-
/**
|
|
4222
|
-
* The List Items to be rendered in the Lists. If `items` is set children will be ignored.
|
|
4223
|
-
*
|
|
4224
|
-
* Defaults to **null**.
|
|
4225
|
-
*/
|
|
4226
|
-
items: s.oneOfType([s.arrayOf(s.object), s.arrayOf(s.string)])
|
|
4227
|
-
}, qi = {
|
|
4228
|
-
items: null
|
|
4229
|
-
}, Xi = {}, zi = {}, mt = /* @__PURE__ */ $((i, n) => {
|
|
4230
|
-
const {
|
|
4231
|
-
children: e,
|
|
4232
|
-
className: t,
|
|
4233
|
-
...r
|
|
4234
|
-
} = i;
|
|
4235
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4236
|
-
ref: n,
|
|
4237
|
-
className: F("lmnt", "mdc-list-item__overline-text", t)
|
|
4238
|
-
}, r), e);
|
|
4239
|
-
});
|
|
4240
|
-
mt.displayName = "ListItemOverline";
|
|
4241
|
-
mt.propTypes = Fi;
|
|
4242
|
-
mt.defaultProps = Hi;
|
|
4243
|
-
const Et = /* @__PURE__ */ $((i, n) => {
|
|
4244
|
-
const {
|
|
4245
|
-
children: e,
|
|
4246
|
-
className: t,
|
|
4247
|
-
...r
|
|
4248
|
-
} = i;
|
|
4249
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4250
|
-
ref: n,
|
|
4251
|
-
className: F("lmnt", "mdc-list-item__secondary-text", t)
|
|
4252
|
-
}, r), e);
|
|
4253
|
-
});
|
|
4254
|
-
Et.displayName = "ListItemSecondaryText";
|
|
4255
|
-
Et.defaultProps = Wi;
|
|
4256
|
-
Et.propTypes = Gi;
|
|
4257
|
-
const It = /* @__PURE__ */ $((i, n) => {
|
|
4258
|
-
const {
|
|
4259
|
-
children: e,
|
|
4260
|
-
className: t,
|
|
4261
|
-
...r
|
|
4262
|
-
} = i;
|
|
4263
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4264
|
-
ref: n,
|
|
4265
|
-
className: F("lmnt", "mdc-list-item__primary-text", t)
|
|
4266
|
-
}, r), e);
|
|
4267
|
-
});
|
|
4268
|
-
It.displayName = "ListItemPrimaryText";
|
|
4269
|
-
It.propTypes = Ki;
|
|
4270
|
-
It.defaultProps = Ui;
|
|
4271
|
-
const _t = /* @__PURE__ */ $((i, n) => {
|
|
4272
|
-
const {
|
|
4273
|
-
overlineText: e,
|
|
4274
|
-
primaryText: t,
|
|
4275
|
-
secondaryText: r,
|
|
4276
|
-
children: o,
|
|
4277
|
-
className: a,
|
|
4278
|
-
...l
|
|
4279
|
-
} = i;
|
|
4280
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4281
|
-
ref: n,
|
|
4282
|
-
className: F("lmnt", "mdc-list-item__content", a)
|
|
4283
|
-
}, l), e && /* @__PURE__ */ c.createElement(mt, null, e), t && /* @__PURE__ */ c.createElement(It, null, t), r && /* @__PURE__ */ c.createElement(Et, null, r));
|
|
4284
|
-
});
|
|
4285
|
-
_t.displayName = "ListItemContent";
|
|
4286
|
-
_t.propTypes = Pi;
|
|
4287
|
-
_t.defaultProps = ki;
|
|
4288
|
-
const yt = /* @__PURE__ */ $((i, n) => {
|
|
4289
|
-
const {
|
|
4290
|
-
children: e,
|
|
4291
|
-
className: t,
|
|
4292
|
-
...r
|
|
4293
|
-
} = i;
|
|
4294
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4295
|
-
ref: n,
|
|
4296
|
-
className: F("mdc-list-item__start", t)
|
|
4297
|
-
}, r), e);
|
|
4298
|
-
});
|
|
4299
|
-
yt.displayName = "ListItemLeadingBlock";
|
|
4300
|
-
yt.propTypes = wi;
|
|
4301
|
-
yt.defaultProps = Bi;
|
|
4302
|
-
const gt = /* @__PURE__ */ $((i, n) => {
|
|
4303
|
-
const {
|
|
4304
|
-
children: e,
|
|
4305
|
-
className: t,
|
|
4306
|
-
...r
|
|
4307
|
-
} = i;
|
|
4308
|
-
return /* @__PURE__ */ c.createElement("span", U({
|
|
4309
|
-
ref: n,
|
|
4310
|
-
className: F("lmnt", "mdc-list-item__end", t)
|
|
4311
|
-
}, r), e);
|
|
4312
|
-
});
|
|
4313
|
-
gt.displayName = "ListItemTrailingBlock";
|
|
4314
|
-
gt.propTypes = ji;
|
|
4315
|
-
gt.defaultProps = $i;
|
|
4316
|
-
const Ve = /* @__PURE__ */ $((i, n) => {
|
|
4317
|
-
const {
|
|
4318
|
-
activated: e,
|
|
4319
|
-
ariaChecked: t,
|
|
4320
|
-
children: r,
|
|
4321
|
-
className: o,
|
|
4322
|
-
disableHighlight: a,
|
|
4323
|
-
disabled: l,
|
|
4324
|
-
id: u,
|
|
4325
|
-
isChildOption: y,
|
|
4326
|
-
leadingBlock: C,
|
|
4327
|
-
leadingBlockType: m,
|
|
4328
|
-
noHover: E,
|
|
4329
|
-
nonInteractive: d,
|
|
4330
|
-
onClick: f,
|
|
4331
|
-
onKeyPress: A,
|
|
4332
|
-
onMouseMove: v,
|
|
4333
|
-
onMouseOver: p,
|
|
4334
|
-
overlineText: h,
|
|
4335
|
-
primaryText: g,
|
|
4336
|
-
secondaryText: b,
|
|
4337
|
-
selected: k,
|
|
4338
|
-
tag: Q,
|
|
4339
|
-
themeColor: se,
|
|
4340
|
-
trailingBlock: O,
|
|
4341
|
-
trailingBlockType: K,
|
|
4342
|
-
value: V,
|
|
4343
|
-
variant: H,
|
|
4344
|
-
wrapMode: ee,
|
|
4345
|
-
...de
|
|
4346
|
-
} = i, Me = oe(), [Te, Ce] = Ae("mdc-list-item--with-one-line"), M = lt(pt), I = M.leadingBlockType || m, _e = M.trailingBlockType || K, Z = g || r, W = ie(
|
|
4347
|
-
() => M.role !== "group" ? p : void 0,
|
|
4348
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4349
|
-
[]
|
|
4350
|
-
), B = ie(
|
|
4351
|
-
() => M.role !== "group" ? v : void 0,
|
|
4352
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4353
|
-
[]
|
|
4354
|
-
), ue = ie(() => H !== "standard" ? "h3" : Q || (M.navigation ? "a" : "li"), [H, M.navigation, Q]);
|
|
4355
|
-
P(() => {
|
|
4356
|
-
g && h && b ? Ce("mdc-list-item--with-three-lines") : (g && b || h && b) && Ce("mdc-list-item--with-two-lines");
|
|
4357
|
-
}, [g, h, b]);
|
|
4358
|
-
const re = (w, R, ge) => w === "radiogroup" || R === "radio" || ge === "radio" ? "radio" : w === "group" || R === "switch" || R === "checkbox" || ge === "switch " || ge === "checkbox" ? "checkbox" : w === "listbox" ? "option" : w === "menu" ? "menuItem" : null, fe = Y((w) => {
|
|
4359
|
-
!M.nonInteractive && !l && f?.(w, V);
|
|
4360
|
-
}, [M.nonInteractive, l, f, V]), ye = (w, R, ge, Se, Le, ze) => {
|
|
4361
|
-
switch (w) {
|
|
4362
|
-
case "checkbox":
|
|
4363
|
-
return ze ? null : !R || typeof R == "string" ? /* @__PURE__ */ c.createElement(dt, {
|
|
4364
|
-
hideLabel: !0,
|
|
4365
|
-
label: ge,
|
|
4366
|
-
checked: Se
|
|
4367
|
-
}) : R;
|
|
4368
|
-
case "icon":
|
|
4369
|
-
return typeof R == "string" ? /* @__PURE__ */ c.createElement(at, {
|
|
4370
|
-
icon: R
|
|
4371
|
-
}) : R;
|
|
4372
|
-
case "radio":
|
|
4373
|
-
return ze ? null : !R || typeof R == "string" ? /* @__PURE__ */ c.createElement(ft, {
|
|
4374
|
-
hideLabel: !0,
|
|
4375
|
-
label: ge,
|
|
4376
|
-
name: R || Le,
|
|
4377
|
-
checked: Se
|
|
4378
|
-
}) : R;
|
|
4379
|
-
case "switch":
|
|
4380
|
-
return ze ? null : !R || typeof R == "string" ? /* @__PURE__ */ c.createElement(ht, {
|
|
4381
|
-
hideLabel: !0,
|
|
4382
|
-
label: ge
|
|
4383
|
-
}) : R;
|
|
4384
|
-
case "badge":
|
|
4385
|
-
return typeof R == "string" ? /* @__PURE__ */ c.createElement(ct, {
|
|
4386
|
-
label: R
|
|
4387
|
-
}) : R;
|
|
4388
|
-
default:
|
|
4389
|
-
return w ? R : null;
|
|
4390
|
-
}
|
|
4391
|
-
}, te = ie(() => ye(I, C, Z, t, M.randomId, !1), [I, C, Z, t, M.randomId]), x = ie(() => {
|
|
4392
|
-
const w = M.trailingBlockType || K, R = I === "checkbox" || I === "radio" || I === "switch";
|
|
4393
|
-
return ye(w, O, Z, t, M.randomId, R);
|
|
4394
|
-
}, [t, Z, I, M.randomId, M.trailingBlockType, O, K]), N = (w, R) => {
|
|
4395
|
-
switch (R) {
|
|
4396
|
-
case "avatar":
|
|
4397
|
-
return `mdc-list-item--with-${w}-avatar`;
|
|
4398
|
-
case "checkbox":
|
|
4399
|
-
return `mdc-list-item--with-${w}-checkbox`;
|
|
4400
|
-
case "icon":
|
|
4401
|
-
return `mdc-list-item--with-${w}-icon`;
|
|
4402
|
-
case "image":
|
|
4403
|
-
return `mdc-list-item--with-${w}-image`;
|
|
4404
|
-
case "radio":
|
|
4405
|
-
return `mdc-list-item--with-${w}-radio`;
|
|
4406
|
-
case "switch":
|
|
4407
|
-
return `mdc-list-item--with-${w}-switch`;
|
|
4408
|
-
case "thumbnail":
|
|
4409
|
-
return `mdc-list-item--with-${w}-thumbnail`;
|
|
4410
|
-
case "lgImage":
|
|
4411
|
-
return `mdc-list-item--with-${w}-video`;
|
|
4412
|
-
case "badge":
|
|
4413
|
-
return `mdc-list-item--with-${w}-badge`;
|
|
4414
|
-
default:
|
|
4415
|
-
return null;
|
|
4416
|
-
}
|
|
4417
|
-
}, z = ie(() => {
|
|
4418
|
-
let w;
|
|
4419
|
-
if (!H || H === "standard") {
|
|
4420
|
-
const R = N("leading", I), ge = N("trailing", _e);
|
|
4421
|
-
w = F(["mdc-list-item", `lmnt-theme-${se}-bg`, Te, (M.nonInteractive || d) && "mdc-list-item--non-interactive", R, ge]);
|
|
4422
|
-
}
|
|
4423
|
-
return w;
|
|
4424
|
-
}, [H, I, _e, se, Te, M.nonInteractive, d]), he = F(["lmnt", z, (!M.nonInteractive || d) && M.navigation && (t || e) && "mdc-list-item--activated", (!M.nonInteractive || d) && (!a || y) && (t || k) && "mdc-list-item--selected", (M.nonInteractive || E || d) && "lmnt-list-item__no-hover", l && "mdc-list-item--disabled", ee === "truncate" && "lmnt-list-item--truncate", ee === "noWrap" && "lmnt-list-item--no-wrap", ee === "wrap" && "lmnt-list-item--wrap ", H === "group" && "mdc-list-group__subheader lmnt-list-group__subheader", H === "category" && "lmnt-list-group__category-header", o]), pe = re(M.role, I, _e);
|
|
4425
|
-
return ve(n, () => Me.current, []), /* @__PURE__ */ c.createElement(Bn, {
|
|
4426
|
-
componentRef: Me
|
|
4427
|
-
}, /* @__PURE__ */ c.createElement(ue, U({
|
|
4428
|
-
id: u,
|
|
4429
|
-
"aria-checked": t,
|
|
4430
|
-
ref: Me,
|
|
4431
|
-
role: pe,
|
|
4432
|
-
onClick: fe,
|
|
4433
|
-
className: he,
|
|
4434
|
-
onKeyPress: A,
|
|
4435
|
-
onMouseMove: B,
|
|
4436
|
-
onMouseOver: W
|
|
4437
|
-
}, de), /* @__PURE__ */ c.createElement("span", {
|
|
4438
|
-
className: "mdc-list-item__ripple"
|
|
4439
|
-
}), H === "standard" && te && /* @__PURE__ */ c.createElement(yt, null, te), H !== "standard" && H === "category" && /* @__PURE__ */ c.createElement(xt, {
|
|
4440
|
-
level: 0
|
|
4441
|
-
}, Z), H !== "standard" && H === "group" && M.listType === "group" && /* @__PURE__ */ c.createElement(xt, {
|
|
4442
|
-
level: 2
|
|
4443
|
-
}, Z), H !== "standard" && H === "group" && M.listType === "category" && /* @__PURE__ */ c.createElement(Fn, null, Z), H === "standard" && /* @__PURE__ */ c.createElement(_t, {
|
|
4444
|
-
primaryText: Z,
|
|
4445
|
-
overlineText: H === "standard" && h,
|
|
4446
|
-
secondaryText: H === "standard" && b
|
|
4447
|
-
}), H === "standard" && x && /* @__PURE__ */ c.createElement(gt, null, x)));
|
|
4448
|
-
});
|
|
4449
|
-
Ve.displayName = "ListItem";
|
|
4450
|
-
Ve.propTypes = Di;
|
|
4451
|
-
Ve.defaultProps = Mi;
|
|
4452
|
-
const Tt = /* @__PURE__ */ $((i, n) => {
|
|
4453
|
-
const {
|
|
4454
|
-
variant: e,
|
|
4455
|
-
className: t,
|
|
4456
|
-
...r
|
|
4457
|
-
} = i, {
|
|
4458
|
-
leadingBlockType: o,
|
|
4459
|
-
navigation: a
|
|
4460
|
-
} = lt(pt), l = ie(() => a ? "hr" : "li", [a]);
|
|
4461
|
-
return /* @__PURE__ */ c.createElement(l, U({
|
|
4462
|
-
ref: n,
|
|
4463
|
-
role: "separator",
|
|
4464
|
-
className: F("mdc-list-divider", "lmnt-list-divider", (e === "padded" || e === "insetPadded") && "lmnt-list-divider--with-padding", (e === "insetPadded" || e === "inset") && "lmnt-list-divider--with-inset", o === "avatar" && " mdc-list-divider--with-leading-avatar", o === "checkbox" && " mdc-list-divider--with-leading-checkbox", o === "icon" && " mdc-list-divider--with-leading-icon", o === "image" && " mdc-list-divider--with-leading-image", o === "largeImage" && " mdc-list-divider--with-leading-video", o === "radio" && " mdc-list-divider--with-leading-radio", o === "switch" && " mdc-list-divider--with-leading-switch", o === "thumbnail" && " mdc-list-divider--with-leading-thumbnail", t)
|
|
4465
|
-
}, r));
|
|
4466
|
-
});
|
|
4467
|
-
Tt.displayName = "ListDivider";
|
|
4468
|
-
Tt.propTypes = Si;
|
|
4469
|
-
Tt.defaultProps = Oi;
|
|
4470
|
-
const et = /* @__PURE__ */ $((i, n) => {
|
|
4471
|
-
const {
|
|
4472
|
-
children: e,
|
|
4473
|
-
items: t,
|
|
4474
|
-
group: r,
|
|
4475
|
-
selectedIndex: o
|
|
4476
|
-
} = i, {
|
|
4477
|
-
showDivider: a,
|
|
4478
|
-
dividerVariant: l,
|
|
4479
|
-
categoryNameKey: u,
|
|
4480
|
-
secondaryTextKey: y,
|
|
4481
|
-
overlineTextKey: C,
|
|
4482
|
-
groupNameKey: m,
|
|
4483
|
-
primaryTextKey: E,
|
|
4484
|
-
role: d,
|
|
4485
|
-
singleList: f,
|
|
4486
|
-
componentPropsKey: A
|
|
4487
|
-
} = lt(pt), [v] = Ae(() => qe());
|
|
4488
|
-
return Array.isArray(t) ? t?.map((p, h) => {
|
|
4489
|
-
let g = p[E];
|
|
4490
|
-
!g && typeof p == "string" && (g = p);
|
|
4491
|
-
const b = p[y], k = p[C], Q = bt(p, m, u);
|
|
4492
|
-
let se;
|
|
4493
|
-
d === "group" ? Array.isArray(o) && o.length && (se = o.indexOf(h) !== -1) : se = o === h;
|
|
4494
|
-
let O, K;
|
|
4495
|
-
(!p.leadingBlock || typeof p.trailingBlock != "string") && d === "radiogroup" && !f ? O = v : O = p.leadingBlock, (!p.trailingBlock || typeof p.trailingBlock != "string") && d === "radiogroup" && !f ? K = v : K = p.trailingBlock;
|
|
4496
|
-
const V = p[A] || {};
|
|
4497
|
-
return /* @__PURE__ */ c.createElement(St, {
|
|
4498
|
-
key: g || b || k
|
|
4499
|
-
}, /* @__PURE__ */ c.createElement(Ve, U({
|
|
4500
|
-
ref: n,
|
|
4501
|
-
key: g,
|
|
4502
|
-
tabIndex: h === 0 ? 0 : -1,
|
|
4503
|
-
variant: Q,
|
|
4504
|
-
secondaryText: b,
|
|
4505
|
-
primaryText: g,
|
|
4506
|
-
overlineText: k,
|
|
4507
|
-
leadingBlock: O,
|
|
4508
|
-
trailingBlock: K,
|
|
4509
|
-
ariaChecked: se
|
|
4510
|
-
}, V)), !r && a && t.length > h + 1 && /* @__PURE__ */ c.createElement(Tt, {
|
|
4511
|
-
variant: l
|
|
4512
|
-
}));
|
|
4513
|
-
}) : e;
|
|
4514
|
-
});
|
|
4515
|
-
et.displayName = "ListItemsList";
|
|
4516
|
-
et.propTypes = Vi;
|
|
4517
|
-
et.defaultProps = qi;
|
|
4518
|
-
const tt = /* @__PURE__ */ $((i, n) => {
|
|
4519
|
-
const {
|
|
4520
|
-
className: e,
|
|
4521
|
-
...t
|
|
4522
|
-
} = i;
|
|
4523
|
-
return /* @__PURE__ */ c.createElement("hr", U({
|
|
4524
|
-
ref: n,
|
|
4525
|
-
className: F("lmnt", "lmnt-list-divider", "mdc-list-divider", e)
|
|
4526
|
-
}, t));
|
|
4527
|
-
});
|
|
4528
|
-
tt.displayName = "ListGroupDivider";
|
|
4529
|
-
tt.propTypes = Ni;
|
|
4530
|
-
tt.defaultProps = Ri;
|
|
4531
|
-
const Fe = /* @__PURE__ */ $((i, n) => {
|
|
4532
|
-
const {
|
|
4533
|
-
categoryId: e,
|
|
4534
|
-
categoryIdKey: t,
|
|
4535
|
-
categoryNameKey: r,
|
|
4536
|
-
children: o,
|
|
4537
|
-
className: a,
|
|
4538
|
-
componentPropsKey: l,
|
|
4539
|
-
customRef: u,
|
|
4540
|
-
dense: y,
|
|
4541
|
-
dividerVariant: C,
|
|
4542
|
-
groupId: m,
|
|
4543
|
-
groupIdKey: E,
|
|
4544
|
-
groupItems: d,
|
|
4545
|
-
groupNameKey: f,
|
|
4546
|
-
groupSelectedIndex: A,
|
|
4547
|
-
inMenu: v,
|
|
4548
|
-
itemIdKey: p,
|
|
4549
|
-
items: h,
|
|
4550
|
-
itemsKey: g,
|
|
4551
|
-
leadingBlockType: b,
|
|
4552
|
-
listType: k,
|
|
4553
|
-
navigation: Q,
|
|
4554
|
-
nonInteractive: se,
|
|
4555
|
-
onAction: O,
|
|
4556
|
-
overlineTextKey: K,
|
|
4557
|
-
primaryTextKey: V,
|
|
4558
|
-
role: H,
|
|
4559
|
-
roleToUse: ee,
|
|
4560
|
-
secondaryTextKey: de,
|
|
4561
|
-
selected: Me,
|
|
4562
|
-
showDivider: Te,
|
|
4563
|
-
singleList: Ce,
|
|
4564
|
-
themeColor: M,
|
|
4565
|
-
trailingBlockType: I,
|
|
4566
|
-
wrapFocus: _e,
|
|
4567
|
-
...Z
|
|
4568
|
-
} = i, W = oe(u || null), B = oe(), ue = Y((_, S, L) => {
|
|
4569
|
-
const q = _[f], j = _[g][L];
|
|
4570
|
-
return {
|
|
4571
|
-
selectedGroup: q,
|
|
4572
|
-
selectedGroupIndex: S,
|
|
4573
|
-
selectedGroupId: _[E] || q,
|
|
4574
|
-
selectedIndex: L,
|
|
4575
|
-
selectedItem: typeof j == "string" ? j : j[p] || j[V]
|
|
4576
|
-
};
|
|
4577
|
-
}, [E, f, p, g, V]), re = Y((_, S) => S.findIndex((L) => _ === L[E] || _ === L[f]), [E, f]), fe = Y((_, S) => S.findIndex((L) => _ === L[t] || _ === L[r]), [t, r]), ye = Y((_, S, L) => {
|
|
4578
|
-
const q = re(S, _);
|
|
4579
|
-
if (q === -1)
|
|
4580
|
-
return {};
|
|
4581
|
-
const j = h[q];
|
|
4582
|
-
return ue(j, q, L);
|
|
4583
|
-
}, [ue, re, h]), te = Y((_, S) => {
|
|
4584
|
-
const L = _[r];
|
|
4585
|
-
return {
|
|
4586
|
-
selectedCategory: L,
|
|
4587
|
-
selectedCategoryIndex: S,
|
|
4588
|
-
selectedCategoryId: _[t] || L
|
|
4589
|
-
};
|
|
4590
|
-
}, [t, r]), x = Y((_, S, L) => {
|
|
4591
|
-
const q = fe(_, h);
|
|
4592
|
-
if (q === -1)
|
|
4593
|
-
return {};
|
|
4594
|
-
const j = h[q];
|
|
4595
|
-
return {
|
|
4596
|
-
...te(j, q),
|
|
4597
|
-
...ye(j[g], S, L)
|
|
4598
|
-
};
|
|
4599
|
-
}, [te, fe, ye, h, g]), N = Y((_, S, L) => k === "category" ? x(L, S, _) : k === "group" ? ye(h, S, _) : h ? h[_][p] || h[_] : _, [k, x, ye, h, p]), z = Y((_, S, L) => {
|
|
4600
|
-
const q = fe(_, h);
|
|
4601
|
-
if (q === -1)
|
|
4602
|
-
return [];
|
|
4603
|
-
const j = h[q], be = j[g], Oe = re(S, be);
|
|
4604
|
-
if (Oe === -1)
|
|
4605
|
-
return [];
|
|
4606
|
-
const it = be[Oe];
|
|
4607
|
-
return it[g].length <= L ? [] : [{
|
|
4608
|
-
...te(j, q),
|
|
4609
|
-
...ue(it, Oe, L)
|
|
4610
|
-
}];
|
|
4611
|
-
}, [te, ue, fe, re, h, g]), he = Y((_, S) => {
|
|
4612
|
-
const L = [], q = re(_, h);
|
|
4613
|
-
if (q === -1)
|
|
4614
|
-
return [];
|
|
4615
|
-
const j = h[q];
|
|
4616
|
-
return L.push(ue(j, q, S)), L;
|
|
4617
|
-
}, [ue, re, h]), pe = Y((_, S, L) => _.reduce((j, be) => {
|
|
4618
|
-
if (k === "simple" && j.push(h[be][p] || h[be]), k === "category" && j.splice(j.length - 1, 0, ...z(L, S, be)), k === "group") {
|
|
4619
|
-
const Oe = he(S, be);
|
|
4620
|
-
j.splice(j.length - 1, 0, ...Oe);
|
|
4621
|
-
}
|
|
4622
|
-
return j;
|
|
4623
|
-
}, []), [z, he, p, h, k]), w = Y((_, S, L) => {
|
|
4624
|
-
const q = fe(_, h);
|
|
4625
|
-
if (q === -1)
|
|
4626
|
-
return {};
|
|
4627
|
-
const j = h[q], be = j[g], Oe = re(S, be);
|
|
4628
|
-
if (Oe === -1)
|
|
4629
|
-
return {};
|
|
4630
|
-
const it = be[Oe];
|
|
4631
|
-
return {
|
|
4632
|
-
...te(j, q),
|
|
4633
|
-
...ue(it, Oe, L)
|
|
4634
|
-
};
|
|
4635
|
-
}, [te, ue, fe, re, h, g]), R = Y((_) => h && _ > -1 ? h[_][p] || h[_] : _, [p, h]), ge = Y((_, S, L) => k === "category" ? w(_, S, L) : k === "group" ? ye(h, S, L) : R(L), [R, w, ye, h, k]), Se = Y(
|
|
4636
|
-
(_, S, L) => ee === "group" ? pe(_, S, L) : Ce ? ge(L, S, _) : R(_),
|
|
4637
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4638
|
-
[E, f, p, h, g, k, V, ee, Ce, t, r]
|
|
4639
|
-
), Le = Y((_) => {
|
|
4640
|
-
var S;
|
|
4641
|
-
O && O(N(_.detail.index, m, e), Se((S = B.current) === null || S === void 0 ? void 0 : S.foundation.getSelectedIndex(), m, e), m, e, _);
|
|
4642
|
-
}, [e, O, N, Se, m]);
|
|
4643
|
-
P(() => {
|
|
4644
|
-
if (!v)
|
|
4645
|
-
return B.current = new fn(W.current), () => {
|
|
4646
|
-
var _;
|
|
4647
|
-
(_ = B.current) === null || _ === void 0 || _.destroy();
|
|
4648
|
-
};
|
|
4649
|
-
}, [v, B]), P(() => {
|
|
4650
|
-
var _;
|
|
4651
|
-
return (_ = B.current) === null || _ === void 0 || _.listen("MDCList:action", Le), () => {
|
|
4652
|
-
var S;
|
|
4653
|
-
(S = B.current) === null || S === void 0 || S.unlisten("MDCList:action", Le);
|
|
4654
|
-
};
|
|
4655
|
-
}, [Le]), P(() => {
|
|
4656
|
-
B.current && (B.current.wrapFocus = _e);
|
|
4657
|
-
}, [_e]), P(() => {
|
|
4658
|
-
var _, S;
|
|
4659
|
-
const L = ee === "listbox" || ee === "radiogroup";
|
|
4660
|
-
(_ = B.current) === null || _ === void 0 || _.foundation.setSingleSelection(L), ee && !L && ((S = B.current) === null || S === void 0 ? void 0 : S.foundation.getSelectedIndex()) === -1 && (B.current.foundation.isCheckboxList_ = !0, B.current.foundation.setSelectedIndex([])), L && B.current && (B.current.foundation.isCheckboxList_ = !1);
|
|
4661
|
-
}, [ee]);
|
|
4662
|
-
const ze = Q ? "nav" : "ul";
|
|
4663
|
-
return ve(n, () => W.current, []), /* @__PURE__ */ c.createElement(ze, U({
|
|
4664
|
-
"aria-multiselectable": b === "checkbox" || I === "checkbox" || b === "switch" || I === "switch" || ee === "group",
|
|
4665
|
-
"data-evolution": "true",
|
|
4666
|
-
ref: W,
|
|
4667
|
-
role: ee,
|
|
4668
|
-
"aria-orientation": "vertical",
|
|
4669
|
-
className: F("lmnt", "lmnt-list", "mdc-list", `lmnt-theme-${M}-bg`, y && "lmnt-list--dense", k === "category" && "lmnt-nested-list", a)
|
|
4670
|
-
}, Z), o);
|
|
4671
|
-
});
|
|
4672
|
-
Fe.displayName = "ListRoot";
|
|
4673
|
-
Fe.propTypes = En;
|
|
4674
|
-
Fe.defaultProps = In;
|
|
4675
|
-
const nt = /* @__PURE__ */ $((i, n) => {
|
|
4676
|
-
const {
|
|
4677
|
-
children: e,
|
|
4678
|
-
className: t,
|
|
4679
|
-
variant: r
|
|
4680
|
-
} = i;
|
|
4681
|
-
return r === "group" ? /* @__PURE__ */ c.createElement("div", {
|
|
4682
|
-
ref: n,
|
|
4683
|
-
className: F("mdc-list-group", t)
|
|
4684
|
-
}, e) : r === "category" ? /* @__PURE__ */ c.createElement("div", {
|
|
4685
|
-
ref: n,
|
|
4686
|
-
className: F("lmnt-list-category", t)
|
|
4687
|
-
}, e) : /* @__PURE__ */ c.createElement(c.Fragment, null, e);
|
|
4688
|
-
});
|
|
4689
|
-
nt.displayName = "ListWrapper";
|
|
4690
|
-
nt.propTypes = Xi;
|
|
4691
|
-
nt.defaultProps = zi;
|
|
4692
|
-
const Pt = /* @__PURE__ */ $((i, n) => {
|
|
4693
|
-
const {
|
|
4694
|
-
categoryIdKey: e,
|
|
4695
|
-
categoryNameKey: t,
|
|
4696
|
-
children: r,
|
|
4697
|
-
className: o,
|
|
4698
|
-
componentPropsKey: a,
|
|
4699
|
-
customRef: l,
|
|
4700
|
-
dense: u,
|
|
4701
|
-
dividerVariant: y,
|
|
4702
|
-
groupIdKey: C,
|
|
4703
|
-
groupNameKey: m,
|
|
4704
|
-
itemIdKey: E,
|
|
4705
|
-
items: d,
|
|
4706
|
-
itemsKey: f,
|
|
4707
|
-
leadingBlockType: A,
|
|
4708
|
-
listType: v,
|
|
4709
|
-
multiSelect: p,
|
|
4710
|
-
navigation: h,
|
|
4711
|
-
nonInteractive: g,
|
|
4712
|
-
onAction: b,
|
|
4713
|
-
overlineTextKey: k,
|
|
4714
|
-
primaryTextKey: Q,
|
|
4715
|
-
role: se,
|
|
4716
|
-
secondaryTextKey: O,
|
|
4717
|
-
selected: K,
|
|
4718
|
-
showDivider: V,
|
|
4719
|
-
singleList: H,
|
|
4720
|
-
themeColor: ee,
|
|
4721
|
-
trailingBlockType: de,
|
|
4722
|
-
wrapFocus: Me,
|
|
4723
|
-
...Te
|
|
4724
|
-
} = i, Ce = oe(l || null);
|
|
4725
|
-
ve(n, () => Ce.current, []);
|
|
4726
|
-
const [M, I] = Ae(K), [_e] = Ae(() => qe()), {
|
|
4727
|
-
inMenu: Z
|
|
4728
|
-
} = lt(pn);
|
|
4729
|
-
P(() => {
|
|
4730
|
-
d && d.length > 0 && r && On("List: Items should not be used with children. If both are sent children will be ignored.");
|
|
4731
|
-
}, [d, r]);
|
|
4732
|
-
const W = ie(() => Array.isArray(d) && d[0] && typeof d[0] == "object" && d[0][t] ? "category" : Array.isArray(d) && d[0] && typeof d[0] == "object" && d[0][m] ? "group" : v || "simple", [t, m, d, v]), [B, ue] = Ae(() => Ft(i));
|
|
4733
|
-
P(() => {
|
|
4734
|
-
ue(Ft({
|
|
4735
|
-
leadingBlockType: A,
|
|
4736
|
-
trailingBlockType: de,
|
|
4737
|
-
nonInteractive: g,
|
|
4738
|
-
role: se
|
|
4739
|
-
}));
|
|
4740
|
-
}, [A, de, g, se]);
|
|
4741
|
-
const re = Y((x, N) => {
|
|
4742
|
-
if (b && B)
|
|
4743
|
-
if (W === "simple")
|
|
4744
|
-
b(x, N), I(N);
|
|
4745
|
-
else if (H)
|
|
4746
|
-
if (B !== "group")
|
|
4747
|
-
b(x, N);
|
|
4748
|
-
else {
|
|
4749
|
-
if (!M) {
|
|
4750
|
-
I(N), b(x, N);
|
|
4751
|
-
return;
|
|
4752
|
-
}
|
|
4753
|
-
const z = [...M], he = M.findIndex((pe) => W === "category" ? pe.selectedCategoryId === x.selectedCategoryId && pe.selectedGroupId === x.selectedGroupId && pe.selectedItem === x.selectedItem : pe.selectedGroupId === x.selectedGroupId && pe.selectedItem === x.selectedItem);
|
|
4754
|
-
if (he !== -1) {
|
|
4755
|
-
z.splice(he, 1), I(z), b(x, z);
|
|
4756
|
-
return;
|
|
4757
|
-
}
|
|
4758
|
-
z.push(x), I(z), b(x, z);
|
|
4759
|
-
}
|
|
4760
|
-
else
|
|
4761
|
-
b(x, N);
|
|
4762
|
-
}, [M, W, b, B, H]), fe = Y((x, N, z, he, pe, w) => {
|
|
4763
|
-
const R = N[m];
|
|
4764
|
-
if (!R)
|
|
4765
|
-
return null;
|
|
4766
|
-
const ge = bt(N, m, t), Se = N[C] || R, Le = xn(z, w, B, H ? K : K[Se], H);
|
|
4767
|
-
return /* @__PURE__ */ c.createElement(St, {
|
|
4768
|
-
key: Se
|
|
4769
|
-
}, /* @__PURE__ */ c.createElement(Ve, {
|
|
4770
|
-
variant: ge,
|
|
4771
|
-
primaryText: R
|
|
4772
|
-
}), /* @__PURE__ */ c.createElement(x, U({
|
|
4773
|
-
inMenu: Z,
|
|
4774
|
-
ref: Ce,
|
|
4775
|
-
categoryId: pe,
|
|
4776
|
-
groupId: Se,
|
|
4777
|
-
itemsKey: f,
|
|
4778
|
-
primaryTextKey: Q,
|
|
4779
|
-
onAction: re,
|
|
4780
|
-
showDivider: V,
|
|
4781
|
-
className: o,
|
|
4782
|
-
dense: u,
|
|
4783
|
-
items: d,
|
|
4784
|
-
leadingBlockType: A,
|
|
4785
|
-
listType: W,
|
|
4786
|
-
roleToUse: B,
|
|
4787
|
-
trailingBlockType: de,
|
|
4788
|
-
groupNameKey: m,
|
|
4789
|
-
groupIdKey: C,
|
|
4790
|
-
categoryNameKey: t,
|
|
4791
|
-
selected: K,
|
|
4792
|
-
groupItems: N[f],
|
|
4793
|
-
groupSelectedIndex: Le,
|
|
4794
|
-
componentPropsKey: a
|
|
4795
|
-
}, Te), /* @__PURE__ */ c.createElement(et, {
|
|
4796
|
-
items: N[f],
|
|
4797
|
-
selectedIndex: Le,
|
|
4798
|
-
group: !0
|
|
4799
|
-
}), he && d.length > z + 1 && /* @__PURE__ */ c.createElement(tt, null)));
|
|
4800
|
-
}, [t, H, o, Te, u, C, m, re, Z, d, f, A, W, Q, B, K, V, de, a]), ye = ie(() => {
|
|
4801
|
-
if (!d && r)
|
|
4802
|
-
return /* @__PURE__ */ c.createElement(Fe, U({
|
|
4803
|
-
inMenu: Z,
|
|
4804
|
-
ref: Ce,
|
|
4805
|
-
itemsKey: f,
|
|
4806
|
-
onAction: re,
|
|
4807
|
-
showDivider: V,
|
|
4808
|
-
className: o,
|
|
4809
|
-
dense: u,
|
|
4810
|
-
items: d,
|
|
4811
|
-
leadingBlockType: A,
|
|
4812
|
-
listType: W,
|
|
4813
|
-
roleToUse: B,
|
|
4814
|
-
trailingBlockType: de,
|
|
4815
|
-
groupNameKey: m,
|
|
4816
|
-
categoryNameKey: t,
|
|
4817
|
-
categoryIdKey: e,
|
|
4818
|
-
componentPropsKey: a,
|
|
4819
|
-
navigation: h
|
|
4820
|
-
}, Te), r);
|
|
4821
|
-
if (W === "simple") {
|
|
4822
|
-
let x;
|
|
4823
|
-
return B === "group" ? (x = [], Array.isArray(K) && K?.forEach((N) => {
|
|
4824
|
-
d?.forEach((z, he) => {
|
|
4825
|
-
(N === z || N === z[E] || N === he[Q]) && x.push(he);
|
|
4826
|
-
});
|
|
4827
|
-
})) : x = d?.findIndex((N) => typeof N == "string" ? N === K : typeof N == "object" ? N[E] || N[E] === 0 ? N[E] === K : Ii(N, K) : null), /* @__PURE__ */ c.createElement(Fe, U({
|
|
4828
|
-
inMenu: Z,
|
|
4829
|
-
ref: Ce,
|
|
4830
|
-
itemsKey: f,
|
|
4831
|
-
onAction: re,
|
|
4832
|
-
showDivider: V,
|
|
4833
|
-
className: o,
|
|
4834
|
-
dense: u,
|
|
4835
|
-
themeColor: ee,
|
|
4836
|
-
items: d,
|
|
4837
|
-
leadingBlockType: A,
|
|
4838
|
-
listType: W,
|
|
4839
|
-
roleToUse: B,
|
|
4840
|
-
trailingBlockType: de,
|
|
4841
|
-
groupNameKey: m,
|
|
4842
|
-
categoryNameKey: t,
|
|
4843
|
-
categoryIdKey: e,
|
|
4844
|
-
componentPropsKey: a,
|
|
4845
|
-
navigation: h
|
|
4846
|
-
}, Te), /* @__PURE__ */ c.createElement(et, {
|
|
4847
|
-
items: d,
|
|
4848
|
-
selectedIndex: x
|
|
4849
|
-
}, !d && r));
|
|
4850
|
-
}
|
|
4851
|
-
return W === "group" ? d?.map((x, N) => fe(Fe, x, N, V)) : W === "category" ? d?.map((x, N) => {
|
|
4852
|
-
const z = x[t];
|
|
4853
|
-
if (!z)
|
|
4854
|
-
return null;
|
|
4855
|
-
const he = bt(x, m, t), pe = x[e] || z;
|
|
4856
|
-
return /* @__PURE__ */ c.createElement(St, {
|
|
4857
|
-
key: pe
|
|
4858
|
-
}, /* @__PURE__ */ c.createElement(nt, {
|
|
4859
|
-
variant: "group",
|
|
4860
|
-
className: `lmnt-nested-list mdc-list lmnt-theme-${ee}-bg`
|
|
4861
|
-
}, /* @__PURE__ */ c.createElement(Ve, {
|
|
4862
|
-
variant: he,
|
|
4863
|
-
primaryText: z
|
|
4864
|
-
}), x[f].map((w, R) => fe(Fe, w, R, !1, pe, N))), V && d.length > N + 1 && /* @__PURE__ */ c.createElement(tt, null));
|
|
4865
|
-
}) : null;
|
|
4866
|
-
}, [fe, Z, f, V, r, o, Te, u, d, A, W, B, de, m, t, K, e, re, Q, E, a, h, ee]), te = ie(() => ({
|
|
4867
|
-
role: B,
|
|
4868
|
-
nonInteractive: g,
|
|
4869
|
-
leadingBlockType: A,
|
|
4870
|
-
trailingBlockType: de,
|
|
4871
|
-
showDivider: V,
|
|
4872
|
-
dividerVariant: y,
|
|
4873
|
-
selected: K,
|
|
4874
|
-
listType: W,
|
|
4875
|
-
categoryNameKey: t,
|
|
4876
|
-
secondaryTextKey: O,
|
|
4877
|
-
overlineTextKey: k,
|
|
4878
|
-
groupNameKey: m,
|
|
4879
|
-
primaryTextKey: Q,
|
|
4880
|
-
randomId: _e,
|
|
4881
|
-
singleList: H,
|
|
4882
|
-
navigation: h,
|
|
4883
|
-
componentPropsKey: a
|
|
4884
|
-
}), [t, a, y, m, A, W, h, g, k, Q, _e, B, O, K, V, H, de]);
|
|
4885
|
-
return /* @__PURE__ */ c.createElement(pt.Provider, {
|
|
4886
|
-
value: te
|
|
4887
|
-
}, /* @__PURE__ */ c.createElement(nt, {
|
|
4888
|
-
variant: W
|
|
4889
|
-
}, ye));
|
|
4890
|
-
});
|
|
4891
|
-
Pt.displayName = "List";
|
|
4892
|
-
Pt.propTypes = En;
|
|
4893
|
-
Pt.defaultProps = In;
|
|
4894
|
-
const kt = /* @__PURE__ */ $((i, n) => {
|
|
4895
|
-
const {
|
|
4896
|
-
children: e,
|
|
4897
|
-
className: t,
|
|
4898
|
-
...r
|
|
4899
|
-
} = i;
|
|
4900
|
-
return /* @__PURE__ */ c.createElement("div", U({
|
|
4901
|
-
ref: n,
|
|
4902
|
-
className: F("lmnt", "lmnt-list-group", "mdc-list-group", t)
|
|
4903
|
-
}, r), e);
|
|
4904
|
-
});
|
|
4905
|
-
kt.displayName = "ListGroup";
|
|
4906
|
-
kt.propTypes = xi;
|
|
4907
|
-
kt.defaultProps = Li;
|
|
4908
|
-
const wt = /* @__PURE__ */ $((i, n) => {
|
|
4909
|
-
const {
|
|
4910
|
-
className: e,
|
|
4911
|
-
children: t,
|
|
4912
|
-
...r
|
|
4913
|
-
} = i;
|
|
4914
|
-
return /* @__PURE__ */ c.createElement("h3", U({
|
|
4915
|
-
ref: n,
|
|
4916
|
-
className: F("mdc-list-group__subheader lmnt-list-group__subheader", e)
|
|
4917
|
-
}, r), /* @__PURE__ */ c.createElement(xt, {
|
|
4918
|
-
level: 2
|
|
4919
|
-
}, t));
|
|
4920
|
-
});
|
|
4921
|
-
wt.displayName = "ListGroupSubHeader";
|
|
4922
|
-
wt.propTypes = {
|
|
4923
|
-
className: s.string,
|
|
4924
|
-
children: s.node
|
|
4925
|
-
};
|
|
4926
|
-
wt.defaultProps = {
|
|
4927
|
-
children: null,
|
|
4928
|
-
className: ""
|
|
4929
|
-
};
|
|
4930
|
-
export {
|
|
4931
|
-
dt as C,
|
|
4932
|
-
Pt as L,
|
|
4933
|
-
pn as M,
|
|
4934
|
-
ht as S,
|
|
4935
|
-
hi as _,
|
|
4936
|
-
Ve as a,
|
|
4937
|
-
Tt as b,
|
|
4938
|
-
qr as k
|
|
4939
|
-
};
|