@covalent/components 6.0.1 → 6.0.3
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
package/textfield2.mjs
CHANGED
@@ -1,5 +1,932 @@
|
|
1
|
-
|
1
|
+
import { _ as H, a as C, c as b, b as a } from "./tslib.es6.mjs";
|
2
|
+
import { f as $, l as w } from "./mwc-line-ripple-directive.mjs";
|
3
|
+
import { F as B } from "./form-element.mjs";
|
4
|
+
import { o as E } from "./observer.mjs";
|
5
|
+
import { x, b as U, y as c } from "./query-assigned-elements.mjs";
|
6
|
+
import { e as l } from "./property.mjs";
|
7
|
+
import { t as I } from "./state.mjs";
|
8
|
+
import { e as _ } from "./event-options.mjs";
|
9
|
+
import { i as y } from "./query.mjs";
|
10
|
+
import { e as T, i as M, t as v, o as L } from "./class-map.mjs";
|
11
|
+
import { l as u } from "./if-defined.mjs";
|
12
|
+
import { e as k, s as S } from "./directive-helpers.mjs";
|
13
|
+
import { a as D } from "./utils.mjs";
|
14
|
+
/**
|
15
|
+
* @license
|
16
|
+
* Copyright 2016 Google Inc.
|
17
|
+
*
|
18
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
19
|
+
* of this software and associated documentation files (the "Software"), to deal
|
20
|
+
* in the Software without restriction, including without limitation the rights
|
21
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
22
|
+
* copies of the Software, and to permit persons to whom the Software is
|
23
|
+
* furnished to do so, subject to the following conditions:
|
24
|
+
*
|
25
|
+
* The above copyright notice and this permission notice shall be included in
|
26
|
+
* all copies or substantial portions of the Software.
|
27
|
+
*
|
28
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
29
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
30
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
31
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
32
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
33
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
34
|
+
* THE SOFTWARE.
|
35
|
+
*/
|
36
|
+
var j = (
|
37
|
+
/** @class */
|
38
|
+
function() {
|
39
|
+
function s(e) {
|
40
|
+
e === void 0 && (e = {}), this.adapter = e;
|
41
|
+
}
|
42
|
+
return Object.defineProperty(s, "cssClasses", {
|
43
|
+
get: function() {
|
44
|
+
return {};
|
45
|
+
},
|
46
|
+
enumerable: !1,
|
47
|
+
configurable: !0
|
48
|
+
}), Object.defineProperty(s, "strings", {
|
49
|
+
get: function() {
|
50
|
+
return {};
|
51
|
+
},
|
52
|
+
enumerable: !1,
|
53
|
+
configurable: !0
|
54
|
+
}), Object.defineProperty(s, "numbers", {
|
55
|
+
get: function() {
|
56
|
+
return {};
|
57
|
+
},
|
58
|
+
enumerable: !1,
|
59
|
+
configurable: !0
|
60
|
+
}), Object.defineProperty(s, "defaultAdapter", {
|
61
|
+
get: function() {
|
62
|
+
return {};
|
63
|
+
},
|
64
|
+
enumerable: !1,
|
65
|
+
configurable: !0
|
66
|
+
}), s.prototype.init = function() {
|
67
|
+
}, s.prototype.destroy = function() {
|
68
|
+
}, s;
|
69
|
+
}()
|
70
|
+
);
|
71
|
+
/**
|
72
|
+
* @license
|
73
|
+
* Copyright 2016 Google Inc.
|
74
|
+
*
|
75
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
76
|
+
* of this software and associated documentation files (the "Software"), to deal
|
77
|
+
* in the Software without restriction, including without limitation the rights
|
78
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
79
|
+
* copies of the Software, and to permit persons to whom the Software is
|
80
|
+
* furnished to do so, subject to the following conditions:
|
81
|
+
*
|
82
|
+
* The above copyright notice and this permission notice shall be included in
|
83
|
+
* all copies or substantial portions of the Software.
|
84
|
+
*
|
85
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
86
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
87
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
88
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
89
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
90
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
91
|
+
* THE SOFTWARE.
|
92
|
+
*/
|
93
|
+
var F = {
|
94
|
+
ARIA_CONTROLS: "aria-controls",
|
95
|
+
ARIA_DESCRIBEDBY: "aria-describedby",
|
96
|
+
INPUT_SELECTOR: ".mdc-text-field__input",
|
97
|
+
LABEL_SELECTOR: ".mdc-floating-label",
|
98
|
+
LEADING_ICON_SELECTOR: ".mdc-text-field__icon--leading",
|
99
|
+
LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
|
100
|
+
OUTLINE_SELECTOR: ".mdc-notched-outline",
|
101
|
+
PREFIX_SELECTOR: ".mdc-text-field__affix--prefix",
|
102
|
+
SUFFIX_SELECTOR: ".mdc-text-field__affix--suffix",
|
103
|
+
TRAILING_ICON_SELECTOR: ".mdc-text-field__icon--trailing"
|
104
|
+
}, P = {
|
105
|
+
DISABLED: "mdc-text-field--disabled",
|
106
|
+
FOCUSED: "mdc-text-field--focused",
|
107
|
+
HELPER_LINE: "mdc-text-field-helper-line",
|
108
|
+
INVALID: "mdc-text-field--invalid",
|
109
|
+
LABEL_FLOATING: "mdc-text-field--label-floating",
|
110
|
+
NO_LABEL: "mdc-text-field--no-label",
|
111
|
+
OUTLINED: "mdc-text-field--outlined",
|
112
|
+
ROOT: "mdc-text-field",
|
113
|
+
TEXTAREA: "mdc-text-field--textarea",
|
114
|
+
WITH_LEADING_ICON: "mdc-text-field--with-leading-icon",
|
115
|
+
WITH_TRAILING_ICON: "mdc-text-field--with-trailing-icon",
|
116
|
+
WITH_INTERNAL_COUNTER: "mdc-text-field--with-internal-counter"
|
117
|
+
}, O = {
|
118
|
+
LABEL_SCALE: 0.75
|
119
|
+
}, q = [
|
120
|
+
"pattern",
|
121
|
+
"min",
|
122
|
+
"max",
|
123
|
+
"required",
|
124
|
+
"step",
|
125
|
+
"minlength",
|
126
|
+
"maxlength"
|
127
|
+
], z = [
|
128
|
+
"color",
|
129
|
+
"date",
|
130
|
+
"datetime-local",
|
131
|
+
"month",
|
132
|
+
"range",
|
133
|
+
"time",
|
134
|
+
"week"
|
135
|
+
];
|
136
|
+
/**
|
137
|
+
* @license
|
138
|
+
* Copyright 2016 Google Inc.
|
139
|
+
*
|
140
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
141
|
+
* of this software and associated documentation files (the "Software"), to deal
|
142
|
+
* in the Software without restriction, including without limitation the rights
|
143
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
144
|
+
* copies of the Software, and to permit persons to whom the Software is
|
145
|
+
* furnished to do so, subject to the following conditions:
|
146
|
+
*
|
147
|
+
* The above copyright notice and this permission notice shall be included in
|
148
|
+
* all copies or substantial portions of the Software.
|
149
|
+
*
|
150
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
151
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
152
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
153
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
154
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
155
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
156
|
+
* THE SOFTWARE.
|
157
|
+
*/
|
158
|
+
var A = ["mousedown", "touchstart"], V = ["click", "keydown"], X = (
|
159
|
+
/** @class */
|
160
|
+
function(s) {
|
161
|
+
H(e, s);
|
162
|
+
function e(t, i) {
|
163
|
+
i === void 0 && (i = {});
|
164
|
+
var n = s.call(this, C(C({}, e.defaultAdapter), t)) || this;
|
165
|
+
return n.isFocused = !1, n.receivedUserInput = !1, n.valid = !0, n.useNativeValidation = !0, n.validateOnValueChange = !0, n.helperText = i.helperText, n.characterCounter = i.characterCounter, n.leadingIcon = i.leadingIcon, n.trailingIcon = i.trailingIcon, n.inputFocusHandler = function() {
|
166
|
+
n.activateFocus();
|
167
|
+
}, n.inputBlurHandler = function() {
|
168
|
+
n.deactivateFocus();
|
169
|
+
}, n.inputInputHandler = function() {
|
170
|
+
n.handleInput();
|
171
|
+
}, n.setPointerXOffset = function(o) {
|
172
|
+
n.setTransformOrigin(o);
|
173
|
+
}, n.textFieldInteractionHandler = function() {
|
174
|
+
n.handleTextFieldInteraction();
|
175
|
+
}, n.validationAttributeChangeHandler = function(o) {
|
176
|
+
n.handleValidationAttributeChange(o);
|
177
|
+
}, n;
|
178
|
+
}
|
179
|
+
return Object.defineProperty(e, "cssClasses", {
|
180
|
+
get: function() {
|
181
|
+
return P;
|
182
|
+
},
|
183
|
+
enumerable: !1,
|
184
|
+
configurable: !0
|
185
|
+
}), Object.defineProperty(e, "strings", {
|
186
|
+
get: function() {
|
187
|
+
return F;
|
188
|
+
},
|
189
|
+
enumerable: !1,
|
190
|
+
configurable: !0
|
191
|
+
}), Object.defineProperty(e, "numbers", {
|
192
|
+
get: function() {
|
193
|
+
return O;
|
194
|
+
},
|
195
|
+
enumerable: !1,
|
196
|
+
configurable: !0
|
197
|
+
}), Object.defineProperty(e.prototype, "shouldAlwaysFloat", {
|
198
|
+
get: function() {
|
199
|
+
var t = this.getNativeInput().type;
|
200
|
+
return z.indexOf(t) >= 0;
|
201
|
+
},
|
202
|
+
enumerable: !1,
|
203
|
+
configurable: !0
|
204
|
+
}), Object.defineProperty(e.prototype, "shouldFloat", {
|
205
|
+
get: function() {
|
206
|
+
return this.shouldAlwaysFloat || this.isFocused || !!this.getValue() || this.isBadInput();
|
207
|
+
},
|
208
|
+
enumerable: !1,
|
209
|
+
configurable: !0
|
210
|
+
}), Object.defineProperty(e.prototype, "shouldShake", {
|
211
|
+
get: function() {
|
212
|
+
return !this.isFocused && !this.isValid() && !!this.getValue();
|
213
|
+
},
|
214
|
+
enumerable: !1,
|
215
|
+
configurable: !0
|
216
|
+
}), Object.defineProperty(e, "defaultAdapter", {
|
217
|
+
/**
|
218
|
+
* See {@link MDCTextFieldAdapter} for typing information on parameters and
|
219
|
+
* return types.
|
220
|
+
*/
|
221
|
+
get: function() {
|
222
|
+
return {
|
223
|
+
addClass: function() {
|
224
|
+
},
|
225
|
+
removeClass: function() {
|
226
|
+
},
|
227
|
+
hasClass: function() {
|
228
|
+
return !0;
|
229
|
+
},
|
230
|
+
setInputAttr: function() {
|
231
|
+
},
|
232
|
+
removeInputAttr: function() {
|
233
|
+
},
|
234
|
+
registerTextFieldInteractionHandler: function() {
|
235
|
+
},
|
236
|
+
deregisterTextFieldInteractionHandler: function() {
|
237
|
+
},
|
238
|
+
registerInputInteractionHandler: function() {
|
239
|
+
},
|
240
|
+
deregisterInputInteractionHandler: function() {
|
241
|
+
},
|
242
|
+
registerValidationAttributeChangeHandler: function() {
|
243
|
+
return new MutationObserver(function() {
|
244
|
+
});
|
245
|
+
},
|
246
|
+
deregisterValidationAttributeChangeHandler: function() {
|
247
|
+
},
|
248
|
+
getNativeInput: function() {
|
249
|
+
return null;
|
250
|
+
},
|
251
|
+
isFocused: function() {
|
252
|
+
return !1;
|
253
|
+
},
|
254
|
+
activateLineRipple: function() {
|
255
|
+
},
|
256
|
+
deactivateLineRipple: function() {
|
257
|
+
},
|
258
|
+
setLineRippleTransformOrigin: function() {
|
259
|
+
},
|
260
|
+
shakeLabel: function() {
|
261
|
+
},
|
262
|
+
floatLabel: function() {
|
263
|
+
},
|
264
|
+
setLabelRequired: function() {
|
265
|
+
},
|
266
|
+
hasLabel: function() {
|
267
|
+
return !1;
|
268
|
+
},
|
269
|
+
getLabelWidth: function() {
|
270
|
+
return 0;
|
271
|
+
},
|
272
|
+
hasOutline: function() {
|
273
|
+
return !1;
|
274
|
+
},
|
275
|
+
notchOutline: function() {
|
276
|
+
},
|
277
|
+
closeOutline: function() {
|
278
|
+
}
|
279
|
+
};
|
280
|
+
},
|
281
|
+
enumerable: !1,
|
282
|
+
configurable: !0
|
283
|
+
}), e.prototype.init = function() {
|
284
|
+
var t, i, n, o;
|
285
|
+
this.adapter.hasLabel() && this.getNativeInput().required && this.adapter.setLabelRequired(!0), this.adapter.isFocused() ? this.inputFocusHandler() : this.adapter.hasLabel() && this.shouldFloat && (this.notchOutline(!0), this.adapter.floatLabel(!0), this.styleFloating(!0)), this.adapter.registerInputInteractionHandler("focus", this.inputFocusHandler), this.adapter.registerInputInteractionHandler("blur", this.inputBlurHandler), this.adapter.registerInputInteractionHandler("input", this.inputInputHandler);
|
286
|
+
try {
|
287
|
+
for (var d = b(A), h = d.next(); !h.done; h = d.next()) {
|
288
|
+
var f = h.value;
|
289
|
+
this.adapter.registerInputInteractionHandler(f, this.setPointerXOffset);
|
290
|
+
}
|
291
|
+
} catch (g) {
|
292
|
+
t = { error: g };
|
293
|
+
} finally {
|
294
|
+
try {
|
295
|
+
h && !h.done && (i = d.return) && i.call(d);
|
296
|
+
} finally {
|
297
|
+
if (t)
|
298
|
+
throw t.error;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
try {
|
302
|
+
for (var m = b(V), p = m.next(); !p.done; p = m.next()) {
|
303
|
+
var f = p.value;
|
304
|
+
this.adapter.registerTextFieldInteractionHandler(f, this.textFieldInteractionHandler);
|
305
|
+
}
|
306
|
+
} catch (g) {
|
307
|
+
n = { error: g };
|
308
|
+
} finally {
|
309
|
+
try {
|
310
|
+
p && !p.done && (o = m.return) && o.call(m);
|
311
|
+
} finally {
|
312
|
+
if (n)
|
313
|
+
throw n.error;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
this.validationObserver = this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler), this.setcharacterCounter(this.getValue().length);
|
317
|
+
}, e.prototype.destroy = function() {
|
318
|
+
var t, i, n, o;
|
319
|
+
this.adapter.deregisterInputInteractionHandler("focus", this.inputFocusHandler), this.adapter.deregisterInputInteractionHandler("blur", this.inputBlurHandler), this.adapter.deregisterInputInteractionHandler("input", this.inputInputHandler);
|
320
|
+
try {
|
321
|
+
for (var d = b(A), h = d.next(); !h.done; h = d.next()) {
|
322
|
+
var f = h.value;
|
323
|
+
this.adapter.deregisterInputInteractionHandler(f, this.setPointerXOffset);
|
324
|
+
}
|
325
|
+
} catch (g) {
|
326
|
+
t = { error: g };
|
327
|
+
} finally {
|
328
|
+
try {
|
329
|
+
h && !h.done && (i = d.return) && i.call(d);
|
330
|
+
} finally {
|
331
|
+
if (t)
|
332
|
+
throw t.error;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
try {
|
336
|
+
for (var m = b(V), p = m.next(); !p.done; p = m.next()) {
|
337
|
+
var f = p.value;
|
338
|
+
this.adapter.deregisterTextFieldInteractionHandler(f, this.textFieldInteractionHandler);
|
339
|
+
}
|
340
|
+
} catch (g) {
|
341
|
+
n = { error: g };
|
342
|
+
} finally {
|
343
|
+
try {
|
344
|
+
p && !p.done && (o = m.return) && o.call(m);
|
345
|
+
} finally {
|
346
|
+
if (n)
|
347
|
+
throw n.error;
|
348
|
+
}
|
349
|
+
}
|
350
|
+
this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver);
|
351
|
+
}, e.prototype.handleTextFieldInteraction = function() {
|
352
|
+
var t = this.adapter.getNativeInput();
|
353
|
+
t && t.disabled || (this.receivedUserInput = !0);
|
354
|
+
}, e.prototype.handleValidationAttributeChange = function(t) {
|
355
|
+
var i = this;
|
356
|
+
t.some(function(n) {
|
357
|
+
return q.indexOf(n) > -1 ? (i.styleValidity(!0), i.adapter.setLabelRequired(i.getNativeInput().required), !0) : !1;
|
358
|
+
}), t.indexOf("maxlength") > -1 && this.setcharacterCounter(this.getValue().length);
|
359
|
+
}, e.prototype.notchOutline = function(t) {
|
360
|
+
if (!(!this.adapter.hasOutline() || !this.adapter.hasLabel()))
|
361
|
+
if (t) {
|
362
|
+
var i = this.adapter.getLabelWidth() * O.LABEL_SCALE;
|
363
|
+
this.adapter.notchOutline(i);
|
364
|
+
} else
|
365
|
+
this.adapter.closeOutline();
|
366
|
+
}, e.prototype.activateFocus = function() {
|
367
|
+
this.isFocused = !0, this.styleFocused(this.isFocused), this.adapter.activateLineRipple(), this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating(this.shouldFloat), this.adapter.shakeLabel(this.shouldShake)), this.helperText && (this.helperText.isPersistent() || !this.helperText.isValidation() || !this.valid) && this.helperText.showToScreenReader();
|
368
|
+
}, e.prototype.setTransformOrigin = function(t) {
|
369
|
+
if (!(this.isDisabled() || this.adapter.hasOutline())) {
|
370
|
+
var i = t.touches, n = i ? i[0] : t, o = n.target.getBoundingClientRect(), d = n.clientX - o.left;
|
371
|
+
this.adapter.setLineRippleTransformOrigin(d);
|
372
|
+
}
|
373
|
+
}, e.prototype.handleInput = function() {
|
374
|
+
this.autoCompleteFocus(), this.setcharacterCounter(this.getValue().length);
|
375
|
+
}, e.prototype.autoCompleteFocus = function() {
|
376
|
+
this.receivedUserInput || this.activateFocus();
|
377
|
+
}, e.prototype.deactivateFocus = function() {
|
378
|
+
this.isFocused = !1, this.adapter.deactivateLineRipple();
|
379
|
+
var t = this.isValid();
|
380
|
+
this.styleValidity(t), this.styleFocused(this.isFocused), this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating(this.shouldFloat), this.adapter.shakeLabel(this.shouldShake)), this.shouldFloat || (this.receivedUserInput = !1);
|
381
|
+
}, e.prototype.getValue = function() {
|
382
|
+
return this.getNativeInput().value;
|
383
|
+
}, e.prototype.setValue = function(t) {
|
384
|
+
if (this.getValue() !== t && (this.getNativeInput().value = t), this.setcharacterCounter(t.length), this.validateOnValueChange) {
|
385
|
+
var i = this.isValid();
|
386
|
+
this.styleValidity(i);
|
387
|
+
}
|
388
|
+
this.adapter.hasLabel() && (this.notchOutline(this.shouldFloat), this.adapter.floatLabel(this.shouldFloat), this.styleFloating(this.shouldFloat), this.validateOnValueChange && this.adapter.shakeLabel(this.shouldShake));
|
389
|
+
}, e.prototype.isValid = function() {
|
390
|
+
return this.useNativeValidation ? this.isNativeInputValid() : this.valid;
|
391
|
+
}, e.prototype.setValid = function(t) {
|
392
|
+
this.valid = t, this.styleValidity(t);
|
393
|
+
var i = !t && !this.isFocused && !!this.getValue();
|
394
|
+
this.adapter.hasLabel() && this.adapter.shakeLabel(i);
|
395
|
+
}, e.prototype.setValidateOnValueChange = function(t) {
|
396
|
+
this.validateOnValueChange = t;
|
397
|
+
}, e.prototype.getValidateOnValueChange = function() {
|
398
|
+
return this.validateOnValueChange;
|
399
|
+
}, e.prototype.setUseNativeValidation = function(t) {
|
400
|
+
this.useNativeValidation = t;
|
401
|
+
}, e.prototype.isDisabled = function() {
|
402
|
+
return this.getNativeInput().disabled;
|
403
|
+
}, e.prototype.setDisabled = function(t) {
|
404
|
+
this.getNativeInput().disabled = t, this.styleDisabled(t);
|
405
|
+
}, e.prototype.setHelperTextContent = function(t) {
|
406
|
+
this.helperText && this.helperText.setContent(t);
|
407
|
+
}, e.prototype.setLeadingIconAriaLabel = function(t) {
|
408
|
+
this.leadingIcon && this.leadingIcon.setAriaLabel(t);
|
409
|
+
}, e.prototype.setLeadingIconContent = function(t) {
|
410
|
+
this.leadingIcon && this.leadingIcon.setContent(t);
|
411
|
+
}, e.prototype.setTrailingIconAriaLabel = function(t) {
|
412
|
+
this.trailingIcon && this.trailingIcon.setAriaLabel(t);
|
413
|
+
}, e.prototype.setTrailingIconContent = function(t) {
|
414
|
+
this.trailingIcon && this.trailingIcon.setContent(t);
|
415
|
+
}, e.prototype.setcharacterCounter = function(t) {
|
416
|
+
if (this.characterCounter) {
|
417
|
+
var i = this.getNativeInput().maxLength;
|
418
|
+
if (i === -1)
|
419
|
+
throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");
|
420
|
+
this.characterCounter.setCounterValue(t, i);
|
421
|
+
}
|
422
|
+
}, e.prototype.isBadInput = function() {
|
423
|
+
return this.getNativeInput().validity.badInput || !1;
|
424
|
+
}, e.prototype.isNativeInputValid = function() {
|
425
|
+
return this.getNativeInput().validity.valid;
|
426
|
+
}, e.prototype.styleValidity = function(t) {
|
427
|
+
var i = e.cssClasses.INVALID;
|
428
|
+
if (t ? this.adapter.removeClass(i) : this.adapter.addClass(i), this.helperText) {
|
429
|
+
this.helperText.setValidity(t);
|
430
|
+
var n = this.helperText.isValidation();
|
431
|
+
if (!n)
|
432
|
+
return;
|
433
|
+
var o = this.helperText.isVisible(), d = this.helperText.getId();
|
434
|
+
o && d ? this.adapter.setInputAttr(F.ARIA_DESCRIBEDBY, d) : this.adapter.removeInputAttr(F.ARIA_DESCRIBEDBY);
|
435
|
+
}
|
436
|
+
}, e.prototype.styleFocused = function(t) {
|
437
|
+
var i = e.cssClasses.FOCUSED;
|
438
|
+
t ? this.adapter.addClass(i) : this.adapter.removeClass(i);
|
439
|
+
}, e.prototype.styleDisabled = function(t) {
|
440
|
+
var i = e.cssClasses, n = i.DISABLED, o = i.INVALID;
|
441
|
+
t ? (this.adapter.addClass(n), this.adapter.removeClass(o)) : this.adapter.removeClass(n), this.leadingIcon && this.leadingIcon.setDisabled(t), this.trailingIcon && this.trailingIcon.setDisabled(t);
|
442
|
+
}, e.prototype.styleFloating = function(t) {
|
443
|
+
var i = e.cssClasses.LABEL_FLOATING;
|
444
|
+
t ? this.adapter.addClass(i) : this.adapter.removeClass(i);
|
445
|
+
}, e.prototype.getNativeInput = function() {
|
446
|
+
var t = this.adapter ? this.adapter.getNativeInput() : null;
|
447
|
+
return t || {
|
448
|
+
disabled: !1,
|
449
|
+
maxLength: -1,
|
450
|
+
required: !1,
|
451
|
+
type: "input",
|
452
|
+
validity: {
|
453
|
+
badInput: !1,
|
454
|
+
valid: !0
|
455
|
+
},
|
456
|
+
value: ""
|
457
|
+
};
|
458
|
+
}, e;
|
459
|
+
}(j)
|
460
|
+
);
|
461
|
+
const G = X;
|
462
|
+
/**
|
463
|
+
* @license
|
464
|
+
* Copyright 2020 Google LLC
|
465
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
466
|
+
*/
|
467
|
+
const Y = T(class extends M {
|
468
|
+
constructor(s) {
|
469
|
+
if (super(s), s.type !== v.PROPERTY && s.type !== v.ATTRIBUTE && s.type !== v.BOOLEAN_ATTRIBUTE)
|
470
|
+
throw Error("The `live` directive is not allowed on child or event bindings");
|
471
|
+
if (!k(s))
|
472
|
+
throw Error("`live` bindings can only contain a single expression");
|
473
|
+
}
|
474
|
+
render(s) {
|
475
|
+
return s;
|
476
|
+
}
|
477
|
+
update(s, [e]) {
|
478
|
+
if (e === x || e === U)
|
479
|
+
return e;
|
480
|
+
const t = s.element, i = s.name;
|
481
|
+
if (s.type === v.PROPERTY) {
|
482
|
+
if (e === t[i])
|
483
|
+
return x;
|
484
|
+
} else if (s.type === v.BOOLEAN_ATTRIBUTE) {
|
485
|
+
if (!!e === t.hasAttribute(i))
|
486
|
+
return x;
|
487
|
+
} else if (s.type === v.ATTRIBUTE && t.getAttribute(i) === e + "")
|
488
|
+
return x;
|
489
|
+
return S(s), e;
|
490
|
+
}
|
491
|
+
});
|
492
|
+
/**
|
493
|
+
* @license
|
494
|
+
* Copyright 2019 Google LLC
|
495
|
+
* SPDX-License-Identifier: Apache-2.0
|
496
|
+
*/
|
497
|
+
const W = ["touchstart", "touchmove", "scroll", "mousewheel"], R = (s = {}) => {
|
498
|
+
const e = {};
|
499
|
+
for (const t in s)
|
500
|
+
e[t] = s[t];
|
501
|
+
return Object.assign({ badInput: !1, customError: !1, patternMismatch: !1, rangeOverflow: !1, rangeUnderflow: !1, stepMismatch: !1, tooLong: !1, tooShort: !1, typeMismatch: !1, valid: !0, valueMissing: !1 }, e);
|
502
|
+
};
|
503
|
+
class r extends B {
|
504
|
+
constructor() {
|
505
|
+
super(...arguments), this.mdcFoundationClass = G, this.value = "", this.type = "text", this.placeholder = "", this.label = "", this.icon = "", this.iconTrailing = "", this.disabled = !1, this.required = !1, this.minLength = -1, this.maxLength = -1, this.outlined = !1, this.helper = "", this.validateOnInitialRender = !1, this.validationMessage = "", this.autoValidate = !1, this.pattern = "", this.min = "", this.max = "", this.step = null, this.size = null, this.helperPersistent = !1, this.charCounter = !1, this.endAligned = !1, this.prefix = "", this.suffix = "", this.name = "", this.readOnly = !1, this.autocapitalize = "", this.outlineOpen = !1, this.outlineWidth = 0, this.isUiValid = !0, this.focused = !1, this._validity = R(), this.validityTransform = null;
|
506
|
+
}
|
507
|
+
get validity() {
|
508
|
+
return this._checkValidity(this.value), this._validity;
|
509
|
+
}
|
510
|
+
get willValidate() {
|
511
|
+
return this.formElement.willValidate;
|
512
|
+
}
|
513
|
+
get selectionStart() {
|
514
|
+
return this.formElement.selectionStart;
|
515
|
+
}
|
516
|
+
get selectionEnd() {
|
517
|
+
return this.formElement.selectionEnd;
|
518
|
+
}
|
519
|
+
focus() {
|
520
|
+
const e = new CustomEvent("focus");
|
521
|
+
this.formElement.dispatchEvent(e), this.formElement.focus();
|
522
|
+
}
|
523
|
+
blur() {
|
524
|
+
const e = new CustomEvent("blur");
|
525
|
+
this.formElement.dispatchEvent(e), this.formElement.blur();
|
526
|
+
}
|
527
|
+
select() {
|
528
|
+
this.formElement.select();
|
529
|
+
}
|
530
|
+
setSelectionRange(e, t, i) {
|
531
|
+
this.formElement.setSelectionRange(e, t, i);
|
532
|
+
}
|
533
|
+
update(e) {
|
534
|
+
e.has("autoValidate") && this.mdcFoundation && this.mdcFoundation.setValidateOnValueChange(this.autoValidate), e.has("value") && typeof this.value != "string" && (this.value = `${this.value}`), super.update(e);
|
535
|
+
}
|
536
|
+
setFormData(e) {
|
537
|
+
this.name && e.append(this.name, this.value);
|
538
|
+
}
|
539
|
+
/** @soyTemplate */
|
540
|
+
render() {
|
541
|
+
const e = this.charCounter && this.maxLength !== -1, t = !!this.helper || !!this.validationMessage || e, i = {
|
542
|
+
"mdc-text-field--disabled": this.disabled,
|
543
|
+
"mdc-text-field--no-label": !this.label,
|
544
|
+
"mdc-text-field--filled": !this.outlined,
|
545
|
+
"mdc-text-field--outlined": this.outlined,
|
546
|
+
"mdc-text-field--with-leading-icon": this.icon,
|
547
|
+
"mdc-text-field--with-trailing-icon": this.iconTrailing,
|
548
|
+
"mdc-text-field--end-aligned": this.endAligned
|
549
|
+
};
|
550
|
+
return c`
|
551
|
+
<label class="mdc-text-field ${L(i)}">
|
552
|
+
${this.renderRipple()}
|
553
|
+
${this.outlined ? this.renderOutline() : this.renderLabel()}
|
554
|
+
${this.renderLeadingIcon()}
|
555
|
+
${this.renderPrefix()}
|
556
|
+
${this.renderInput(t)}
|
557
|
+
${this.renderSuffix()}
|
558
|
+
${this.renderTrailingIcon()}
|
559
|
+
${this.renderLineRipple()}
|
560
|
+
</label>
|
561
|
+
${this.renderHelperText(t, e)}
|
562
|
+
`;
|
563
|
+
}
|
564
|
+
updated(e) {
|
565
|
+
e.has("value") && e.get("value") !== void 0 && (this.mdcFoundation.setValue(this.value), this.autoValidate && this.reportValidity());
|
566
|
+
}
|
567
|
+
/** @soyTemplate */
|
568
|
+
renderRipple() {
|
569
|
+
return this.outlined ? "" : c`
|
570
|
+
<span class="mdc-text-field__ripple"></span>
|
571
|
+
`;
|
572
|
+
}
|
573
|
+
/** @soyTemplate */
|
574
|
+
renderOutline() {
|
575
|
+
return this.outlined ? c`
|
576
|
+
<mwc-notched-outline
|
577
|
+
.width=${this.outlineWidth}
|
578
|
+
.open=${this.outlineOpen}
|
579
|
+
class="mdc-notched-outline">
|
580
|
+
${this.renderLabel()}
|
581
|
+
</mwc-notched-outline>` : "";
|
582
|
+
}
|
583
|
+
/** @soyTemplate */
|
584
|
+
renderLabel() {
|
585
|
+
return this.label ? c`
|
586
|
+
<span
|
587
|
+
.floatingLabelFoundation=${$(this.label)}
|
588
|
+
id="label">${this.label}</span>
|
589
|
+
` : "";
|
590
|
+
}
|
591
|
+
/** @soyTemplate */
|
592
|
+
renderLeadingIcon() {
|
593
|
+
return this.icon ? this.renderIcon(this.icon) : "";
|
594
|
+
}
|
595
|
+
/** @soyTemplate */
|
596
|
+
renderTrailingIcon() {
|
597
|
+
return this.iconTrailing ? this.renderIcon(this.iconTrailing, !0) : "";
|
598
|
+
}
|
599
|
+
/** @soyTemplate */
|
600
|
+
renderIcon(e, t = !1) {
|
601
|
+
return c`<i class="material-icons mdc-text-field__icon ${L({
|
602
|
+
"mdc-text-field__icon--leading": !t,
|
603
|
+
"mdc-text-field__icon--trailing": t
|
604
|
+
})}">${e}</i>`;
|
605
|
+
}
|
606
|
+
/** @soyTemplate */
|
607
|
+
renderPrefix() {
|
608
|
+
return this.prefix ? this.renderAffix(this.prefix) : "";
|
609
|
+
}
|
610
|
+
/** @soyTemplate */
|
611
|
+
renderSuffix() {
|
612
|
+
return this.suffix ? this.renderAffix(this.suffix, !0) : "";
|
613
|
+
}
|
614
|
+
/** @soyTemplate */
|
615
|
+
renderAffix(e, t = !1) {
|
616
|
+
return c`<span class="mdc-text-field__affix ${L({
|
617
|
+
"mdc-text-field__affix--prefix": !t,
|
618
|
+
"mdc-text-field__affix--suffix": t
|
619
|
+
})}">
|
620
|
+
${e}</span>`;
|
621
|
+
}
|
622
|
+
/** @soyTemplate */
|
623
|
+
renderInput(e) {
|
624
|
+
const t = this.minLength === -1 ? void 0 : this.minLength, i = this.maxLength === -1 ? void 0 : this.maxLength, n = this.autocapitalize ? this.autocapitalize : void 0, o = this.validationMessage && !this.isUiValid, d = this.label ? "label" : void 0, h = e ? "helper-text" : void 0, f = this.focused || this.helperPersistent || o ? "helper-text" : void 0;
|
625
|
+
return c`
|
626
|
+
<input
|
627
|
+
aria-labelledby=${u(d)}
|
628
|
+
aria-controls="${u(h)}"
|
629
|
+
aria-describedby="${u(f)}"
|
630
|
+
class="mdc-text-field__input"
|
631
|
+
type="${this.type}"
|
632
|
+
.value="${Y(this.value)}"
|
633
|
+
?disabled="${this.disabled}"
|
634
|
+
placeholder="${this.placeholder}"
|
635
|
+
?required="${this.required}"
|
636
|
+
?readonly="${this.readOnly}"
|
637
|
+
minlength="${u(t)}"
|
638
|
+
maxlength="${u(i)}"
|
639
|
+
pattern="${u(this.pattern ? this.pattern : void 0)}"
|
640
|
+
min="${u(this.min === "" ? void 0 : this.min)}"
|
641
|
+
max="${u(this.max === "" ? void 0 : this.max)}"
|
642
|
+
step="${u(this.step === null ? void 0 : this.step)}"
|
643
|
+
size="${u(this.size === null ? void 0 : this.size)}"
|
644
|
+
name="${u(this.name === "" ? void 0 : this.name)}"
|
645
|
+
inputmode="${u(this.inputMode)}"
|
646
|
+
autocapitalize="${u(n)}"
|
647
|
+
@input="${this.handleInputChange}"
|
648
|
+
@focus="${this.onInputFocus}"
|
649
|
+
@blur="${this.onInputBlur}">`;
|
650
|
+
}
|
651
|
+
/** @soyTemplate */
|
652
|
+
renderLineRipple() {
|
653
|
+
return this.outlined ? "" : c`
|
654
|
+
<span .lineRippleFoundation=${w()}></span>
|
655
|
+
`;
|
656
|
+
}
|
657
|
+
/** @soyTemplate */
|
658
|
+
renderHelperText(e, t) {
|
659
|
+
const i = this.validationMessage && !this.isUiValid, n = {
|
660
|
+
"mdc-text-field-helper-text--persistent": this.helperPersistent,
|
661
|
+
"mdc-text-field-helper-text--validation-msg": i
|
662
|
+
}, o = this.focused || this.helperPersistent || i ? void 0 : "true", d = i ? this.validationMessage : this.helper;
|
663
|
+
return e ? c`
|
664
|
+
<div class="mdc-text-field-helper-line">
|
665
|
+
<div id="helper-text"
|
666
|
+
aria-hidden="${u(o)}"
|
667
|
+
class="mdc-text-field-helper-text ${L(n)}"
|
668
|
+
>${d}</div>
|
669
|
+
${this.renderCharCounter(t)}
|
670
|
+
</div>` : "";
|
671
|
+
}
|
672
|
+
/** @soyTemplate */
|
673
|
+
renderCharCounter(e) {
|
674
|
+
const t = Math.min(this.value.length, this.maxLength);
|
675
|
+
return e ? c`
|
676
|
+
<span class="mdc-text-field-character-counter"
|
677
|
+
>${t} / ${this.maxLength}</span>` : "";
|
678
|
+
}
|
679
|
+
onInputFocus() {
|
680
|
+
this.focused = !0;
|
681
|
+
}
|
682
|
+
onInputBlur() {
|
683
|
+
this.focused = !1, this.reportValidity();
|
684
|
+
}
|
685
|
+
checkValidity() {
|
686
|
+
const e = this._checkValidity(this.value);
|
687
|
+
if (!e) {
|
688
|
+
const t = new Event("invalid", { bubbles: !1, cancelable: !0 });
|
689
|
+
this.dispatchEvent(t);
|
690
|
+
}
|
691
|
+
return e;
|
692
|
+
}
|
693
|
+
reportValidity() {
|
694
|
+
const e = this.checkValidity();
|
695
|
+
return this.mdcFoundation.setValid(e), this.isUiValid = e, e;
|
696
|
+
}
|
697
|
+
_checkValidity(e) {
|
698
|
+
const t = this.formElement.validity;
|
699
|
+
let i = R(t);
|
700
|
+
if (this.validityTransform) {
|
701
|
+
const n = this.validityTransform(e, i);
|
702
|
+
i = Object.assign(Object.assign({}, i), n), this.mdcFoundation.setUseNativeValidation(!1);
|
703
|
+
} else
|
704
|
+
this.mdcFoundation.setUseNativeValidation(!0);
|
705
|
+
return this._validity = i, this._validity.valid;
|
706
|
+
}
|
707
|
+
setCustomValidity(e) {
|
708
|
+
this.validationMessage = e, this.formElement.setCustomValidity(e);
|
709
|
+
}
|
710
|
+
handleInputChange() {
|
711
|
+
this.value = this.formElement.value;
|
712
|
+
}
|
713
|
+
createAdapter() {
|
714
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getRootAdapterMethods()), this.getInputAdapterMethods()), this.getLabelAdapterMethods()), this.getLineRippleAdapterMethods()), this.getOutlineAdapterMethods());
|
715
|
+
}
|
716
|
+
getRootAdapterMethods() {
|
717
|
+
return Object.assign({ registerTextFieldInteractionHandler: (e, t) => this.addEventListener(e, t), deregisterTextFieldInteractionHandler: (e, t) => this.removeEventListener(e, t), registerValidationAttributeChangeHandler: (e) => {
|
718
|
+
const t = (o) => o.map((d) => d.attributeName).filter((d) => d), i = new MutationObserver((o) => {
|
719
|
+
e(t(o));
|
720
|
+
}), n = { attributes: !0 };
|
721
|
+
return i.observe(this.formElement, n), i;
|
722
|
+
}, deregisterValidationAttributeChangeHandler: (e) => e.disconnect() }, D(this.mdcRoot));
|
723
|
+
}
|
724
|
+
getInputAdapterMethods() {
|
725
|
+
return {
|
726
|
+
getNativeInput: () => this.formElement,
|
727
|
+
// since HelperTextFoundation is not used, aria-describedby a11y logic
|
728
|
+
// is implemented in render method instead of these adapter methods
|
729
|
+
setInputAttr: () => {
|
730
|
+
},
|
731
|
+
removeInputAttr: () => {
|
732
|
+
},
|
733
|
+
isFocused: () => this.shadowRoot ? this.shadowRoot.activeElement === this.formElement : !1,
|
734
|
+
registerInputInteractionHandler: (e, t) => this.formElement.addEventListener(e, t, { passive: e in W }),
|
735
|
+
deregisterInputInteractionHandler: (e, t) => this.formElement.removeEventListener(e, t)
|
736
|
+
};
|
737
|
+
}
|
738
|
+
getLabelAdapterMethods() {
|
739
|
+
return {
|
740
|
+
floatLabel: (e) => this.labelElement && this.labelElement.floatingLabelFoundation.float(e),
|
741
|
+
getLabelWidth: () => this.labelElement ? this.labelElement.floatingLabelFoundation.getWidth() : 0,
|
742
|
+
hasLabel: () => Boolean(this.labelElement),
|
743
|
+
shakeLabel: (e) => this.labelElement && this.labelElement.floatingLabelFoundation.shake(e),
|
744
|
+
setLabelRequired: (e) => {
|
745
|
+
this.labelElement && this.labelElement.floatingLabelFoundation.setRequired(e);
|
746
|
+
}
|
747
|
+
};
|
748
|
+
}
|
749
|
+
getLineRippleAdapterMethods() {
|
750
|
+
return {
|
751
|
+
activateLineRipple: () => {
|
752
|
+
this.lineRippleElement && this.lineRippleElement.lineRippleFoundation.activate();
|
753
|
+
},
|
754
|
+
deactivateLineRipple: () => {
|
755
|
+
this.lineRippleElement && this.lineRippleElement.lineRippleFoundation.deactivate();
|
756
|
+
},
|
757
|
+
setLineRippleTransformOrigin: (e) => {
|
758
|
+
this.lineRippleElement && this.lineRippleElement.lineRippleFoundation.setRippleCenter(e);
|
759
|
+
}
|
760
|
+
};
|
761
|
+
}
|
762
|
+
// tslint:disable:ban-ts-ignore
|
763
|
+
async getUpdateComplete() {
|
764
|
+
var e;
|
765
|
+
const t = await super.getUpdateComplete();
|
766
|
+
return await ((e = this.outlineElement) === null || e === void 0 ? void 0 : e.updateComplete), t;
|
767
|
+
}
|
768
|
+
// tslint:enable:ban-ts-ignore
|
769
|
+
firstUpdated() {
|
770
|
+
var e;
|
771
|
+
super.firstUpdated(), this.mdcFoundation.setValidateOnValueChange(this.autoValidate), this.validateOnInitialRender && this.reportValidity(), (e = this.outlineElement) === null || e === void 0 || e.updateComplete.then(() => {
|
772
|
+
var t;
|
773
|
+
this.outlineWidth = ((t = this.labelElement) === null || t === void 0 ? void 0 : t.floatingLabelFoundation.getWidth()) || 0;
|
774
|
+
});
|
775
|
+
}
|
776
|
+
getOutlineAdapterMethods() {
|
777
|
+
return {
|
778
|
+
closeOutline: () => this.outlineElement && (this.outlineOpen = !1),
|
779
|
+
hasOutline: () => Boolean(this.outlineElement),
|
780
|
+
notchOutline: (e) => {
|
781
|
+
this.outlineElement && !this.outlineOpen && (this.outlineWidth = e, this.outlineOpen = !0);
|
782
|
+
}
|
783
|
+
};
|
784
|
+
}
|
785
|
+
async layout() {
|
786
|
+
await this.updateComplete;
|
787
|
+
const e = this.labelElement;
|
788
|
+
if (!e) {
|
789
|
+
this.outlineOpen = !1;
|
790
|
+
return;
|
791
|
+
}
|
792
|
+
const t = !!this.label && !!this.value;
|
793
|
+
if (e.floatingLabelFoundation.float(t), !this.outlined)
|
794
|
+
return;
|
795
|
+
this.outlineOpen = t, await this.updateComplete;
|
796
|
+
const i = e.floatingLabelFoundation.getWidth();
|
797
|
+
this.outlineOpen && (this.outlineWidth = i, await this.updateComplete);
|
798
|
+
}
|
799
|
+
}
|
800
|
+
a([
|
801
|
+
y(".mdc-text-field")
|
802
|
+
], r.prototype, "mdcRoot", void 0);
|
803
|
+
a([
|
804
|
+
y("input")
|
805
|
+
], r.prototype, "formElement", void 0);
|
806
|
+
a([
|
807
|
+
y(".mdc-floating-label")
|
808
|
+
], r.prototype, "labelElement", void 0);
|
809
|
+
a([
|
810
|
+
y(".mdc-line-ripple")
|
811
|
+
], r.prototype, "lineRippleElement", void 0);
|
812
|
+
a([
|
813
|
+
y("mwc-notched-outline")
|
814
|
+
], r.prototype, "outlineElement", void 0);
|
815
|
+
a([
|
816
|
+
y(".mdc-notched-outline__notch")
|
817
|
+
], r.prototype, "notchElement", void 0);
|
818
|
+
a([
|
819
|
+
l({ type: String })
|
820
|
+
], r.prototype, "value", void 0);
|
821
|
+
a([
|
822
|
+
l({ type: String })
|
823
|
+
], r.prototype, "type", void 0);
|
824
|
+
a([
|
825
|
+
l({ type: String })
|
826
|
+
], r.prototype, "placeholder", void 0);
|
827
|
+
a([
|
828
|
+
l({ type: String }),
|
829
|
+
E(function(s, e) {
|
830
|
+
e !== void 0 && this.label !== e && this.layout();
|
831
|
+
})
|
832
|
+
], r.prototype, "label", void 0);
|
833
|
+
a([
|
834
|
+
l({ type: String })
|
835
|
+
], r.prototype, "icon", void 0);
|
836
|
+
a([
|
837
|
+
l({ type: String })
|
838
|
+
], r.prototype, "iconTrailing", void 0);
|
839
|
+
a([
|
840
|
+
l({ type: Boolean, reflect: !0 })
|
841
|
+
], r.prototype, "disabled", void 0);
|
842
|
+
a([
|
843
|
+
l({ type: Boolean })
|
844
|
+
], r.prototype, "required", void 0);
|
845
|
+
a([
|
846
|
+
l({ type: Number })
|
847
|
+
], r.prototype, "minLength", void 0);
|
848
|
+
a([
|
849
|
+
l({ type: Number })
|
850
|
+
], r.prototype, "maxLength", void 0);
|
851
|
+
a([
|
852
|
+
l({ type: Boolean, reflect: !0 }),
|
853
|
+
E(function(s, e) {
|
854
|
+
e !== void 0 && this.outlined !== e && this.layout();
|
855
|
+
})
|
856
|
+
], r.prototype, "outlined", void 0);
|
857
|
+
a([
|
858
|
+
l({ type: String })
|
859
|
+
], r.prototype, "helper", void 0);
|
860
|
+
a([
|
861
|
+
l({ type: Boolean })
|
862
|
+
], r.prototype, "validateOnInitialRender", void 0);
|
863
|
+
a([
|
864
|
+
l({ type: String })
|
865
|
+
], r.prototype, "validationMessage", void 0);
|
866
|
+
a([
|
867
|
+
l({ type: Boolean })
|
868
|
+
], r.prototype, "autoValidate", void 0);
|
869
|
+
a([
|
870
|
+
l({ type: String })
|
871
|
+
], r.prototype, "pattern", void 0);
|
872
|
+
a([
|
873
|
+
l({ type: String })
|
874
|
+
], r.prototype, "min", void 0);
|
875
|
+
a([
|
876
|
+
l({ type: String })
|
877
|
+
], r.prototype, "max", void 0);
|
878
|
+
a([
|
879
|
+
l({ type: String })
|
880
|
+
], r.prototype, "step", void 0);
|
881
|
+
a([
|
882
|
+
l({ type: Number })
|
883
|
+
], r.prototype, "size", void 0);
|
884
|
+
a([
|
885
|
+
l({ type: Boolean })
|
886
|
+
], r.prototype, "helperPersistent", void 0);
|
887
|
+
a([
|
888
|
+
l({ type: Boolean })
|
889
|
+
], r.prototype, "charCounter", void 0);
|
890
|
+
a([
|
891
|
+
l({ type: Boolean })
|
892
|
+
], r.prototype, "endAligned", void 0);
|
893
|
+
a([
|
894
|
+
l({ type: String })
|
895
|
+
], r.prototype, "prefix", void 0);
|
896
|
+
a([
|
897
|
+
l({ type: String })
|
898
|
+
], r.prototype, "suffix", void 0);
|
899
|
+
a([
|
900
|
+
l({ type: String })
|
901
|
+
], r.prototype, "name", void 0);
|
902
|
+
a([
|
903
|
+
l({ type: String })
|
904
|
+
], r.prototype, "inputMode", void 0);
|
905
|
+
a([
|
906
|
+
l({ type: Boolean })
|
907
|
+
], r.prototype, "readOnly", void 0);
|
908
|
+
a([
|
909
|
+
l({ type: String })
|
910
|
+
], r.prototype, "autocapitalize", void 0);
|
911
|
+
a([
|
912
|
+
I()
|
913
|
+
], r.prototype, "outlineOpen", void 0);
|
914
|
+
a([
|
915
|
+
I()
|
916
|
+
], r.prototype, "outlineWidth", void 0);
|
917
|
+
a([
|
918
|
+
I()
|
919
|
+
], r.prototype, "isUiValid", void 0);
|
920
|
+
a([
|
921
|
+
I()
|
922
|
+
], r.prototype, "focused", void 0);
|
923
|
+
a([
|
924
|
+
_({ passive: !0 })
|
925
|
+
], r.prototype, "handleInputChange", null);
|
926
|
+
const oe = `:host{--mdc-text-field-label-ink-color: var(--mdc-theme-text-secondary-on-background);--mdc-text-field-ink-color: var(--mdc-theme-text-secondary-on-background);--mdc-text-field-fill-color: var(--mdc-theme-surface-canvas);--mdc-text-field-idle-line-color: var(--mdc-theme-border);--mdc-text-field-hover-line-color: var(--mdc-theme-text-icon-on-background);--mdc-text-field-outlined-idle-border-color: var(--mdc-theme-border);--mdc-text-field-outlined-hover-border-color: var(--mdc-theme-text-icon-on-background)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--mdc-theme-text-icon-on-background)}
|
2
927
|
`;
|
3
928
|
export {
|
4
|
-
|
929
|
+
r as T,
|
930
|
+
Y as l,
|
931
|
+
oe as s
|
5
932
|
};
|