@covalent/components 6.0.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-ribbon.mjs +9 -7
- package/alert.mjs +13 -11
- package/app-shell.mjs +10 -4
- package/aria-property.mjs +41 -0
- package/base-element.mjs +28 -0
- package/button.mjs +180 -13
- package/card.mjs +3 -3
- package/check-list-item.mjs +92 -14
- package/checkbox.mjs +26 -14
- package/circular-progress.mjs +144 -10
- package/class-map.mjs +62 -0
- package/code-snippet.mjs +6 -5
- package/covalent.mjs +2 -2
- package/covalent.umd.js +3339 -137
- package/dialog.mjs +750 -15
- package/directive-helpers.mjs +11 -0
- package/drawer.mjs +26 -15
- package/empty-state.mjs +4 -4
- package/event-options.mjs +14 -0
- package/form-element.mjs +50 -0
- package/foundation.mjs +152 -0
- package/foundation2.mjs +60 -0
- package/icon-button.mjs +130 -15
- package/icon-check-toggle.mjs +18 -8
- package/icon-radio-toggle.mjs +29 -18
- package/icon.mjs +19 -13
- package/if-defined.mjs +10 -0
- package/inert.esm.mjs +640 -0
- package/linear-progress.mjs +178 -15
- package/list-expansion.mjs +33 -22
- package/list-item.mjs +19 -20
- package/list.mjs +26 -13
- package/menu.mjs +32 -13
- package/mwc-checkbox-base.mjs +198 -0
- package/mwc-checkbox.css.mjs +10 -0
- package/mwc-drawer-base.mjs +335 -0
- package/mwc-icon.mjs +26 -0
- package/mwc-line-ripple-directive.mjs +653 -0
- package/mwc-list-base.mjs +840 -0
- package/mwc-list-item-base.mjs +202 -0
- package/mwc-list-item.css.mjs +17 -0
- package/mwc-menu-base.mjs +1145 -0
- package/mwc-radio-base.mjs +528 -0
- package/mwc-radio.css.mjs +10 -0
- package/mwc-slider.css.mjs +956 -0
- package/mwc-tab-base.mjs +694 -0
- package/mwc-top-app-bar-base.mjs +380 -0
- package/nav-list-item.mjs +28 -20
- package/observer.mjs +32 -0
- package/package.json +9 -2
- package/property.mjs +20 -0
- package/query-assigned-elements.mjs +615 -0
- package/query-assigned-nodes.mjs +17 -0
- package/query.mjs +25 -0
- package/radio-list-item.mjs +93 -12
- package/radio.mjs +28 -15
- package/ripple-handlers.mjs +761 -0
- package/select.mjs +1257 -15
- package/side-sheet.mjs +21 -16
- package/slider-range.mjs +438 -11
- package/slider.mjs +253 -13
- package/snackbar.mjs +456 -15
- package/src/action-ribbon/action-ribbon-base.d.ts +30 -0
- package/src/action-ribbon/action-ribbon-base.d.ts.map +1 -0
- package/src/action-ribbon/action-ribbon.d.ts +15 -0
- package/src/action-ribbon/action-ribbon.d.ts.map +1 -0
- package/src/alert/alert-base.d.ts +31 -0
- package/src/alert/alert-base.d.ts.map +1 -0
- package/src/alert/alert.d.ts +15 -0
- package/src/alert/alert.d.ts.map +1 -0
- package/src/app-shell/app-shell.d.ts +26 -0
- package/src/app-shell/app-shell.d.ts.map +1 -0
- package/src/button/button.d.ts +10 -0
- package/src/button/button.d.ts.map +1 -0
- package/src/card/card-base.d.ts +25 -0
- package/src/card/card-base.d.ts.map +1 -0
- package/src/card/card.d.ts +10 -0
- package/src/card/card.d.ts.map +1 -0
- package/src/checkbox/checkbox.d.ts +10 -0
- package/src/checkbox/checkbox.d.ts.map +1 -0
- package/src/chips/chip-base.d.ts +52 -0
- package/src/chips/chip-base.d.ts.map +1 -0
- package/src/chips/chip-set-base.d.ts +33 -0
- package/src/chips/chip-set-base.d.ts.map +1 -0
- package/src/chips/chip-set.d.ts +15 -0
- package/src/chips/chip-set.d.ts.map +1 -0
- package/src/chips/chip.d.ts +15 -0
- package/src/chips/chip.d.ts.map +1 -0
- package/src/chips/foundation.d.ts +60 -0
- package/src/chips/foundation.d.ts.map +1 -0
- package/src/circular-progress/circular-progress.d.ts +10 -0
- package/src/circular-progress/circular-progress.d.ts.map +1 -0
- package/src/code-snippet/code-snippet.d.ts +21 -0
- package/src/code-snippet/code-snippet.d.ts.map +1 -0
- package/src/dialog/dialog.d.ts +10 -0
- package/src/dialog/dialog.d.ts.map +1 -0
- package/src/drawer/drawer.d.ts +10 -0
- package/src/drawer/drawer.d.ts.map +1 -0
- package/src/empty-state/empty-state.d.ts +16 -0
- package/src/empty-state/empty-state.d.ts.map +1 -0
- package/src/formfield/formfield.d.ts +10 -0
- package/src/formfield/formfield.d.ts.map +1 -0
- package/src/icon/icon.d.ts +10 -0
- package/src/icon/icon.d.ts.map +1 -0
- package/src/icon-button/icon-button.d.ts +10 -0
- package/src/icon-button/icon-button.d.ts.map +1 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts +15 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts.map +1 -0
- package/src/icon-radio/icon-radio-toggle.d.ts +14 -0
- package/src/icon-radio/icon-radio-toggle.d.ts.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/linear-progress/linear-progress.d.ts +10 -0
- package/src/linear-progress/linear-progress.d.ts.map +1 -0
- package/src/list/check-list-item.d.ts +10 -0
- package/src/list/check-list-item.d.ts.map +1 -0
- package/src/list/list-expansion.d.ts +18 -0
- package/src/list/list-expansion.d.ts.map +1 -0
- package/src/list/list-item.d.ts +12 -0
- package/src/list/list-item.d.ts.map +1 -0
- package/src/list/list.d.ts +10 -0
- package/src/list/list.d.ts.map +1 -0
- package/src/list/nav-list-item.d.ts +12 -0
- package/src/list/nav-list-item.d.ts.map +1 -0
- package/src/list/radio-list-item.d.ts +10 -0
- package/src/list/radio-list-item.d.ts.map +1 -0
- package/src/menu/menu.d.ts +10 -0
- package/src/menu/menu.d.ts.map +1 -0
- package/src/radio/radio.d.ts +10 -0
- package/src/radio/radio.d.ts.map +1 -0
- package/src/select/select.d.ts +10 -0
- package/src/select/select.d.ts.map +1 -0
- package/src/side-sheet/side-sheet.d.ts +18 -0
- package/src/side-sheet/side-sheet.d.ts.map +1 -0
- package/src/slider/slider-range.d.ts +10 -0
- package/src/slider/slider-range.d.ts.map +1 -0
- package/src/slider/slider.d.ts +10 -0
- package/src/slider/slider.d.ts.map +1 -0
- package/src/snackbar/snackbar.d.ts +10 -0
- package/src/snackbar/snackbar.d.ts.map +1 -0
- package/src/status-header/status-header-base.d.ts +9 -0
- package/src/status-header/status-header-base.d.ts.map +1 -0
- package/src/status-header/status-header-item.d.ts +17 -0
- package/src/status-header/status-header-item.d.ts.map +1 -0
- package/src/status-header/status-header.d.ts +15 -0
- package/src/status-header/status-header.d.ts.map +1 -0
- package/src/switch/switch.d.ts +10 -0
- package/src/switch/switch.d.ts.map +1 -0
- package/src/tab/tab-bar.d.ts +10 -0
- package/src/tab/tab-bar.d.ts.map +1 -0
- package/src/tab/tab.d.ts +10 -0
- package/src/tab/tab.d.ts.map +1 -0
- package/src/text-lockup/text-lockup.d.ts +17 -0
- package/src/text-lockup/text-lockup.d.ts.map +1 -0
- package/src/textarea/textarea.d.ts +10 -0
- package/src/textarea/textarea.d.ts.map +1 -0
- package/src/textfield/textfield.d.ts +10 -0
- package/src/textfield/textfield.d.ts.map +1 -0
- package/src/toolbar/toolbar.d.ts +10 -0
- package/src/toolbar/toolbar.d.ts.map +1 -0
- package/src/tooltip/tooltip.d.ts +27 -0
- package/src/tooltip/tooltip.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts +10 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar.d.ts +10 -0
- package/src/top-app-bar/top-app-bar.d.ts.map +1 -0
- package/src/tree-list/tree-list-item.d.ts +16 -0
- package/src/tree-list/tree-list-item.d.ts.map +1 -0
- package/src/tree-list/tree-list.d.ts +11 -0
- package/src/tree-list/tree-list.d.ts.map +1 -0
- package/src/typography/typography.d.ts +12 -0
- package/src/typography/typography.d.ts.map +1 -0
- package/state.mjs +12 -0
- package/status-header-item.mjs +16 -16
- package/status-header.mjs +5 -5
- package/style-map.mjs +40 -0
- package/switch.mjs +531 -15
- package/tab-bar.mjs +1030 -13
- package/tab.mjs +29 -15
- package/text-lockup.mjs +8 -8
- package/textarea.mjs +111 -16
- package/textfield.mjs +34 -18
- package/textfield2.mjs +929 -2
- package/toolbar.mjs +8 -3
- package/tooltip.mjs +1153 -96
- package/top-app-bar-fixed.mjs +78 -18
- package/top-app-bar.mjs +19 -15
- package/top-app-bar2.mjs +9 -2
- package/tree-list-item.mjs +3 -3
- package/tree-list.mjs +6 -7
- package/tslib.es6.mjs +82 -0
- package/typography.mjs +8 -8
- package/utils.mjs +52 -0
@@ -0,0 +1,528 @@
|
|
1
|
+
import { _ as v, a as c, b as i } from "./tslib.es6.mjs";
|
2
|
+
import { R as g, e as y } from "./ripple-handlers.mjs";
|
3
|
+
import { a as f } from "./aria-property.mjs";
|
4
|
+
import { F as R } from "./form-element.mjs";
|
5
|
+
import { o as m } from "./observer.mjs";
|
6
|
+
import { y as u } from "./query-assigned-elements.mjs";
|
7
|
+
import { e as a } from "./property.mjs";
|
8
|
+
import { t as l } from "./state.mjs";
|
9
|
+
import { e as C } from "./event-options.mjs";
|
10
|
+
import { i as b } from "./query.mjs";
|
11
|
+
import { o as E } from "./class-map.mjs";
|
12
|
+
import { l as h } from "./if-defined.mjs";
|
13
|
+
import { a as k } from "./utils.mjs";
|
14
|
+
/**
|
15
|
+
* @license
|
16
|
+
* Copyright 2020 Google LLC
|
17
|
+
* SPDX-License-Identifier: Apache-2.0
|
18
|
+
*/
|
19
|
+
const p = Symbol("selection controller");
|
20
|
+
class _ {
|
21
|
+
constructor() {
|
22
|
+
this.selected = null, this.ordered = null, this.set = /* @__PURE__ */ new Set();
|
23
|
+
}
|
24
|
+
}
|
25
|
+
class d {
|
26
|
+
constructor(e) {
|
27
|
+
this.sets = {}, this.focusedSet = null, this.mouseIsDown = !1, this.updating = !1, e.addEventListener("keydown", (t) => {
|
28
|
+
this.keyDownHandler(t);
|
29
|
+
}), e.addEventListener("mousedown", () => {
|
30
|
+
this.mousedownHandler();
|
31
|
+
}), e.addEventListener("mouseup", () => {
|
32
|
+
this.mouseupHandler();
|
33
|
+
});
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Get a controller for the given element. If no controller exists, one will
|
37
|
+
* be created. Defaults to getting the controller scoped to the element's root
|
38
|
+
* node shadow root unless `element.global` is true. Then, it will get a
|
39
|
+
* `window.document`-scoped controller.
|
40
|
+
*
|
41
|
+
* @param element Element from which to get / create a SelectionController. If
|
42
|
+
* `element.global` is true, it gets a selection controller scoped to
|
43
|
+
* `window.document`.
|
44
|
+
*/
|
45
|
+
static getController(e) {
|
46
|
+
const s = !("global" in e) || "global" in e && e.global ? document : e.getRootNode();
|
47
|
+
let n = s[p];
|
48
|
+
return n === void 0 && (n = new d(s), s[p] = n), n;
|
49
|
+
}
|
50
|
+
keyDownHandler(e) {
|
51
|
+
const t = e.target;
|
52
|
+
"checked" in t && this.has(t) && (e.key == "ArrowRight" || e.key == "ArrowDown" ? this.selectNext(t) : (e.key == "ArrowLeft" || e.key == "ArrowUp") && this.selectPrevious(t));
|
53
|
+
}
|
54
|
+
mousedownHandler() {
|
55
|
+
this.mouseIsDown = !0;
|
56
|
+
}
|
57
|
+
mouseupHandler() {
|
58
|
+
this.mouseIsDown = !1;
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Whether or not the controller controls the given element.
|
62
|
+
*
|
63
|
+
* @param element element to check
|
64
|
+
*/
|
65
|
+
has(e) {
|
66
|
+
return this.getSet(e.name).set.has(e);
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* Selects and returns the controlled element previous to the given element in
|
70
|
+
* document position order. See
|
71
|
+
* [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
|
72
|
+
*
|
73
|
+
* @param element element relative from which preceding element is fetched
|
74
|
+
*/
|
75
|
+
selectPrevious(e) {
|
76
|
+
const t = this.getOrdered(e), s = t.indexOf(e), n = t[s - 1] || t[t.length - 1];
|
77
|
+
return this.select(n), n;
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Selects and returns the controlled element next to the given element in
|
81
|
+
* document position order. See
|
82
|
+
* [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
|
83
|
+
*
|
84
|
+
* @param element element relative from which following element is fetched
|
85
|
+
*/
|
86
|
+
selectNext(e) {
|
87
|
+
const t = this.getOrdered(e), s = t.indexOf(e), n = t[s + 1] || t[0];
|
88
|
+
return this.select(n), n;
|
89
|
+
}
|
90
|
+
select(e) {
|
91
|
+
e.click();
|
92
|
+
}
|
93
|
+
/**
|
94
|
+
* Focuses the selected element in the given element's selection set. User's
|
95
|
+
* mouse selection will override this focus.
|
96
|
+
*
|
97
|
+
* @param element Element from which selection set is derived and subsequently
|
98
|
+
* focused.
|
99
|
+
* @deprecated update() method now handles focus management by setting
|
100
|
+
* appropriate tabindex to form element.
|
101
|
+
*/
|
102
|
+
focus(e) {
|
103
|
+
if (this.mouseIsDown)
|
104
|
+
return;
|
105
|
+
const t = this.getSet(e.name), s = this.focusedSet;
|
106
|
+
this.focusedSet = t, s != t && t.selected && t.selected != e && t.selected.focus();
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* @return Returns true if atleast one radio is selected in the radio group.
|
110
|
+
*/
|
111
|
+
isAnySelected(e) {
|
112
|
+
const t = this.getSet(e.name);
|
113
|
+
for (const s of t.set)
|
114
|
+
if (s.checked)
|
115
|
+
return !0;
|
116
|
+
return !1;
|
117
|
+
}
|
118
|
+
/**
|
119
|
+
* Returns the elements in the given element's selection set in document
|
120
|
+
* position order.
|
121
|
+
* [Node.compareDocumentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
|
122
|
+
*
|
123
|
+
* @param element Element from which selection set is derived and subsequently
|
124
|
+
* ordered.
|
125
|
+
*/
|
126
|
+
getOrdered(e) {
|
127
|
+
const t = this.getSet(e.name);
|
128
|
+
return t.ordered || (t.ordered = Array.from(t.set), t.ordered.sort((s, n) => s.compareDocumentPosition(n) == Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0)), t.ordered;
|
129
|
+
}
|
130
|
+
/**
|
131
|
+
* Gets the selection set of the given name and creates one if it does not yet
|
132
|
+
* exist.
|
133
|
+
*
|
134
|
+
* @param name Name of set
|
135
|
+
*/
|
136
|
+
getSet(e) {
|
137
|
+
return this.sets[e] || (this.sets[e] = new _()), this.sets[e];
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Register the element in the selection controller.
|
141
|
+
*
|
142
|
+
* @param element Element to register. Registers in set of `element.name`.
|
143
|
+
*/
|
144
|
+
register(e) {
|
145
|
+
const t = e.name || e.getAttribute("name") || "", s = this.getSet(t);
|
146
|
+
s.set.add(e), s.ordered = null;
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* Unregister the element from selection controller.
|
150
|
+
*
|
151
|
+
* @param element Element to register. Registers in set of `element.name`.
|
152
|
+
*/
|
153
|
+
unregister(e) {
|
154
|
+
const t = this.getSet(e.name);
|
155
|
+
t.set.delete(e), t.ordered = null, t.selected == e && (t.selected = null);
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Unselects other elements in element's set if element is checked. Noop
|
159
|
+
* otherwise.
|
160
|
+
*
|
161
|
+
* @param element Element from which to calculate selection controller update.
|
162
|
+
*/
|
163
|
+
update(e) {
|
164
|
+
if (this.updating)
|
165
|
+
return;
|
166
|
+
this.updating = !0;
|
167
|
+
const t = this.getSet(e.name);
|
168
|
+
if (e.checked) {
|
169
|
+
for (const s of t.set)
|
170
|
+
s != e && (s.checked = !1);
|
171
|
+
t.selected = e;
|
172
|
+
}
|
173
|
+
if (this.isAnySelected(e))
|
174
|
+
for (const s of t.set) {
|
175
|
+
if (s.formElementTabIndex === void 0)
|
176
|
+
break;
|
177
|
+
s.formElementTabIndex = s.checked ? 0 : -1;
|
178
|
+
}
|
179
|
+
this.updating = !1;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
/**
|
183
|
+
* @license
|
184
|
+
* Copyright 2016 Google Inc.
|
185
|
+
*
|
186
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
187
|
+
* of this software and associated documentation files (the "Software"), to deal
|
188
|
+
* in the Software without restriction, including without limitation the rights
|
189
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
190
|
+
* copies of the Software, and to permit persons to whom the Software is
|
191
|
+
* furnished to do so, subject to the following conditions:
|
192
|
+
*
|
193
|
+
* The above copyright notice and this permission notice shall be included in
|
194
|
+
* all copies or substantial portions of the Software.
|
195
|
+
*
|
196
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
197
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
198
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
199
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
200
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
201
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
202
|
+
* THE SOFTWARE.
|
203
|
+
*/
|
204
|
+
var D = (
|
205
|
+
/** @class */
|
206
|
+
function() {
|
207
|
+
function r(e) {
|
208
|
+
e === void 0 && (e = {}), this.adapter = e;
|
209
|
+
}
|
210
|
+
return Object.defineProperty(r, "cssClasses", {
|
211
|
+
get: function() {
|
212
|
+
return {};
|
213
|
+
},
|
214
|
+
enumerable: !1,
|
215
|
+
configurable: !0
|
216
|
+
}), Object.defineProperty(r, "strings", {
|
217
|
+
get: function() {
|
218
|
+
return {};
|
219
|
+
},
|
220
|
+
enumerable: !1,
|
221
|
+
configurable: !0
|
222
|
+
}), Object.defineProperty(r, "numbers", {
|
223
|
+
get: function() {
|
224
|
+
return {};
|
225
|
+
},
|
226
|
+
enumerable: !1,
|
227
|
+
configurable: !0
|
228
|
+
}), Object.defineProperty(r, "defaultAdapter", {
|
229
|
+
get: function() {
|
230
|
+
return {};
|
231
|
+
},
|
232
|
+
enumerable: !1,
|
233
|
+
configurable: !0
|
234
|
+
}), r.prototype.init = function() {
|
235
|
+
}, r.prototype.destroy = function() {
|
236
|
+
}, r;
|
237
|
+
}()
|
238
|
+
);
|
239
|
+
/**
|
240
|
+
* @license
|
241
|
+
* Copyright 2016 Google Inc.
|
242
|
+
*
|
243
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
244
|
+
* of this software and associated documentation files (the "Software"), to deal
|
245
|
+
* in the Software without restriction, including without limitation the rights
|
246
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
247
|
+
* copies of the Software, and to permit persons to whom the Software is
|
248
|
+
* furnished to do so, subject to the following conditions:
|
249
|
+
*
|
250
|
+
* The above copyright notice and this permission notice shall be included in
|
251
|
+
* all copies or substantial portions of the Software.
|
252
|
+
*
|
253
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
254
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
255
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
256
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
257
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
258
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
259
|
+
* THE SOFTWARE.
|
260
|
+
*/
|
261
|
+
var S = {
|
262
|
+
NATIVE_CONTROL_SELECTOR: ".mdc-radio__native-control"
|
263
|
+
}, w = {
|
264
|
+
DISABLED: "mdc-radio--disabled",
|
265
|
+
ROOT: "mdc-radio"
|
266
|
+
};
|
267
|
+
/**
|
268
|
+
* @license
|
269
|
+
* Copyright 2016 Google Inc.
|
270
|
+
*
|
271
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
272
|
+
* of this software and associated documentation files (the "Software"), to deal
|
273
|
+
* in the Software without restriction, including without limitation the rights
|
274
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
275
|
+
* copies of the Software, and to permit persons to whom the Software is
|
276
|
+
* furnished to do so, subject to the following conditions:
|
277
|
+
*
|
278
|
+
* The above copyright notice and this permission notice shall be included in
|
279
|
+
* all copies or substantial portions of the Software.
|
280
|
+
*
|
281
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
282
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
283
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
284
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
285
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
286
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
287
|
+
* THE SOFTWARE.
|
288
|
+
*/
|
289
|
+
var $ = (
|
290
|
+
/** @class */
|
291
|
+
function(r) {
|
292
|
+
v(e, r);
|
293
|
+
function e(t) {
|
294
|
+
return r.call(this, c(c({}, e.defaultAdapter), t)) || this;
|
295
|
+
}
|
296
|
+
return Object.defineProperty(e, "cssClasses", {
|
297
|
+
get: function() {
|
298
|
+
return w;
|
299
|
+
},
|
300
|
+
enumerable: !1,
|
301
|
+
configurable: !0
|
302
|
+
}), Object.defineProperty(e, "strings", {
|
303
|
+
get: function() {
|
304
|
+
return S;
|
305
|
+
},
|
306
|
+
enumerable: !1,
|
307
|
+
configurable: !0
|
308
|
+
}), Object.defineProperty(e, "defaultAdapter", {
|
309
|
+
get: function() {
|
310
|
+
return {
|
311
|
+
addClass: function() {
|
312
|
+
},
|
313
|
+
removeClass: function() {
|
314
|
+
},
|
315
|
+
setNativeControlDisabled: function() {
|
316
|
+
}
|
317
|
+
};
|
318
|
+
},
|
319
|
+
enumerable: !1,
|
320
|
+
configurable: !0
|
321
|
+
}), e.prototype.setDisabled = function(t) {
|
322
|
+
var s = e.cssClasses.DISABLED;
|
323
|
+
this.adapter.setNativeControlDisabled(t), t ? this.adapter.addClass(s) : this.adapter.removeClass(s);
|
324
|
+
}, e;
|
325
|
+
}(D)
|
326
|
+
);
|
327
|
+
const O = $;
|
328
|
+
/**
|
329
|
+
* @license
|
330
|
+
* Copyright 2018 Google LLC
|
331
|
+
* SPDX-License-Identifier: Apache-2.0
|
332
|
+
*/
|
333
|
+
class o extends R {
|
334
|
+
constructor() {
|
335
|
+
super(...arguments), this._checked = !1, this.useStateLayerCustomProperties = !1, this.global = !1, this.disabled = !1, this.value = "on", this.name = "", this.reducedTouchTarget = !1, this.mdcFoundationClass = O, this.formElementTabIndex = 0, this.focused = !1, this.shouldRenderRipple = !1, this.rippleElement = null, this.rippleHandlers = new g(() => (this.shouldRenderRipple = !0, this.ripple.then((e) => {
|
336
|
+
this.rippleElement = e;
|
337
|
+
}), this.ripple));
|
338
|
+
}
|
339
|
+
get checked() {
|
340
|
+
return this._checked;
|
341
|
+
}
|
342
|
+
/**
|
343
|
+
* We define our own getter/setter for `checked` because we need to track
|
344
|
+
* changes to it synchronously.
|
345
|
+
*
|
346
|
+
* The order in which the `checked` property is set across radio buttons
|
347
|
+
* within the same group is very important. However, we can't rely on
|
348
|
+
* UpdatingElement's `updated` callback to observe these changes (which is
|
349
|
+
* also what the `@observer` decorator uses), because it batches changes to
|
350
|
+
* all properties.
|
351
|
+
*
|
352
|
+
* Consider:
|
353
|
+
*
|
354
|
+
* radio1.disabled = true;
|
355
|
+
* radio2.checked = true;
|
356
|
+
* radio1.checked = true;
|
357
|
+
*
|
358
|
+
* In this case we'd first see all changes for radio1, and then for radio2,
|
359
|
+
* and we couldn't tell that radio1 was the most recently checked.
|
360
|
+
*/
|
361
|
+
set checked(e) {
|
362
|
+
var t, s;
|
363
|
+
const n = this._checked;
|
364
|
+
e !== n && (this._checked = e, this.formElement && (this.formElement.checked = e), (t = this._selectionController) === null || t === void 0 || t.update(this), e === !1 && ((s = this.formElement) === null || s === void 0 || s.blur()), this.requestUpdate("checked", n), this.dispatchEvent(new Event("checked", { bubbles: !0, composed: !0 })));
|
365
|
+
}
|
366
|
+
_handleUpdatedValue(e) {
|
367
|
+
this.formElement.value = e;
|
368
|
+
}
|
369
|
+
/** @soyTemplate */
|
370
|
+
renderRipple() {
|
371
|
+
return this.shouldRenderRipple ? u`<mwc-ripple unbounded accent
|
372
|
+
.internalUseStateLayerCustomProperties="${this.useStateLayerCustomProperties}"
|
373
|
+
.disabled="${this.disabled}"></mwc-ripple>` : "";
|
374
|
+
}
|
375
|
+
get isRippleActive() {
|
376
|
+
var e;
|
377
|
+
return ((e = this.rippleElement) === null || e === void 0 ? void 0 : e.isActive) || !1;
|
378
|
+
}
|
379
|
+
connectedCallback() {
|
380
|
+
super.connectedCallback(), this._selectionController = d.getController(this), this._selectionController.register(this), this._selectionController.update(this);
|
381
|
+
}
|
382
|
+
disconnectedCallback() {
|
383
|
+
this._selectionController.unregister(this), this._selectionController = void 0;
|
384
|
+
}
|
385
|
+
focus() {
|
386
|
+
this.formElement.focus();
|
387
|
+
}
|
388
|
+
createAdapter() {
|
389
|
+
return Object.assign(Object.assign({}, k(this.mdcRoot)), { setNativeControlDisabled: (e) => {
|
390
|
+
this.formElement.disabled = e;
|
391
|
+
} });
|
392
|
+
}
|
393
|
+
handleFocus() {
|
394
|
+
this.focused = !0, this.handleRippleFocus();
|
395
|
+
}
|
396
|
+
handleClick() {
|
397
|
+
this.formElement.focus();
|
398
|
+
}
|
399
|
+
handleBlur() {
|
400
|
+
this.focused = !1, this.formElement.blur(), this.rippleHandlers.endFocus();
|
401
|
+
}
|
402
|
+
setFormData(e) {
|
403
|
+
this.name && this.checked && e.append(this.name, this.value);
|
404
|
+
}
|
405
|
+
/**
|
406
|
+
* @soyTemplate
|
407
|
+
* @soyAttributes radioAttributes: input
|
408
|
+
* @soyClasses radioClasses: .mdc-radio
|
409
|
+
*/
|
410
|
+
render() {
|
411
|
+
const e = {
|
412
|
+
"mdc-radio--touch": !this.reducedTouchTarget,
|
413
|
+
"mdc-ripple-upgraded--background-focused": this.focused,
|
414
|
+
"mdc-radio--disabled": this.disabled
|
415
|
+
};
|
416
|
+
return u`
|
417
|
+
<div class="mdc-radio ${E(e)}">
|
418
|
+
<input
|
419
|
+
tabindex="${this.formElementTabIndex}"
|
420
|
+
class="mdc-radio__native-control"
|
421
|
+
type="radio"
|
422
|
+
name="${this.name}"
|
423
|
+
aria-label="${h(this.ariaLabel)}"
|
424
|
+
aria-labelledby="${h(this.ariaLabelledBy)}"
|
425
|
+
.checked="${this.checked}"
|
426
|
+
.value="${this.value}"
|
427
|
+
?disabled="${this.disabled}"
|
428
|
+
@change="${this.changeHandler}"
|
429
|
+
@focus="${this.handleFocus}"
|
430
|
+
@click="${this.handleClick}"
|
431
|
+
@blur="${this.handleBlur}"
|
432
|
+
@mousedown="${this.handleRippleMouseDown}"
|
433
|
+
@mouseenter="${this.handleRippleMouseEnter}"
|
434
|
+
@mouseleave="${this.handleRippleMouseLeave}"
|
435
|
+
@touchstart="${this.handleRippleTouchStart}"
|
436
|
+
@touchend="${this.handleRippleDeactivate}"
|
437
|
+
@touchcancel="${this.handleRippleDeactivate}">
|
438
|
+
<div class="mdc-radio__background">
|
439
|
+
<div class="mdc-radio__outer-circle"></div>
|
440
|
+
<div class="mdc-radio__inner-circle"></div>
|
441
|
+
</div>
|
442
|
+
${this.renderRipple()}
|
443
|
+
</div>`;
|
444
|
+
}
|
445
|
+
handleRippleMouseDown(e) {
|
446
|
+
const t = () => {
|
447
|
+
window.removeEventListener("mouseup", t), this.handleRippleDeactivate();
|
448
|
+
};
|
449
|
+
window.addEventListener("mouseup", t), this.rippleHandlers.startPress(e);
|
450
|
+
}
|
451
|
+
handleRippleTouchStart(e) {
|
452
|
+
this.rippleHandlers.startPress(e);
|
453
|
+
}
|
454
|
+
handleRippleDeactivate() {
|
455
|
+
this.rippleHandlers.endPress();
|
456
|
+
}
|
457
|
+
handleRippleMouseEnter() {
|
458
|
+
this.rippleHandlers.startHover();
|
459
|
+
}
|
460
|
+
handleRippleMouseLeave() {
|
461
|
+
this.rippleHandlers.endHover();
|
462
|
+
}
|
463
|
+
handleRippleFocus() {
|
464
|
+
this.rippleHandlers.startFocus();
|
465
|
+
}
|
466
|
+
changeHandler() {
|
467
|
+
this.checked = this.formElement.checked;
|
468
|
+
}
|
469
|
+
}
|
470
|
+
i([
|
471
|
+
b(".mdc-radio")
|
472
|
+
], o.prototype, "mdcRoot", void 0);
|
473
|
+
i([
|
474
|
+
b("input")
|
475
|
+
], o.prototype, "formElement", void 0);
|
476
|
+
i([
|
477
|
+
l()
|
478
|
+
], o.prototype, "useStateLayerCustomProperties", void 0);
|
479
|
+
i([
|
480
|
+
a({ type: Boolean })
|
481
|
+
], o.prototype, "global", void 0);
|
482
|
+
i([
|
483
|
+
a({ type: Boolean, reflect: !0 })
|
484
|
+
], o.prototype, "checked", null);
|
485
|
+
i([
|
486
|
+
a({ type: Boolean }),
|
487
|
+
m(function(r) {
|
488
|
+
this.mdcFoundation.setDisabled(r);
|
489
|
+
})
|
490
|
+
], o.prototype, "disabled", void 0);
|
491
|
+
i([
|
492
|
+
a({ type: String }),
|
493
|
+
m(function(r) {
|
494
|
+
this._handleUpdatedValue(r);
|
495
|
+
})
|
496
|
+
], o.prototype, "value", void 0);
|
497
|
+
i([
|
498
|
+
a({ type: String })
|
499
|
+
], o.prototype, "name", void 0);
|
500
|
+
i([
|
501
|
+
a({ type: Boolean })
|
502
|
+
], o.prototype, "reducedTouchTarget", void 0);
|
503
|
+
i([
|
504
|
+
a({ type: Number })
|
505
|
+
], o.prototype, "formElementTabIndex", void 0);
|
506
|
+
i([
|
507
|
+
l()
|
508
|
+
], o.prototype, "focused", void 0);
|
509
|
+
i([
|
510
|
+
l()
|
511
|
+
], o.prototype, "shouldRenderRipple", void 0);
|
512
|
+
i([
|
513
|
+
y("mwc-ripple")
|
514
|
+
], o.prototype, "ripple", void 0);
|
515
|
+
i([
|
516
|
+
f,
|
517
|
+
a({ attribute: "aria-label" })
|
518
|
+
], o.prototype, "ariaLabel", void 0);
|
519
|
+
i([
|
520
|
+
f,
|
521
|
+
a({ attribute: "aria-labelledby" })
|
522
|
+
], o.prototype, "ariaLabelledBy", void 0);
|
523
|
+
i([
|
524
|
+
C({ passive: !0 })
|
525
|
+
], o.prototype, "handleRippleTouchStart", null);
|
526
|
+
export {
|
527
|
+
o as R
|
528
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { i as r } from "./query-assigned-elements.mjs";
|
2
|
+
/**
|
3
|
+
* @license
|
4
|
+
* Copyright 2021 Google LLC
|
5
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
6
|
+
*/
|
7
|
+
const o = r`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc((40px - 20px) / 2)}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.54)}.mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio .mdc-radio__background::before{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__background::before{top:calc(-1 * (40px - 20px) / 2);left:calc(-1 * (40px - 20px) / 2);width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:calc((40px - 40px) / 2);right:calc((40px - 40px) / 2);left:calc((40px - 40px) / 2);width:40px;height:40px}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}:host{display:inline-block;outline:none}.mdc-radio{vertical-align:bottom}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unchecked-color, rgba(0, 0, 0, 0.54))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}`;
|
8
|
+
export {
|
9
|
+
o as s
|
10
|
+
};
|