@sme.up/ketchup 5.2.0-SNAPSHOT → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/cjs/{cell-utils-5b16c180.js → cell-utils-a78d6fac.js} +2 -2
  2. package/dist/cjs/{component-d1496215.js → component-72a5b626.js} +30 -0
  3. package/dist/cjs/{f-button-3b9f32af.js → f-button-ac179257.js} +2 -2
  4. package/dist/cjs/{f-cell-c6ad973a.js → f-cell-69294bca.js} +33 -121
  5. package/dist/cjs/{f-chip-bed86c4a.js → f-chip-b00897d7.js} +5 -4
  6. package/dist/cjs/{f-image-08a3d340.js → f-image-89f25556.js} +2 -2
  7. package/dist/cjs/f-paginator-utils-8fa501b3.js +1898 -0
  8. package/dist/cjs/f-text-field-e1e45ade.js +94 -0
  9. package/dist/cjs/f-text-field-mdc-85997738.js +2570 -0
  10. package/dist/cjs/{index-8d7bb3be.js → index-eb556444.js} +2 -0
  11. package/dist/cjs/ketchup.cjs.js +3 -3
  12. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  13. package/dist/cjs/{kup-autocomplete_27.cjs.entry.js → kup-autocomplete_25.cjs.entry.js} +1788 -8378
  14. package/dist/cjs/{kup-echart.cjs.entry.js → kup-box_2.cjs.entry.js} +17102 -14788
  15. package/dist/cjs/kup-calendar.cjs.entry.js +42 -34
  16. package/dist/cjs/kup-cell.cjs.entry.js +8 -7
  17. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  18. package/dist/cjs/kup-dash_2.cjs.entry.js +3 -3
  19. package/dist/cjs/kup-drawer.cjs.entry.js +12 -5
  20. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-form-editor.cjs.entry.js +404 -0
  22. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  23. package/dist/cjs/kup-image-list.cjs.entry.js +228 -0
  24. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +4 -4
  26. package/dist/cjs/kup-manager-7a941909.js +16703 -0
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +5 -5
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
  33. package/dist/cjs/loader.cjs.js +3 -3
  34. package/dist/cjs/{utils-b9df398c.js → utils-6287d878.js} +1 -1
  35. package/dist/collection/assets/card.js +4 -5
  36. package/dist/collection/assets/data-table.js +44 -79
  37. package/dist/collection/assets/form-editor.js +338 -0
  38. package/dist/collection/assets/image-list.js +624 -0
  39. package/dist/collection/assets/index.js +16 -0
  40. package/dist/collection/assets/kupdata.js +0 -3
  41. package/dist/collection/assets/kuptooltip.js +654 -0
  42. package/dist/collection/assets/tree.js +0 -128
  43. package/dist/collection/collection-manifest.json +8 -6
  44. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +1 -1
  45. package/dist/collection/components/kup-box/kup-box-declarations.js +0 -4
  46. package/dist/collection/components/kup-box/kup-box.js +7 -135
  47. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
  48. package/dist/collection/components/kup-card/built-in/kup-card-clock.js +1 -1
  49. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +1 -2
  50. package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
  51. package/dist/collection/components/kup-card/kup-card.css +61 -8
  52. package/dist/collection/components/kup-card/kup-card.js +2 -2
  53. package/dist/collection/components/kup-card/standard/kup-card-standard.js +14 -6
  54. package/dist/collection/components/kup-combobox/kup-combobox.js +1 -1
  55. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -3
  56. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  57. package/dist/collection/components/kup-data-table/kup-data-table.js +50 -138
  58. package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
  59. package/dist/collection/components/kup-drawer/kup-drawer.css +1 -0
  60. package/dist/collection/components/kup-drawer/kup-drawer.js +8 -1
  61. package/dist/collection/components/kup-form-editor/kup-form-editor-declarations.js +23 -0
  62. package/dist/collection/components/kup-form-editor/kup-form-editor.css +80 -0
  63. package/dist/collection/components/kup-form-editor/kup-form-editor.js +561 -0
  64. package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -0
  65. package/dist/collection/components/kup-image-list/kup-image-list.css +166 -0
  66. package/dist/collection/components/kup-image-list/kup-image-list.js +432 -0
  67. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
  68. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
  69. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
  70. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +3 -13
  71. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +1 -1
  72. package/dist/collection/components/kup-snackbar/kup-snackbar.css +4 -0
  73. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +18 -19
  74. package/dist/collection/components/kup-time-picker/kup-time-picker.js +2 -2
  75. package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -4
  76. package/dist/collection/components/kup-tree/kup-tree.css +10 -3
  77. package/dist/collection/components/kup-tree/kup-tree.js +81 -145
  78. package/dist/collection/f-components/f-cell/f-cell.js +7 -7
  79. package/dist/collection/f-components/f-chip/f-chip.js +2 -1
  80. package/dist/collection/managers/kup-data/kup-data-node-helper.js +24 -0
  81. package/dist/collection/managers/kup-data/kup-data.js +4 -1
  82. package/dist/collection/managers/kup-debug/kup-debug.js +1 -0
  83. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +4 -2
  84. package/dist/collection/managers/kup-interact/kup-interact.js +1 -22
  85. package/dist/collection/managers/kup-language/kup-language-declarations.js +2 -0
  86. package/dist/collection/managers/kup-manager/kup-manager.js +31 -1
  87. package/dist/collection/managers/kup-math/kup-math.js +11 -1
  88. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +6 -0
  89. package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
  90. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +224 -0
  91. package/dist/collection/types/GenericTypes.js +3 -0
  92. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +8 -12
  93. package/dist/esm/{cell-utils-69f75e2e.js → cell-utils-964da6b5.js} +3 -3
  94. package/dist/esm/{component-c4eb6153.js → component-b1bedf1d.js} +27 -2
  95. package/dist/esm/{f-button-7e7607d8.js → f-button-871a544b.js} +2 -2
  96. package/dist/esm/{f-cell-e4d83c27.js → f-cell-521ef17a.js} +33 -120
  97. package/dist/esm/{f-chip-51dfefaf.js → f-chip-1dda722f.js} +6 -5
  98. package/dist/esm/{f-image-de331954.js → f-image-c468d8ae.js} +2 -2
  99. package/dist/esm/f-paginator-utils-7dff8ff0.js +1884 -0
  100. package/dist/esm/f-text-field-d6c61c73.js +92 -0
  101. package/dist/esm/f-text-field-mdc-d42d3f9e.js +2568 -0
  102. package/dist/esm/{index-aeec9835.js → index-baeab1ac.js} +2 -1
  103. package/dist/esm/ketchup.js +3 -3
  104. package/dist/esm/kup-accordion.entry.js +6 -6
  105. package/dist/esm/{kup-autocomplete_27.entry.js → kup-autocomplete_25.entry.js} +1724 -8312
  106. package/dist/esm/{kup-echart.entry.js → kup-box_2.entry.js} +17102 -14789
  107. package/dist/esm/kup-calendar.entry.js +43 -35
  108. package/dist/esm/kup-cell.entry.js +8 -7
  109. package/dist/esm/kup-dash-list.entry.js +4 -4
  110. package/dist/esm/kup-dash_2.entry.js +3 -3
  111. package/dist/esm/kup-drawer.entry.js +12 -5
  112. package/dist/esm/kup-field.entry.js +2 -2
  113. package/dist/esm/kup-form-editor.entry.js +400 -0
  114. package/dist/esm/kup-iframe.entry.js +3 -3
  115. package/dist/esm/kup-image-list.entry.js +224 -0
  116. package/dist/esm/kup-lazy.entry.js +3 -3
  117. package/dist/esm/kup-magic-box.entry.js +4 -4
  118. package/dist/esm/kup-manager-58b075b4.js +16686 -0
  119. package/dist/esm/kup-nav-bar.entry.js +3 -3
  120. package/dist/esm/kup-numeric-picker.entry.js +419 -0
  121. package/dist/esm/kup-photo-frame.entry.js +5 -5
  122. package/dist/esm/kup-probe.entry.js +2 -2
  123. package/dist/esm/kup-qlik.entry.js +2 -2
  124. package/dist/esm/kup-snackbar.entry.js +6 -6
  125. package/dist/esm/loader.js +3 -3
  126. package/dist/esm/polyfills/css-shim.js +1 -1
  127. package/dist/esm/{tslib.es6-8f2d44b6.js → tslib.es6-3eea2234.js} +1 -1
  128. package/dist/esm/{utils-35c7a90d.js → utils-d7e4b3c2.js} +2 -2
  129. package/dist/ketchup/ketchup.esm.js +1 -1
  130. package/dist/ketchup/{p-5d190cf5.js → p-1ae66cc5.js} +1 -1
  131. package/dist/ketchup/{p-8be1337b.js → p-34b74425.js} +1 -1
  132. package/dist/ketchup/{p-fea316ab.entry.js → p-3c11e615.entry.js} +1 -1
  133. package/dist/ketchup/p-44ec4f03.js +1 -0
  134. package/dist/ketchup/p-4ffbc3ff.js +1 -0
  135. package/dist/ketchup/p-5264a3e6.entry.js +1 -0
  136. package/dist/ketchup/{p-d7af8156.entry.js → p-65974e48.entry.js} +1 -1
  137. package/dist/ketchup/p-65b46587.entry.js +40 -0
  138. package/dist/ketchup/{p-3813281b.entry.js → p-6dff70f8.entry.js} +1 -1
  139. package/dist/ketchup/{p-33073f4a.js → p-7454cb92.js} +1 -1
  140. package/dist/ketchup/{p-a0b1d769.js → p-79b0730b.js} +1 -1
  141. package/dist/ketchup/p-7eff4eee.js +1 -0
  142. package/dist/ketchup/p-80968627.entry.js +1 -0
  143. package/dist/ketchup/{p-8c44c3b9.js → p-81605f08.js} +4 -5
  144. package/dist/ketchup/p-8cdf61a4.js +1 -0
  145. package/dist/ketchup/{p-f9c41e20.entry.js → p-954cc340.entry.js} +1 -1
  146. package/dist/ketchup/p-99e0d768.entry.js +1 -0
  147. package/dist/ketchup/{p-8f735633.entry.js → p-a0f6e25c.entry.js} +1 -1
  148. package/dist/ketchup/p-a203f78b.js +45 -0
  149. package/dist/ketchup/{p-9bcda66f.entry.js → p-a615a92b.entry.js} +1 -1
  150. package/dist/ketchup/p-aca0e54b.js +30 -0
  151. package/dist/ketchup/p-b8939a8b.entry.js +1 -0
  152. package/dist/ketchup/p-bfc3bac7.js +1 -0
  153. package/dist/ketchup/{p-67c64257.entry.js → p-c5ce8951.entry.js} +1 -1
  154. package/dist/ketchup/p-cad1e097.entry.js +9 -0
  155. package/dist/ketchup/{p-68fc1428.entry.js → p-d2ee56dd.entry.js} +1 -1
  156. package/dist/ketchup/p-db71436b.entry.js +27 -0
  157. package/dist/ketchup/{p-10c8d755.js → p-e0035c58.js} +1 -1
  158. package/dist/ketchup/p-e1039cf2.entry.js +1 -0
  159. package/dist/ketchup/{p-b5e1dbfa.entry.js → p-ea10176c.entry.js} +1 -1
  160. package/dist/ketchup/p-f09f2f98.entry.js +1 -0
  161. package/dist/ketchup/{p-0751aaf6.entry.js → p-f71a1675.entry.js} +1 -1
  162. package/dist/ketchup/{p-4081f5f7.entry.js → p-fac1a08b.entry.js} +1 -1
  163. package/dist/types/components/kup-box/kup-box-declarations.d.ts +3 -5
  164. package/dist/types/components/kup-box/kup-box.d.ts +0 -22
  165. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
  166. package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
  167. package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
  168. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +4 -4
  169. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  170. package/dist/types/components/kup-data-table/kup-data-table.d.ts +5 -19
  171. package/dist/types/components/kup-form-editor/kup-form-editor-declarations.d.ts +79 -0
  172. package/dist/types/components/kup-form-editor/kup-form-editor.d.ts +72 -0
  173. package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -0
  174. package/dist/types/components/kup-image-list/kup-image-list.d.ts +56 -0
  175. package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
  176. package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
  177. package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +3 -9
  178. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +6 -6
  179. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +1 -5
  180. package/dist/types/components/kup-tree/kup-tree.d.ts +1 -25
  181. package/dist/types/components.d.ts +265 -232
  182. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
  183. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +7 -0
  184. package/dist/types/managers/kup-data/kup-data.d.ts +1 -0
  185. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +2 -0
  186. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +14 -0
  187. package/dist/types/managers/kup-manager/kup-manager.d.ts +14 -0
  188. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +6 -0
  189. package/dist/types/managers/kup-math/kup-math.d.ts +2 -1
  190. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
  191. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +51 -0
  192. package/dist/types/types/GenericTypes.d.ts +3 -0
  193. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +1 -3
  194. package/package.json +16 -15
  195. package/dist/cjs/kup-manager-4227f0a2.js +0 -8582
  196. package/dist/collection/assets/tooltip.js +0 -73
  197. package/dist/collection/components/kup-tooltip/kup-tooltip-declarations.js +0 -20
  198. package/dist/collection/components/kup-tooltip/kup-tooltip.css +0 -149
  199. package/dist/collection/components/kup-tooltip/kup-tooltip.js +0 -1205
  200. package/dist/collection/utils/helpers.js +0 -38
  201. package/dist/esm/kup-manager-0ab94726.js +0 -8565
  202. package/dist/ketchup/p-24df4f29.entry.js +0 -27
  203. package/dist/ketchup/p-2d4f19f4.js +0 -1
  204. package/dist/ketchup/p-3445be1e.entry.js +0 -1
  205. package/dist/ketchup/p-3aab1f0d.entry.js +0 -1
  206. package/dist/ketchup/p-47b57d97.js +0 -1
  207. package/dist/ketchup/p-5186885c.entry.js +0 -1
  208. package/dist/ketchup/p-78223dc0.entry.js +0 -143
  209. package/dist/ketchup/p-96101f09.entry.js +0 -39
  210. package/dist/ketchup/p-c314b1e6.js +0 -1
  211. package/dist/ketchup/p-ee33cbe9.js +0 -9
  212. package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +0 -93
  213. package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +0 -142
  214. package/dist/types/utils/helpers.d.ts +0 -4
@@ -0,0 +1,2568 @@
1
+ import { _ as __extends, a as __assign, b as __values } from './tslib.es6-3eea2234.js';
2
+ import { a as MDCFoundation, b as MDCComponent, e as estimateScrollWidth, c as applyPassive, M as MDCRipple, m as matches, d as MDCRippleFoundation } from './component-b1bedf1d.js';
3
+
4
+ /**
5
+ * @license
6
+ * Copyright 2016 Google Inc.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
+ */
26
+ var cssClasses$7 = {
27
+ LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
28
+ LABEL_REQUIRED: 'mdc-floating-label--required',
29
+ LABEL_SHAKE: 'mdc-floating-label--shake',
30
+ ROOT: 'mdc-floating-label',
31
+ };
32
+
33
+ /**
34
+ * @license
35
+ * Copyright 2016 Google Inc.
36
+ *
37
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
38
+ * of this software and associated documentation files (the "Software"), to deal
39
+ * in the Software without restriction, including without limitation the rights
40
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
+ * copies of the Software, and to permit persons to whom the Software is
42
+ * furnished to do so, subject to the following conditions:
43
+ *
44
+ * The above copyright notice and this permission notice shall be included in
45
+ * all copies or substantial portions of the Software.
46
+ *
47
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
53
+ * THE SOFTWARE.
54
+ */
55
+ var MDCFloatingLabelFoundation = /** @class */ (function (_super) {
56
+ __extends(MDCFloatingLabelFoundation, _super);
57
+ function MDCFloatingLabelFoundation(adapter) {
58
+ var _this = _super.call(this, __assign(__assign({}, MDCFloatingLabelFoundation.defaultAdapter), adapter)) || this;
59
+ _this.shakeAnimationEndHandler = function () {
60
+ _this.handleShakeAnimationEnd();
61
+ };
62
+ return _this;
63
+ }
64
+ Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", {
65
+ get: function () {
66
+ return cssClasses$7;
67
+ },
68
+ enumerable: false,
69
+ configurable: true
70
+ });
71
+ Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", {
72
+ /**
73
+ * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.
74
+ */
75
+ get: function () {
76
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
77
+ return {
78
+ addClass: function () { return undefined; },
79
+ removeClass: function () { return undefined; },
80
+ getWidth: function () { return 0; },
81
+ registerInteractionHandler: function () { return undefined; },
82
+ deregisterInteractionHandler: function () { return undefined; },
83
+ };
84
+ // tslint:enable:object-literal-sort-keys
85
+ },
86
+ enumerable: false,
87
+ configurable: true
88
+ });
89
+ MDCFloatingLabelFoundation.prototype.init = function () {
90
+ this.adapter.registerInteractionHandler('animationend', this.shakeAnimationEndHandler);
91
+ };
92
+ MDCFloatingLabelFoundation.prototype.destroy = function () {
93
+ this.adapter.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler);
94
+ };
95
+ /**
96
+ * Returns the width of the label element.
97
+ */
98
+ MDCFloatingLabelFoundation.prototype.getWidth = function () {
99
+ return this.adapter.getWidth();
100
+ };
101
+ /**
102
+ * Styles the label to produce a shake animation to indicate an error.
103
+ * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class.
104
+ */
105
+ MDCFloatingLabelFoundation.prototype.shake = function (shouldShake) {
106
+ var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
107
+ if (shouldShake) {
108
+ this.adapter.addClass(LABEL_SHAKE);
109
+ }
110
+ else {
111
+ this.adapter.removeClass(LABEL_SHAKE);
112
+ }
113
+ };
114
+ /**
115
+ * Styles the label to float or dock.
116
+ * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label.
117
+ */
118
+ MDCFloatingLabelFoundation.prototype.float = function (shouldFloat) {
119
+ var _a = MDCFloatingLabelFoundation.cssClasses, LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE, LABEL_SHAKE = _a.LABEL_SHAKE;
120
+ if (shouldFloat) {
121
+ this.adapter.addClass(LABEL_FLOAT_ABOVE);
122
+ }
123
+ else {
124
+ this.adapter.removeClass(LABEL_FLOAT_ABOVE);
125
+ this.adapter.removeClass(LABEL_SHAKE);
126
+ }
127
+ };
128
+ /**
129
+ * Styles the label as required.
130
+ * @param isRequired If true, adds an asterisk to the label, indicating that it is required.
131
+ */
132
+ MDCFloatingLabelFoundation.prototype.setRequired = function (isRequired) {
133
+ var LABEL_REQUIRED = MDCFloatingLabelFoundation.cssClasses.LABEL_REQUIRED;
134
+ if (isRequired) {
135
+ this.adapter.addClass(LABEL_REQUIRED);
136
+ }
137
+ else {
138
+ this.adapter.removeClass(LABEL_REQUIRED);
139
+ }
140
+ };
141
+ MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd = function () {
142
+ var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
143
+ this.adapter.removeClass(LABEL_SHAKE);
144
+ };
145
+ return MDCFloatingLabelFoundation;
146
+ }(MDCFoundation));
147
+
148
+ /**
149
+ * @license
150
+ * Copyright 2016 Google Inc.
151
+ *
152
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
153
+ * of this software and associated documentation files (the "Software"), to deal
154
+ * in the Software without restriction, including without limitation the rights
155
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
156
+ * copies of the Software, and to permit persons to whom the Software is
157
+ * furnished to do so, subject to the following conditions:
158
+ *
159
+ * The above copyright notice and this permission notice shall be included in
160
+ * all copies or substantial portions of the Software.
161
+ *
162
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
163
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
164
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
165
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
166
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
167
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
168
+ * THE SOFTWARE.
169
+ */
170
+ var MDCFloatingLabel = /** @class */ (function (_super) {
171
+ __extends(MDCFloatingLabel, _super);
172
+ function MDCFloatingLabel() {
173
+ return _super !== null && _super.apply(this, arguments) || this;
174
+ }
175
+ MDCFloatingLabel.attachTo = function (root) {
176
+ return new MDCFloatingLabel(root);
177
+ };
178
+ /**
179
+ * Styles the label to produce the label shake for errors.
180
+ * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class.
181
+ */
182
+ MDCFloatingLabel.prototype.shake = function (shouldShake) {
183
+ this.foundation.shake(shouldShake);
184
+ };
185
+ /**
186
+ * Styles the label to float/dock.
187
+ * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class.
188
+ */
189
+ MDCFloatingLabel.prototype.float = function (shouldFloat) {
190
+ this.foundation.float(shouldFloat);
191
+ };
192
+ /**
193
+ * Styles the label as required.
194
+ * @param isRequired If true, adds an asterisk to the label, indicating that it is required.
195
+ */
196
+ MDCFloatingLabel.prototype.setRequired = function (isRequired) {
197
+ this.foundation.setRequired(isRequired);
198
+ };
199
+ MDCFloatingLabel.prototype.getWidth = function () {
200
+ return this.foundation.getWidth();
201
+ };
202
+ MDCFloatingLabel.prototype.getDefaultFoundation = function () {
203
+ var _this = this;
204
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
205
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
206
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
207
+ var adapter = {
208
+ addClass: function (className) { return _this.root.classList.add(className); },
209
+ removeClass: function (className) { return _this.root.classList.remove(className); },
210
+ getWidth: function () { return estimateScrollWidth(_this.root); },
211
+ registerInteractionHandler: function (evtType, handler) {
212
+ return _this.listen(evtType, handler);
213
+ },
214
+ deregisterInteractionHandler: function (evtType, handler) {
215
+ return _this.unlisten(evtType, handler);
216
+ },
217
+ };
218
+ // tslint:enable:object-literal-sort-keys
219
+ return new MDCFloatingLabelFoundation(adapter);
220
+ };
221
+ return MDCFloatingLabel;
222
+ }(MDCComponent));
223
+
224
+ /**
225
+ * @license
226
+ * Copyright 2018 Google Inc.
227
+ *
228
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
229
+ * of this software and associated documentation files (the "Software"), to deal
230
+ * in the Software without restriction, including without limitation the rights
231
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
232
+ * copies of the Software, and to permit persons to whom the Software is
233
+ * furnished to do so, subject to the following conditions:
234
+ *
235
+ * The above copyright notice and this permission notice shall be included in
236
+ * all copies or substantial portions of the Software.
237
+ *
238
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
239
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
240
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
241
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
242
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
243
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
244
+ * THE SOFTWARE.
245
+ */
246
+ var cssClasses$6 = {
247
+ LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
248
+ LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating',
249
+ };
250
+
251
+ /**
252
+ * @license
253
+ * Copyright 2018 Google Inc.
254
+ *
255
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
256
+ * of this software and associated documentation files (the "Software"), to deal
257
+ * in the Software without restriction, including without limitation the rights
258
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
259
+ * copies of the Software, and to permit persons to whom the Software is
260
+ * furnished to do so, subject to the following conditions:
261
+ *
262
+ * The above copyright notice and this permission notice shall be included in
263
+ * all copies or substantial portions of the Software.
264
+ *
265
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
266
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
267
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
268
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
269
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
270
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
271
+ * THE SOFTWARE.
272
+ */
273
+ var MDCLineRippleFoundation = /** @class */ (function (_super) {
274
+ __extends(MDCLineRippleFoundation, _super);
275
+ function MDCLineRippleFoundation(adapter) {
276
+ var _this = _super.call(this, __assign(__assign({}, MDCLineRippleFoundation.defaultAdapter), adapter)) || this;
277
+ _this.transitionEndHandler = function (evt) {
278
+ _this.handleTransitionEnd(evt);
279
+ };
280
+ return _this;
281
+ }
282
+ Object.defineProperty(MDCLineRippleFoundation, "cssClasses", {
283
+ get: function () {
284
+ return cssClasses$6;
285
+ },
286
+ enumerable: false,
287
+ configurable: true
288
+ });
289
+ Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", {
290
+ /**
291
+ * See {@link MDCLineRippleAdapter} for typing information on parameters and return types.
292
+ */
293
+ get: function () {
294
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
295
+ return {
296
+ addClass: function () { return undefined; },
297
+ removeClass: function () { return undefined; },
298
+ hasClass: function () { return false; },
299
+ setStyle: function () { return undefined; },
300
+ registerEventHandler: function () { return undefined; },
301
+ deregisterEventHandler: function () { return undefined; },
302
+ };
303
+ // tslint:enable:object-literal-sort-keys
304
+ },
305
+ enumerable: false,
306
+ configurable: true
307
+ });
308
+ MDCLineRippleFoundation.prototype.init = function () {
309
+ this.adapter.registerEventHandler('transitionend', this.transitionEndHandler);
310
+ };
311
+ MDCLineRippleFoundation.prototype.destroy = function () {
312
+ this.adapter.deregisterEventHandler('transitionend', this.transitionEndHandler);
313
+ };
314
+ MDCLineRippleFoundation.prototype.activate = function () {
315
+ this.adapter.removeClass(cssClasses$6.LINE_RIPPLE_DEACTIVATING);
316
+ this.adapter.addClass(cssClasses$6.LINE_RIPPLE_ACTIVE);
317
+ };
318
+ MDCLineRippleFoundation.prototype.setRippleCenter = function (xCoordinate) {
319
+ this.adapter.setStyle('transform-origin', xCoordinate + "px center");
320
+ };
321
+ MDCLineRippleFoundation.prototype.deactivate = function () {
322
+ this.adapter.addClass(cssClasses$6.LINE_RIPPLE_DEACTIVATING);
323
+ };
324
+ MDCLineRippleFoundation.prototype.handleTransitionEnd = function (evt) {
325
+ // Wait for the line ripple to be either transparent or opaque
326
+ // before emitting the animation end event
327
+ var isDeactivating = this.adapter.hasClass(cssClasses$6.LINE_RIPPLE_DEACTIVATING);
328
+ if (evt.propertyName === 'opacity') {
329
+ if (isDeactivating) {
330
+ this.adapter.removeClass(cssClasses$6.LINE_RIPPLE_ACTIVE);
331
+ this.adapter.removeClass(cssClasses$6.LINE_RIPPLE_DEACTIVATING);
332
+ }
333
+ }
334
+ };
335
+ return MDCLineRippleFoundation;
336
+ }(MDCFoundation));
337
+
338
+ /**
339
+ * @license
340
+ * Copyright 2018 Google Inc.
341
+ *
342
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
343
+ * of this software and associated documentation files (the "Software"), to deal
344
+ * in the Software without restriction, including without limitation the rights
345
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
346
+ * copies of the Software, and to permit persons to whom the Software is
347
+ * furnished to do so, subject to the following conditions:
348
+ *
349
+ * The above copyright notice and this permission notice shall be included in
350
+ * all copies or substantial portions of the Software.
351
+ *
352
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
353
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
354
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
355
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
356
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
357
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
358
+ * THE SOFTWARE.
359
+ */
360
+ var MDCLineRipple = /** @class */ (function (_super) {
361
+ __extends(MDCLineRipple, _super);
362
+ function MDCLineRipple() {
363
+ return _super !== null && _super.apply(this, arguments) || this;
364
+ }
365
+ MDCLineRipple.attachTo = function (root) {
366
+ return new MDCLineRipple(root);
367
+ };
368
+ /**
369
+ * Activates the line ripple
370
+ */
371
+ MDCLineRipple.prototype.activate = function () {
372
+ this.foundation.activate();
373
+ };
374
+ /**
375
+ * Deactivates the line ripple
376
+ */
377
+ MDCLineRipple.prototype.deactivate = function () {
378
+ this.foundation.deactivate();
379
+ };
380
+ /**
381
+ * Sets the transform origin given a user's click location.
382
+ * The `rippleCenter` is the x-coordinate of the middle of the ripple.
383
+ */
384
+ MDCLineRipple.prototype.setRippleCenter = function (xCoordinate) {
385
+ this.foundation.setRippleCenter(xCoordinate);
386
+ };
387
+ MDCLineRipple.prototype.getDefaultFoundation = function () {
388
+ var _this = this;
389
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
390
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
391
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
392
+ var adapter = {
393
+ addClass: function (className) { return _this.root.classList.add(className); },
394
+ removeClass: function (className) { return _this.root.classList.remove(className); },
395
+ hasClass: function (className) { return _this.root.classList.contains(className); },
396
+ setStyle: function (propertyName, value) { return _this.root.style.setProperty(propertyName, value); },
397
+ registerEventHandler: function (evtType, handler) { return _this.listen(evtType, handler); },
398
+ deregisterEventHandler: function (evtType, handler) { return _this.unlisten(evtType, handler); },
399
+ };
400
+ // tslint:enable:object-literal-sort-keys
401
+ return new MDCLineRippleFoundation(adapter);
402
+ };
403
+ return MDCLineRipple;
404
+ }(MDCComponent));
405
+
406
+ /**
407
+ * @license
408
+ * Copyright 2018 Google Inc.
409
+ *
410
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
411
+ * of this software and associated documentation files (the "Software"), to deal
412
+ * in the Software without restriction, including without limitation the rights
413
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
414
+ * copies of the Software, and to permit persons to whom the Software is
415
+ * furnished to do so, subject to the following conditions:
416
+ *
417
+ * The above copyright notice and this permission notice shall be included in
418
+ * all copies or substantial portions of the Software.
419
+ *
420
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
421
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
422
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
423
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
424
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
425
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
426
+ * THE SOFTWARE.
427
+ */
428
+ var strings$5 = {
429
+ NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch',
430
+ };
431
+ var numbers$1 = {
432
+ // This should stay in sync with $mdc-notched-outline-padding * 2.
433
+ NOTCH_ELEMENT_PADDING: 8,
434
+ };
435
+ var cssClasses$5 = {
436
+ NO_LABEL: 'mdc-notched-outline--no-label',
437
+ OUTLINE_NOTCHED: 'mdc-notched-outline--notched',
438
+ OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',
439
+ };
440
+
441
+ /**
442
+ * @license
443
+ * Copyright 2017 Google Inc.
444
+ *
445
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
446
+ * of this software and associated documentation files (the "Software"), to deal
447
+ * in the Software without restriction, including without limitation the rights
448
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
449
+ * copies of the Software, and to permit persons to whom the Software is
450
+ * furnished to do so, subject to the following conditions:
451
+ *
452
+ * The above copyright notice and this permission notice shall be included in
453
+ * all copies or substantial portions of the Software.
454
+ *
455
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
456
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
457
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
458
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
459
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
460
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
461
+ * THE SOFTWARE.
462
+ */
463
+ var MDCNotchedOutlineFoundation = /** @class */ (function (_super) {
464
+ __extends(MDCNotchedOutlineFoundation, _super);
465
+ function MDCNotchedOutlineFoundation(adapter) {
466
+ return _super.call(this, __assign(__assign({}, MDCNotchedOutlineFoundation.defaultAdapter), adapter)) || this;
467
+ }
468
+ Object.defineProperty(MDCNotchedOutlineFoundation, "strings", {
469
+ get: function () {
470
+ return strings$5;
471
+ },
472
+ enumerable: false,
473
+ configurable: true
474
+ });
475
+ Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", {
476
+ get: function () {
477
+ return cssClasses$5;
478
+ },
479
+ enumerable: false,
480
+ configurable: true
481
+ });
482
+ Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", {
483
+ get: function () {
484
+ return numbers$1;
485
+ },
486
+ enumerable: false,
487
+ configurable: true
488
+ });
489
+ Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", {
490
+ /**
491
+ * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.
492
+ */
493
+ get: function () {
494
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
495
+ return {
496
+ addClass: function () { return undefined; },
497
+ removeClass: function () { return undefined; },
498
+ setNotchWidthProperty: function () { return undefined; },
499
+ removeNotchWidthProperty: function () { return undefined; },
500
+ };
501
+ // tslint:enable:object-literal-sort-keys
502
+ },
503
+ enumerable: false,
504
+ configurable: true
505
+ });
506
+ /**
507
+ * Adds the outline notched selector and updates the notch width calculated based off of notchWidth.
508
+ */
509
+ MDCNotchedOutlineFoundation.prototype.notch = function (notchWidth) {
510
+ var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
511
+ if (notchWidth > 0) {
512
+ notchWidth += numbers$1.NOTCH_ELEMENT_PADDING; // Add padding from left/right.
513
+ }
514
+ this.adapter.setNotchWidthProperty(notchWidth);
515
+ this.adapter.addClass(OUTLINE_NOTCHED);
516
+ };
517
+ /**
518
+ * Removes notched outline selector to close the notch in the outline.
519
+ */
520
+ MDCNotchedOutlineFoundation.prototype.closeNotch = function () {
521
+ var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
522
+ this.adapter.removeClass(OUTLINE_NOTCHED);
523
+ this.adapter.removeNotchWidthProperty();
524
+ };
525
+ return MDCNotchedOutlineFoundation;
526
+ }(MDCFoundation));
527
+
528
+ /**
529
+ * @license
530
+ * Copyright 2017 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 MDCNotchedOutline = /** @class */ (function (_super) {
551
+ __extends(MDCNotchedOutline, _super);
552
+ function MDCNotchedOutline() {
553
+ return _super !== null && _super.apply(this, arguments) || this;
554
+ }
555
+ MDCNotchedOutline.attachTo = function (root) {
556
+ return new MDCNotchedOutline(root);
557
+ };
558
+ MDCNotchedOutline.prototype.initialSyncWithDOM = function () {
559
+ this.notchElement =
560
+ this.root.querySelector(strings$5.NOTCH_ELEMENT_SELECTOR);
561
+ var label = this.root.querySelector('.' + MDCFloatingLabelFoundation.cssClasses.ROOT);
562
+ if (label) {
563
+ label.style.transitionDuration = '0s';
564
+ this.root.classList.add(cssClasses$5.OUTLINE_UPGRADED);
565
+ requestAnimationFrame(function () {
566
+ label.style.transitionDuration = '';
567
+ });
568
+ }
569
+ else {
570
+ this.root.classList.add(cssClasses$5.NO_LABEL);
571
+ }
572
+ };
573
+ /**
574
+ * Updates classes and styles to open the notch to the specified width.
575
+ * @param notchWidth The notch width in the outline.
576
+ */
577
+ MDCNotchedOutline.prototype.notch = function (notchWidth) {
578
+ this.foundation.notch(notchWidth);
579
+ };
580
+ /**
581
+ * Updates classes and styles to close the notch.
582
+ */
583
+ MDCNotchedOutline.prototype.closeNotch = function () {
584
+ this.foundation.closeNotch();
585
+ };
586
+ MDCNotchedOutline.prototype.getDefaultFoundation = function () {
587
+ var _this = this;
588
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
589
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
590
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
591
+ var adapter = {
592
+ addClass: function (className) { return _this.root.classList.add(className); },
593
+ removeClass: function (className) { return _this.root.classList.remove(className); },
594
+ setNotchWidthProperty: function (width) {
595
+ _this.notchElement.style.setProperty('width', width + 'px');
596
+ },
597
+ removeNotchWidthProperty: function () {
598
+ _this.notchElement.style.removeProperty('width');
599
+ },
600
+ };
601
+ // tslint:enable:object-literal-sort-keys
602
+ return new MDCNotchedOutlineFoundation(adapter);
603
+ };
604
+ return MDCNotchedOutline;
605
+ }(MDCComponent));
606
+
607
+ /**
608
+ * @license
609
+ * Copyright 2019 Google Inc.
610
+ *
611
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
612
+ * of this software and associated documentation files (the "Software"), to deal
613
+ * in the Software without restriction, including without limitation the rights
614
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
615
+ * copies of the Software, and to permit persons to whom the Software is
616
+ * furnished to do so, subject to the following conditions:
617
+ *
618
+ * The above copyright notice and this permission notice shall be included in
619
+ * all copies or substantial portions of the Software.
620
+ *
621
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
622
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
623
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
624
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
625
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
626
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
627
+ * THE SOFTWARE.
628
+ */
629
+ var cssClasses$4 = {
630
+ ROOT: 'mdc-text-field-character-counter',
631
+ };
632
+ var strings$4 = {
633
+ ROOT_SELECTOR: "." + cssClasses$4.ROOT,
634
+ };
635
+
636
+ /**
637
+ * @license
638
+ * Copyright 2019 Google Inc.
639
+ *
640
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
641
+ * of this software and associated documentation files (the "Software"), to deal
642
+ * in the Software without restriction, including without limitation the rights
643
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
644
+ * copies of the Software, and to permit persons to whom the Software is
645
+ * furnished to do so, subject to the following conditions:
646
+ *
647
+ * The above copyright notice and this permission notice shall be included in
648
+ * all copies or substantial portions of the Software.
649
+ *
650
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
651
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
652
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
653
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
654
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
655
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
656
+ * THE SOFTWARE.
657
+ */
658
+ var MDCTextFieldCharacterCounterFoundation = /** @class */ (function (_super) {
659
+ __extends(MDCTextFieldCharacterCounterFoundation, _super);
660
+ function MDCTextFieldCharacterCounterFoundation(adapter) {
661
+ return _super.call(this, __assign(__assign({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter), adapter)) || this;
662
+ }
663
+ Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", {
664
+ get: function () {
665
+ return cssClasses$4;
666
+ },
667
+ enumerable: false,
668
+ configurable: true
669
+ });
670
+ Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", {
671
+ get: function () {
672
+ return strings$4;
673
+ },
674
+ enumerable: false,
675
+ configurable: true
676
+ });
677
+ Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", {
678
+ /**
679
+ * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.
680
+ */
681
+ get: function () {
682
+ return {
683
+ setContent: function () { return undefined; },
684
+ };
685
+ },
686
+ enumerable: false,
687
+ configurable: true
688
+ });
689
+ MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function (currentLength, maxLength) {
690
+ currentLength = Math.min(currentLength, maxLength);
691
+ this.adapter.setContent(currentLength + " / " + maxLength);
692
+ };
693
+ return MDCTextFieldCharacterCounterFoundation;
694
+ }(MDCFoundation));
695
+
696
+ /**
697
+ * @license
698
+ * Copyright 2019 Google Inc.
699
+ *
700
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
701
+ * of this software and associated documentation files (the "Software"), to deal
702
+ * in the Software without restriction, including without limitation the rights
703
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
704
+ * copies of the Software, and to permit persons to whom the Software is
705
+ * furnished to do so, subject to the following conditions:
706
+ *
707
+ * The above copyright notice and this permission notice shall be included in
708
+ * all copies or substantial portions of the Software.
709
+ *
710
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
711
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
712
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
713
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
714
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
715
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
716
+ * THE SOFTWARE.
717
+ */
718
+ var MDCTextFieldCharacterCounter = /** @class */ (function (_super) {
719
+ __extends(MDCTextFieldCharacterCounter, _super);
720
+ function MDCTextFieldCharacterCounter() {
721
+ return _super !== null && _super.apply(this, arguments) || this;
722
+ }
723
+ MDCTextFieldCharacterCounter.attachTo = function (root) {
724
+ return new MDCTextFieldCharacterCounter(root);
725
+ };
726
+ Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundationForTextField", {
727
+ // Provided for access by MDCTextField component
728
+ get: function () {
729
+ return this.foundation;
730
+ },
731
+ enumerable: false,
732
+ configurable: true
733
+ });
734
+ MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function () {
735
+ var _this = this;
736
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
737
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
738
+ var adapter = {
739
+ setContent: function (content) {
740
+ _this.root.textContent = content;
741
+ },
742
+ };
743
+ return new MDCTextFieldCharacterCounterFoundation(adapter);
744
+ };
745
+ return MDCTextFieldCharacterCounter;
746
+ }(MDCComponent));
747
+
748
+ /**
749
+ * @license
750
+ * Copyright 2016 Google Inc.
751
+ *
752
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
753
+ * of this software and associated documentation files (the "Software"), to deal
754
+ * in the Software without restriction, including without limitation the rights
755
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
756
+ * copies of the Software, and to permit persons to whom the Software is
757
+ * furnished to do so, subject to the following conditions:
758
+ *
759
+ * The above copyright notice and this permission notice shall be included in
760
+ * all copies or substantial portions of the Software.
761
+ *
762
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
763
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
764
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
765
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
766
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
767
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
768
+ * THE SOFTWARE.
769
+ */
770
+ var strings$3 = {
771
+ ARIA_CONTROLS: 'aria-controls',
772
+ ARIA_DESCRIBEDBY: 'aria-describedby',
773
+ INPUT_SELECTOR: '.mdc-text-field__input',
774
+ LABEL_SELECTOR: '.mdc-floating-label',
775
+ LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading',
776
+ LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
777
+ OUTLINE_SELECTOR: '.mdc-notched-outline',
778
+ PREFIX_SELECTOR: '.mdc-text-field__affix--prefix',
779
+ SUFFIX_SELECTOR: '.mdc-text-field__affix--suffix',
780
+ TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing'
781
+ };
782
+ var cssClasses$3 = {
783
+ DISABLED: 'mdc-text-field--disabled',
784
+ FOCUSED: 'mdc-text-field--focused',
785
+ HELPER_LINE: 'mdc-text-field-helper-line',
786
+ INVALID: 'mdc-text-field--invalid',
787
+ LABEL_FLOATING: 'mdc-text-field--label-floating',
788
+ NO_LABEL: 'mdc-text-field--no-label',
789
+ OUTLINED: 'mdc-text-field--outlined',
790
+ ROOT: 'mdc-text-field',
791
+ TEXTAREA: 'mdc-text-field--textarea',
792
+ WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',
793
+ WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon',
794
+ WITH_INTERNAL_COUNTER: 'mdc-text-field--with-internal-counter',
795
+ };
796
+ var numbers = {
797
+ LABEL_SCALE: 0.75,
798
+ };
799
+ /**
800
+ * Whitelist based off of
801
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
802
+ * under the "Validation-related attributes" section.
803
+ */
804
+ var VALIDATION_ATTR_WHITELIST = [
805
+ 'pattern',
806
+ 'min',
807
+ 'max',
808
+ 'required',
809
+ 'step',
810
+ 'minlength',
811
+ 'maxlength',
812
+ ];
813
+ /**
814
+ * Label should always float for these types as they show some UI even if value
815
+ * is empty.
816
+ */
817
+ var ALWAYS_FLOAT_TYPES = [
818
+ 'color',
819
+ 'date',
820
+ 'datetime-local',
821
+ 'month',
822
+ 'range',
823
+ 'time',
824
+ 'week',
825
+ ];
826
+
827
+ /**
828
+ * @license
829
+ * Copyright 2016 Google Inc.
830
+ *
831
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
832
+ * of this software and associated documentation files (the "Software"), to deal
833
+ * in the Software without restriction, including without limitation the rights
834
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
835
+ * copies of the Software, and to permit persons to whom the Software is
836
+ * furnished to do so, subject to the following conditions:
837
+ *
838
+ * The above copyright notice and this permission notice shall be included in
839
+ * all copies or substantial portions of the Software.
840
+ *
841
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
842
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
843
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
844
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
845
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
846
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
847
+ * THE SOFTWARE.
848
+ */
849
+ var POINTERDOWN_EVENTS = ['mousedown', 'touchstart'];
850
+ var INTERACTION_EVENTS$1 = ['click', 'keydown'];
851
+ var MDCTextFieldFoundation = /** @class */ (function (_super) {
852
+ __extends(MDCTextFieldFoundation, _super);
853
+ /**
854
+ * @param adapter
855
+ * @param foundationMap Map from subcomponent names to their subfoundations.
856
+ */
857
+ function MDCTextFieldFoundation(adapter, foundationMap) {
858
+ if (foundationMap === void 0) { foundationMap = {}; }
859
+ var _this = _super.call(this, __assign(__assign({}, MDCTextFieldFoundation.defaultAdapter), adapter)) || this;
860
+ _this.isFocused = false;
861
+ _this.receivedUserInput = false;
862
+ _this.valid = true;
863
+ _this.useNativeValidation = true;
864
+ _this.validateOnValueChange = true;
865
+ _this.helperText = foundationMap.helperText;
866
+ _this.characterCounter = foundationMap.characterCounter;
867
+ _this.leadingIcon = foundationMap.leadingIcon;
868
+ _this.trailingIcon = foundationMap.trailingIcon;
869
+ _this.inputFocusHandler = function () {
870
+ _this.activateFocus();
871
+ };
872
+ _this.inputBlurHandler = function () {
873
+ _this.deactivateFocus();
874
+ };
875
+ _this.inputInputHandler = function () {
876
+ _this.handleInput();
877
+ };
878
+ _this.setPointerXOffset = function (evt) {
879
+ _this.setTransformOrigin(evt);
880
+ };
881
+ _this.textFieldInteractionHandler = function () {
882
+ _this.handleTextFieldInteraction();
883
+ };
884
+ _this.validationAttributeChangeHandler = function (attributesList) {
885
+ _this.handleValidationAttributeChange(attributesList);
886
+ };
887
+ return _this;
888
+ }
889
+ Object.defineProperty(MDCTextFieldFoundation, "cssClasses", {
890
+ get: function () {
891
+ return cssClasses$3;
892
+ },
893
+ enumerable: false,
894
+ configurable: true
895
+ });
896
+ Object.defineProperty(MDCTextFieldFoundation, "strings", {
897
+ get: function () {
898
+ return strings$3;
899
+ },
900
+ enumerable: false,
901
+ configurable: true
902
+ });
903
+ Object.defineProperty(MDCTextFieldFoundation, "numbers", {
904
+ get: function () {
905
+ return numbers;
906
+ },
907
+ enumerable: false,
908
+ configurable: true
909
+ });
910
+ Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat", {
911
+ get: function () {
912
+ var type = this.getNativeInput().type;
913
+ return ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;
914
+ },
915
+ enumerable: false,
916
+ configurable: true
917
+ });
918
+ Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", {
919
+ get: function () {
920
+ return this.shouldAlwaysFloat || this.isFocused || !!this.getValue() ||
921
+ this.isBadInput();
922
+ },
923
+ enumerable: false,
924
+ configurable: true
925
+ });
926
+ Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", {
927
+ get: function () {
928
+ return !this.isFocused && !this.isValid() && !!this.getValue();
929
+ },
930
+ enumerable: false,
931
+ configurable: true
932
+ });
933
+ Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", {
934
+ /**
935
+ * See {@link MDCTextFieldAdapter} for typing information on parameters and
936
+ * return types.
937
+ */
938
+ get: function () {
939
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
940
+ return {
941
+ addClass: function () { return undefined; },
942
+ removeClass: function () { return undefined; },
943
+ hasClass: function () { return true; },
944
+ setInputAttr: function () { return undefined; },
945
+ removeInputAttr: function () { return undefined; },
946
+ registerTextFieldInteractionHandler: function () { return undefined; },
947
+ deregisterTextFieldInteractionHandler: function () { return undefined; },
948
+ registerInputInteractionHandler: function () { return undefined; },
949
+ deregisterInputInteractionHandler: function () { return undefined; },
950
+ registerValidationAttributeChangeHandler: function () {
951
+ return new MutationObserver(function () { return undefined; });
952
+ },
953
+ deregisterValidationAttributeChangeHandler: function () { return undefined; },
954
+ getNativeInput: function () { return null; },
955
+ isFocused: function () { return false; },
956
+ activateLineRipple: function () { return undefined; },
957
+ deactivateLineRipple: function () { return undefined; },
958
+ setLineRippleTransformOrigin: function () { return undefined; },
959
+ shakeLabel: function () { return undefined; },
960
+ floatLabel: function () { return undefined; },
961
+ setLabelRequired: function () { return undefined; },
962
+ hasLabel: function () { return false; },
963
+ getLabelWidth: function () { return 0; },
964
+ hasOutline: function () { return false; },
965
+ notchOutline: function () { return undefined; },
966
+ closeOutline: function () { return undefined; },
967
+ };
968
+ // tslint:enable:object-literal-sort-keys
969
+ },
970
+ enumerable: false,
971
+ configurable: true
972
+ });
973
+ MDCTextFieldFoundation.prototype.init = function () {
974
+ var e_1, _a, e_2, _b;
975
+ if (this.adapter.hasLabel() && this.getNativeInput().required) {
976
+ this.adapter.setLabelRequired(true);
977
+ }
978
+ if (this.adapter.isFocused()) {
979
+ this.inputFocusHandler();
980
+ }
981
+ else if (this.adapter.hasLabel() && this.shouldFloat) {
982
+ this.notchOutline(true);
983
+ this.adapter.floatLabel(true);
984
+ this.styleFloating(true);
985
+ }
986
+ this.adapter.registerInputInteractionHandler('focus', this.inputFocusHandler);
987
+ this.adapter.registerInputInteractionHandler('blur', this.inputBlurHandler);
988
+ this.adapter.registerInputInteractionHandler('input', this.inputInputHandler);
989
+ try {
990
+ for (var POINTERDOWN_EVENTS_1 = __values(POINTERDOWN_EVENTS), POINTERDOWN_EVENTS_1_1 = POINTERDOWN_EVENTS_1.next(); !POINTERDOWN_EVENTS_1_1.done; POINTERDOWN_EVENTS_1_1 = POINTERDOWN_EVENTS_1.next()) {
991
+ var evtType = POINTERDOWN_EVENTS_1_1.value;
992
+ this.adapter.registerInputInteractionHandler(evtType, this.setPointerXOffset);
993
+ }
994
+ }
995
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
996
+ finally {
997
+ try {
998
+ if (POINTERDOWN_EVENTS_1_1 && !POINTERDOWN_EVENTS_1_1.done && (_a = POINTERDOWN_EVENTS_1.return)) _a.call(POINTERDOWN_EVENTS_1);
999
+ }
1000
+ finally { if (e_1) throw e_1.error; }
1001
+ }
1002
+ try {
1003
+ for (var INTERACTION_EVENTS_1 = __values(INTERACTION_EVENTS$1), INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next(); !INTERACTION_EVENTS_1_1.done; INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next()) {
1004
+ var evtType = INTERACTION_EVENTS_1_1.value;
1005
+ this.adapter.registerTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler);
1006
+ }
1007
+ }
1008
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1009
+ finally {
1010
+ try {
1011
+ if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_b = INTERACTION_EVENTS_1.return)) _b.call(INTERACTION_EVENTS_1);
1012
+ }
1013
+ finally { if (e_2) throw e_2.error; }
1014
+ }
1015
+ this.validationObserver =
1016
+ this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler);
1017
+ this.setcharacterCounter(this.getValue().length);
1018
+ };
1019
+ MDCTextFieldFoundation.prototype.destroy = function () {
1020
+ var e_3, _a, e_4, _b;
1021
+ this.adapter.deregisterInputInteractionHandler('focus', this.inputFocusHandler);
1022
+ this.adapter.deregisterInputInteractionHandler('blur', this.inputBlurHandler);
1023
+ this.adapter.deregisterInputInteractionHandler('input', this.inputInputHandler);
1024
+ try {
1025
+ for (var POINTERDOWN_EVENTS_2 = __values(POINTERDOWN_EVENTS), POINTERDOWN_EVENTS_2_1 = POINTERDOWN_EVENTS_2.next(); !POINTERDOWN_EVENTS_2_1.done; POINTERDOWN_EVENTS_2_1 = POINTERDOWN_EVENTS_2.next()) {
1026
+ var evtType = POINTERDOWN_EVENTS_2_1.value;
1027
+ this.adapter.deregisterInputInteractionHandler(evtType, this.setPointerXOffset);
1028
+ }
1029
+ }
1030
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1031
+ finally {
1032
+ try {
1033
+ if (POINTERDOWN_EVENTS_2_1 && !POINTERDOWN_EVENTS_2_1.done && (_a = POINTERDOWN_EVENTS_2.return)) _a.call(POINTERDOWN_EVENTS_2);
1034
+ }
1035
+ finally { if (e_3) throw e_3.error; }
1036
+ }
1037
+ try {
1038
+ for (var INTERACTION_EVENTS_2 = __values(INTERACTION_EVENTS$1), INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next(); !INTERACTION_EVENTS_2_1.done; INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next()) {
1039
+ var evtType = INTERACTION_EVENTS_2_1.value;
1040
+ this.adapter.deregisterTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler);
1041
+ }
1042
+ }
1043
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
1044
+ finally {
1045
+ try {
1046
+ if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_b = INTERACTION_EVENTS_2.return)) _b.call(INTERACTION_EVENTS_2);
1047
+ }
1048
+ finally { if (e_4) throw e_4.error; }
1049
+ }
1050
+ this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver);
1051
+ };
1052
+ /**
1053
+ * Handles user interactions with the Text Field.
1054
+ */
1055
+ MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function () {
1056
+ var nativeInput = this.adapter.getNativeInput();
1057
+ if (nativeInput && nativeInput.disabled) {
1058
+ return;
1059
+ }
1060
+ this.receivedUserInput = true;
1061
+ };
1062
+ /**
1063
+ * Handles validation attribute changes
1064
+ */
1065
+ MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function (attributesList) {
1066
+ var _this = this;
1067
+ attributesList.some(function (attributeName) {
1068
+ if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
1069
+ _this.styleValidity(true);
1070
+ _this.adapter.setLabelRequired(_this.getNativeInput().required);
1071
+ return true;
1072
+ }
1073
+ return false;
1074
+ });
1075
+ if (attributesList.indexOf('maxlength') > -1) {
1076
+ this.setcharacterCounter(this.getValue().length);
1077
+ }
1078
+ };
1079
+ /**
1080
+ * Opens/closes the notched outline.
1081
+ */
1082
+ MDCTextFieldFoundation.prototype.notchOutline = function (openNotch) {
1083
+ if (!this.adapter.hasOutline() || !this.adapter.hasLabel()) {
1084
+ return;
1085
+ }
1086
+ if (openNotch) {
1087
+ var labelWidth = this.adapter.getLabelWidth() * numbers.LABEL_SCALE;
1088
+ this.adapter.notchOutline(labelWidth);
1089
+ }
1090
+ else {
1091
+ this.adapter.closeOutline();
1092
+ }
1093
+ };
1094
+ /**
1095
+ * Activates the text field focus state.
1096
+ */
1097
+ MDCTextFieldFoundation.prototype.activateFocus = function () {
1098
+ this.isFocused = true;
1099
+ this.styleFocused(this.isFocused);
1100
+ this.adapter.activateLineRipple();
1101
+ if (this.adapter.hasLabel()) {
1102
+ this.notchOutline(this.shouldFloat);
1103
+ this.adapter.floatLabel(this.shouldFloat);
1104
+ this.styleFloating(this.shouldFloat);
1105
+ this.adapter.shakeLabel(this.shouldShake);
1106
+ }
1107
+ if (this.helperText &&
1108
+ (this.helperText.isPersistent() || !this.helperText.isValidation() ||
1109
+ !this.valid)) {
1110
+ this.helperText.showToScreenReader();
1111
+ }
1112
+ };
1113
+ /**
1114
+ * Sets the line ripple's transform origin, so that the line ripple activate
1115
+ * animation will animate out from the user's click location.
1116
+ */
1117
+ MDCTextFieldFoundation.prototype.setTransformOrigin = function (evt) {
1118
+ if (this.isDisabled() || this.adapter.hasOutline()) {
1119
+ return;
1120
+ }
1121
+ var touches = evt.touches;
1122
+ var targetEvent = touches ? touches[0] : evt;
1123
+ var targetClientRect = targetEvent.target.getBoundingClientRect();
1124
+ var normalizedX = targetEvent.clientX - targetClientRect.left;
1125
+ this.adapter.setLineRippleTransformOrigin(normalizedX);
1126
+ };
1127
+ /**
1128
+ * Handles input change of text input and text area.
1129
+ */
1130
+ MDCTextFieldFoundation.prototype.handleInput = function () {
1131
+ this.autoCompleteFocus();
1132
+ this.setcharacterCounter(this.getValue().length);
1133
+ };
1134
+ /**
1135
+ * Activates the Text Field's focus state in cases when the input value
1136
+ * changes without user input (e.g. programmatically).
1137
+ */
1138
+ MDCTextFieldFoundation.prototype.autoCompleteFocus = function () {
1139
+ if (!this.receivedUserInput) {
1140
+ this.activateFocus();
1141
+ }
1142
+ };
1143
+ /**
1144
+ * Deactivates the Text Field's focus state.
1145
+ */
1146
+ MDCTextFieldFoundation.prototype.deactivateFocus = function () {
1147
+ this.isFocused = false;
1148
+ this.adapter.deactivateLineRipple();
1149
+ var isValid = this.isValid();
1150
+ this.styleValidity(isValid);
1151
+ this.styleFocused(this.isFocused);
1152
+ if (this.adapter.hasLabel()) {
1153
+ this.notchOutline(this.shouldFloat);
1154
+ this.adapter.floatLabel(this.shouldFloat);
1155
+ this.styleFloating(this.shouldFloat);
1156
+ this.adapter.shakeLabel(this.shouldShake);
1157
+ }
1158
+ if (!this.shouldFloat) {
1159
+ this.receivedUserInput = false;
1160
+ }
1161
+ };
1162
+ MDCTextFieldFoundation.prototype.getValue = function () {
1163
+ return this.getNativeInput().value;
1164
+ };
1165
+ /**
1166
+ * @param value The value to set on the input Element.
1167
+ */
1168
+ MDCTextFieldFoundation.prototype.setValue = function (value) {
1169
+ // Prevent Safari from moving the caret to the end of the input when the
1170
+ // value has not changed.
1171
+ if (this.getValue() !== value) {
1172
+ this.getNativeInput().value = value;
1173
+ }
1174
+ this.setcharacterCounter(value.length);
1175
+ if (this.validateOnValueChange) {
1176
+ var isValid = this.isValid();
1177
+ this.styleValidity(isValid);
1178
+ }
1179
+ if (this.adapter.hasLabel()) {
1180
+ this.notchOutline(this.shouldFloat);
1181
+ this.adapter.floatLabel(this.shouldFloat);
1182
+ this.styleFloating(this.shouldFloat);
1183
+ if (this.validateOnValueChange) {
1184
+ this.adapter.shakeLabel(this.shouldShake);
1185
+ }
1186
+ }
1187
+ };
1188
+ /**
1189
+ * @return The custom validity state, if set; otherwise, the result of a
1190
+ * native validity check.
1191
+ */
1192
+ MDCTextFieldFoundation.prototype.isValid = function () {
1193
+ return this.useNativeValidation ? this.isNativeInputValid() : this.valid;
1194
+ };
1195
+ /**
1196
+ * @param isValid Sets the custom validity state of the Text Field.
1197
+ */
1198
+ MDCTextFieldFoundation.prototype.setValid = function (isValid) {
1199
+ this.valid = isValid;
1200
+ this.styleValidity(isValid);
1201
+ var shouldShake = !isValid && !this.isFocused && !!this.getValue();
1202
+ if (this.adapter.hasLabel()) {
1203
+ this.adapter.shakeLabel(shouldShake);
1204
+ }
1205
+ };
1206
+ /**
1207
+ * @param shouldValidate Whether or not validity should be updated on
1208
+ * value change.
1209
+ */
1210
+ MDCTextFieldFoundation.prototype.setValidateOnValueChange = function (shouldValidate) {
1211
+ this.validateOnValueChange = shouldValidate;
1212
+ };
1213
+ /**
1214
+ * @return Whether or not validity should be updated on value change. `true`
1215
+ * by default.
1216
+ */
1217
+ MDCTextFieldFoundation.prototype.getValidateOnValueChange = function () {
1218
+ return this.validateOnValueChange;
1219
+ };
1220
+ /**
1221
+ * Enables or disables the use of native validation. Use this for custom
1222
+ * validation.
1223
+ * @param useNativeValidation Set this to false to ignore native input
1224
+ * validation.
1225
+ */
1226
+ MDCTextFieldFoundation.prototype.setUseNativeValidation = function (useNativeValidation) {
1227
+ this.useNativeValidation = useNativeValidation;
1228
+ };
1229
+ MDCTextFieldFoundation.prototype.isDisabled = function () {
1230
+ return this.getNativeInput().disabled;
1231
+ };
1232
+ /**
1233
+ * @param disabled Sets the text-field disabled or enabled.
1234
+ */
1235
+ MDCTextFieldFoundation.prototype.setDisabled = function (disabled) {
1236
+ this.getNativeInput().disabled = disabled;
1237
+ this.styleDisabled(disabled);
1238
+ };
1239
+ /**
1240
+ * @param content Sets the content of the helper text.
1241
+ */
1242
+ MDCTextFieldFoundation.prototype.setHelperTextContent = function (content) {
1243
+ if (this.helperText) {
1244
+ this.helperText.setContent(content);
1245
+ }
1246
+ };
1247
+ /**
1248
+ * Sets the aria label of the leading icon.
1249
+ */
1250
+ MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function (label) {
1251
+ if (this.leadingIcon) {
1252
+ this.leadingIcon.setAriaLabel(label);
1253
+ }
1254
+ };
1255
+ /**
1256
+ * Sets the text content of the leading icon.
1257
+ */
1258
+ MDCTextFieldFoundation.prototype.setLeadingIconContent = function (content) {
1259
+ if (this.leadingIcon) {
1260
+ this.leadingIcon.setContent(content);
1261
+ }
1262
+ };
1263
+ /**
1264
+ * Sets the aria label of the trailing icon.
1265
+ */
1266
+ MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function (label) {
1267
+ if (this.trailingIcon) {
1268
+ this.trailingIcon.setAriaLabel(label);
1269
+ }
1270
+ };
1271
+ /**
1272
+ * Sets the text content of the trailing icon.
1273
+ */
1274
+ MDCTextFieldFoundation.prototype.setTrailingIconContent = function (content) {
1275
+ if (this.trailingIcon) {
1276
+ this.trailingIcon.setContent(content);
1277
+ }
1278
+ };
1279
+ /**
1280
+ * Sets character counter values that shows characters used and the total
1281
+ * character limit.
1282
+ */
1283
+ MDCTextFieldFoundation.prototype.setcharacterCounter = function (currentLength) {
1284
+ if (!this.characterCounter) {
1285
+ return;
1286
+ }
1287
+ var maxLength = this.getNativeInput().maxLength;
1288
+ if (maxLength === -1) {
1289
+ throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');
1290
+ }
1291
+ this.characterCounter.setCounterValue(currentLength, maxLength);
1292
+ };
1293
+ /**
1294
+ * @return True if the Text Field input fails in converting the user-supplied
1295
+ * value.
1296
+ */
1297
+ MDCTextFieldFoundation.prototype.isBadInput = function () {
1298
+ // The badInput property is not supported in IE 11 💩.
1299
+ return this.getNativeInput().validity.badInput || false;
1300
+ };
1301
+ /**
1302
+ * @return The result of native validity checking (ValidityState.valid).
1303
+ */
1304
+ MDCTextFieldFoundation.prototype.isNativeInputValid = function () {
1305
+ return this.getNativeInput().validity.valid;
1306
+ };
1307
+ /**
1308
+ * Styles the component based on the validity state.
1309
+ */
1310
+ MDCTextFieldFoundation.prototype.styleValidity = function (isValid) {
1311
+ var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
1312
+ if (isValid) {
1313
+ this.adapter.removeClass(INVALID);
1314
+ }
1315
+ else {
1316
+ this.adapter.addClass(INVALID);
1317
+ }
1318
+ if (this.helperText) {
1319
+ this.helperText.setValidity(isValid);
1320
+ // We dynamically set or unset aria-describedby for validation helper text
1321
+ // only, based on whether the field is valid
1322
+ var helperTextValidation = this.helperText.isValidation();
1323
+ if (!helperTextValidation) {
1324
+ return;
1325
+ }
1326
+ var helperTextVisible = this.helperText.isVisible();
1327
+ var helperTextId = this.helperText.getId();
1328
+ if (helperTextVisible && helperTextId) {
1329
+ this.adapter.setInputAttr(strings$3.ARIA_DESCRIBEDBY, helperTextId);
1330
+ }
1331
+ else {
1332
+ this.adapter.removeInputAttr(strings$3.ARIA_DESCRIBEDBY);
1333
+ }
1334
+ }
1335
+ };
1336
+ /**
1337
+ * Styles the component based on the focused state.
1338
+ */
1339
+ MDCTextFieldFoundation.prototype.styleFocused = function (isFocused) {
1340
+ var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
1341
+ if (isFocused) {
1342
+ this.adapter.addClass(FOCUSED);
1343
+ }
1344
+ else {
1345
+ this.adapter.removeClass(FOCUSED);
1346
+ }
1347
+ };
1348
+ /**
1349
+ * Styles the component based on the disabled state.
1350
+ */
1351
+ MDCTextFieldFoundation.prototype.styleDisabled = function (isDisabled) {
1352
+ var _a = MDCTextFieldFoundation.cssClasses, DISABLED = _a.DISABLED, INVALID = _a.INVALID;
1353
+ if (isDisabled) {
1354
+ this.adapter.addClass(DISABLED);
1355
+ this.adapter.removeClass(INVALID);
1356
+ }
1357
+ else {
1358
+ this.adapter.removeClass(DISABLED);
1359
+ }
1360
+ if (this.leadingIcon) {
1361
+ this.leadingIcon.setDisabled(isDisabled);
1362
+ }
1363
+ if (this.trailingIcon) {
1364
+ this.trailingIcon.setDisabled(isDisabled);
1365
+ }
1366
+ };
1367
+ /**
1368
+ * Styles the component based on the label floating state.
1369
+ */
1370
+ MDCTextFieldFoundation.prototype.styleFloating = function (isFloating) {
1371
+ var LABEL_FLOATING = MDCTextFieldFoundation.cssClasses.LABEL_FLOATING;
1372
+ if (isFloating) {
1373
+ this.adapter.addClass(LABEL_FLOATING);
1374
+ }
1375
+ else {
1376
+ this.adapter.removeClass(LABEL_FLOATING);
1377
+ }
1378
+ };
1379
+ /**
1380
+ * @return The native text input element from the host environment, or an
1381
+ * object with the same shape for unit tests.
1382
+ */
1383
+ MDCTextFieldFoundation.prototype.getNativeInput = function () {
1384
+ // this.adapter may be undefined in foundation unit tests. This happens when
1385
+ // testdouble is creating a mock object and invokes the
1386
+ // shouldShake/shouldFloat getters (which in turn call getValue(), which
1387
+ // calls this method) before init() has been called from the MDCTextField
1388
+ // constructor. To work around that issue, we return a dummy object.
1389
+ var nativeInput = this.adapter ? this.adapter.getNativeInput() : null;
1390
+ return nativeInput || {
1391
+ disabled: false,
1392
+ maxLength: -1,
1393
+ required: false,
1394
+ type: 'input',
1395
+ validity: {
1396
+ badInput: false,
1397
+ valid: true,
1398
+ },
1399
+ value: '',
1400
+ };
1401
+ };
1402
+ return MDCTextFieldFoundation;
1403
+ }(MDCFoundation));
1404
+
1405
+ /**
1406
+ * @license
1407
+ * Copyright 2016 Google Inc.
1408
+ *
1409
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1410
+ * of this software and associated documentation files (the "Software"), to deal
1411
+ * in the Software without restriction, including without limitation the rights
1412
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1413
+ * copies of the Software, and to permit persons to whom the Software is
1414
+ * furnished to do so, subject to the following conditions:
1415
+ *
1416
+ * The above copyright notice and this permission notice shall be included in
1417
+ * all copies or substantial portions of the Software.
1418
+ *
1419
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1420
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1421
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1422
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1423
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1424
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1425
+ * THE SOFTWARE.
1426
+ */
1427
+ var cssClasses$2 = {
1428
+ HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
1429
+ HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg',
1430
+ ROOT: 'mdc-text-field-helper-text',
1431
+ };
1432
+ var strings$2 = {
1433
+ ARIA_HIDDEN: 'aria-hidden',
1434
+ ROLE: 'role',
1435
+ ROOT_SELECTOR: "." + cssClasses$2.ROOT,
1436
+ };
1437
+
1438
+ /**
1439
+ * @license
1440
+ * Copyright 2017 Google Inc.
1441
+ *
1442
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1443
+ * of this software and associated documentation files (the "Software"), to deal
1444
+ * in the Software without restriction, including without limitation the rights
1445
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1446
+ * copies of the Software, and to permit persons to whom the Software is
1447
+ * furnished to do so, subject to the following conditions:
1448
+ *
1449
+ * The above copyright notice and this permission notice shall be included in
1450
+ * all copies or substantial portions of the Software.
1451
+ *
1452
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1453
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1454
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1455
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1456
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1457
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1458
+ * THE SOFTWARE.
1459
+ */
1460
+ var MDCTextFieldHelperTextFoundation = /** @class */ (function (_super) {
1461
+ __extends(MDCTextFieldHelperTextFoundation, _super);
1462
+ function MDCTextFieldHelperTextFoundation(adapter) {
1463
+ return _super.call(this, __assign(__assign({}, MDCTextFieldHelperTextFoundation.defaultAdapter), adapter)) || this;
1464
+ }
1465
+ Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", {
1466
+ get: function () {
1467
+ return cssClasses$2;
1468
+ },
1469
+ enumerable: false,
1470
+ configurable: true
1471
+ });
1472
+ Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", {
1473
+ get: function () {
1474
+ return strings$2;
1475
+ },
1476
+ enumerable: false,
1477
+ configurable: true
1478
+ });
1479
+ Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", {
1480
+ /**
1481
+ * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.
1482
+ */
1483
+ get: function () {
1484
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1485
+ return {
1486
+ addClass: function () { return undefined; },
1487
+ removeClass: function () { return undefined; },
1488
+ hasClass: function () { return false; },
1489
+ getAttr: function () { return null; },
1490
+ setAttr: function () { return undefined; },
1491
+ removeAttr: function () { return undefined; },
1492
+ setContent: function () { return undefined; },
1493
+ };
1494
+ // tslint:enable:object-literal-sort-keys
1495
+ },
1496
+ enumerable: false,
1497
+ configurable: true
1498
+ });
1499
+ MDCTextFieldHelperTextFoundation.prototype.getId = function () {
1500
+ return this.adapter.getAttr('id');
1501
+ };
1502
+ MDCTextFieldHelperTextFoundation.prototype.isVisible = function () {
1503
+ return this.adapter.getAttr(strings$2.ARIA_HIDDEN) !== 'true';
1504
+ };
1505
+ /**
1506
+ * Sets the content of the helper text field.
1507
+ */
1508
+ MDCTextFieldHelperTextFoundation.prototype.setContent = function (content) {
1509
+ this.adapter.setContent(content);
1510
+ };
1511
+ MDCTextFieldHelperTextFoundation.prototype.isPersistent = function () {
1512
+ return this.adapter.hasClass(cssClasses$2.HELPER_TEXT_PERSISTENT);
1513
+ };
1514
+ /**
1515
+ * @param isPersistent Sets the persistency of the helper text.
1516
+ */
1517
+ MDCTextFieldHelperTextFoundation.prototype.setPersistent = function (isPersistent) {
1518
+ if (isPersistent) {
1519
+ this.adapter.addClass(cssClasses$2.HELPER_TEXT_PERSISTENT);
1520
+ }
1521
+ else {
1522
+ this.adapter.removeClass(cssClasses$2.HELPER_TEXT_PERSISTENT);
1523
+ }
1524
+ };
1525
+ /**
1526
+ * @return whether the helper text acts as an error validation message.
1527
+ */
1528
+ MDCTextFieldHelperTextFoundation.prototype.isValidation = function () {
1529
+ return this.adapter.hasClass(cssClasses$2.HELPER_TEXT_VALIDATION_MSG);
1530
+ };
1531
+ /**
1532
+ * @param isValidation True to make the helper text act as an error validation message.
1533
+ */
1534
+ MDCTextFieldHelperTextFoundation.prototype.setValidation = function (isValidation) {
1535
+ if (isValidation) {
1536
+ this.adapter.addClass(cssClasses$2.HELPER_TEXT_VALIDATION_MSG);
1537
+ }
1538
+ else {
1539
+ this.adapter.removeClass(cssClasses$2.HELPER_TEXT_VALIDATION_MSG);
1540
+ }
1541
+ };
1542
+ /**
1543
+ * Makes the helper text visible to the screen reader.
1544
+ */
1545
+ MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function () {
1546
+ this.adapter.removeAttr(strings$2.ARIA_HIDDEN);
1547
+ };
1548
+ /**
1549
+ * Sets the validity of the helper text based on the input validity.
1550
+ */
1551
+ MDCTextFieldHelperTextFoundation.prototype.setValidity = function (inputIsValid) {
1552
+ var helperTextIsPersistent = this.adapter.hasClass(cssClasses$2.HELPER_TEXT_PERSISTENT);
1553
+ var helperTextIsValidationMsg = this.adapter.hasClass(cssClasses$2.HELPER_TEXT_VALIDATION_MSG);
1554
+ var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
1555
+ if (validationMsgNeedsDisplay) {
1556
+ this.showToScreenReader();
1557
+ // If role is already alert, refresh it to trigger another announcement
1558
+ // from screenreader.
1559
+ if (this.adapter.getAttr(strings$2.ROLE) === 'alert') {
1560
+ this.refreshAlertRole();
1561
+ }
1562
+ else {
1563
+ this.adapter.setAttr(strings$2.ROLE, 'alert');
1564
+ }
1565
+ }
1566
+ else {
1567
+ this.adapter.removeAttr(strings$2.ROLE);
1568
+ }
1569
+ if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
1570
+ this.hide();
1571
+ }
1572
+ };
1573
+ /**
1574
+ * Hides the help text from screen readers.
1575
+ */
1576
+ MDCTextFieldHelperTextFoundation.prototype.hide = function () {
1577
+ this.adapter.setAttr(strings$2.ARIA_HIDDEN, 'true');
1578
+ };
1579
+ MDCTextFieldHelperTextFoundation.prototype.refreshAlertRole = function () {
1580
+ var _this = this;
1581
+ this.adapter.removeAttr(strings$2.ROLE);
1582
+ requestAnimationFrame(function () {
1583
+ _this.adapter.setAttr(strings$2.ROLE, 'alert');
1584
+ });
1585
+ };
1586
+ return MDCTextFieldHelperTextFoundation;
1587
+ }(MDCFoundation));
1588
+
1589
+ /**
1590
+ * @license
1591
+ * Copyright 2017 Google Inc.
1592
+ *
1593
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1594
+ * of this software and associated documentation files (the "Software"), to deal
1595
+ * in the Software without restriction, including without limitation the rights
1596
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1597
+ * copies of the Software, and to permit persons to whom the Software is
1598
+ * furnished to do so, subject to the following conditions:
1599
+ *
1600
+ * The above copyright notice and this permission notice shall be included in
1601
+ * all copies or substantial portions of the Software.
1602
+ *
1603
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1604
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1605
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1606
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1607
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1608
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1609
+ * THE SOFTWARE.
1610
+ */
1611
+ var MDCTextFieldHelperText = /** @class */ (function (_super) {
1612
+ __extends(MDCTextFieldHelperText, _super);
1613
+ function MDCTextFieldHelperText() {
1614
+ return _super !== null && _super.apply(this, arguments) || this;
1615
+ }
1616
+ MDCTextFieldHelperText.attachTo = function (root) {
1617
+ return new MDCTextFieldHelperText(root);
1618
+ };
1619
+ Object.defineProperty(MDCTextFieldHelperText.prototype, "foundationForTextField", {
1620
+ // Provided for access by MDCTextField component
1621
+ get: function () {
1622
+ return this.foundation;
1623
+ },
1624
+ enumerable: false,
1625
+ configurable: true
1626
+ });
1627
+ MDCTextFieldHelperText.prototype.getDefaultFoundation = function () {
1628
+ var _this = this;
1629
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
1630
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
1631
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1632
+ var adapter = {
1633
+ addClass: function (className) { return _this.root.classList.add(className); },
1634
+ removeClass: function (className) { return _this.root.classList.remove(className); },
1635
+ hasClass: function (className) { return _this.root.classList.contains(className); },
1636
+ getAttr: function (attr) { return _this.root.getAttribute(attr); },
1637
+ setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); },
1638
+ removeAttr: function (attr) { return _this.root.removeAttribute(attr); },
1639
+ setContent: function (content) {
1640
+ _this.root.textContent = content;
1641
+ },
1642
+ };
1643
+ // tslint:enable:object-literal-sort-keys
1644
+ return new MDCTextFieldHelperTextFoundation(adapter);
1645
+ };
1646
+ return MDCTextFieldHelperText;
1647
+ }(MDCComponent));
1648
+
1649
+ /**
1650
+ * @license
1651
+ * Copyright 2016 Google Inc.
1652
+ *
1653
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1654
+ * of this software and associated documentation files (the "Software"), to deal
1655
+ * in the Software without restriction, including without limitation the rights
1656
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1657
+ * copies of the Software, and to permit persons to whom the Software is
1658
+ * furnished to do so, subject to the following conditions:
1659
+ *
1660
+ * The above copyright notice and this permission notice shall be included in
1661
+ * all copies or substantial portions of the Software.
1662
+ *
1663
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1664
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1665
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1666
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1667
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1668
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1669
+ * THE SOFTWARE.
1670
+ */
1671
+ var strings$1 = {
1672
+ ICON_EVENT: 'MDCTextField:icon',
1673
+ ICON_ROLE: 'button',
1674
+ };
1675
+ var cssClasses$1 = {
1676
+ ROOT: 'mdc-text-field__icon',
1677
+ };
1678
+
1679
+ /**
1680
+ * @license
1681
+ * Copyright 2017 Google Inc.
1682
+ *
1683
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1684
+ * of this software and associated documentation files (the "Software"), to deal
1685
+ * in the Software without restriction, including without limitation the rights
1686
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1687
+ * copies of the Software, and to permit persons to whom the Software is
1688
+ * furnished to do so, subject to the following conditions:
1689
+ *
1690
+ * The above copyright notice and this permission notice shall be included in
1691
+ * all copies or substantial portions of the Software.
1692
+ *
1693
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1694
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1695
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1696
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1697
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1698
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1699
+ * THE SOFTWARE.
1700
+ */
1701
+ var INTERACTION_EVENTS = ['click', 'keydown'];
1702
+ var MDCTextFieldIconFoundation = /** @class */ (function (_super) {
1703
+ __extends(MDCTextFieldIconFoundation, _super);
1704
+ function MDCTextFieldIconFoundation(adapter) {
1705
+ var _this = _super.call(this, __assign(__assign({}, MDCTextFieldIconFoundation.defaultAdapter), adapter)) || this;
1706
+ _this.savedTabIndex = null;
1707
+ _this.interactionHandler = function (evt) {
1708
+ _this.handleInteraction(evt);
1709
+ };
1710
+ return _this;
1711
+ }
1712
+ Object.defineProperty(MDCTextFieldIconFoundation, "strings", {
1713
+ get: function () {
1714
+ return strings$1;
1715
+ },
1716
+ enumerable: false,
1717
+ configurable: true
1718
+ });
1719
+ Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", {
1720
+ get: function () {
1721
+ return cssClasses$1;
1722
+ },
1723
+ enumerable: false,
1724
+ configurable: true
1725
+ });
1726
+ Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", {
1727
+ /**
1728
+ * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.
1729
+ */
1730
+ get: function () {
1731
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1732
+ return {
1733
+ getAttr: function () { return null; },
1734
+ setAttr: function () { return undefined; },
1735
+ removeAttr: function () { return undefined; },
1736
+ setContent: function () { return undefined; },
1737
+ registerInteractionHandler: function () { return undefined; },
1738
+ deregisterInteractionHandler: function () { return undefined; },
1739
+ notifyIconAction: function () { return undefined; },
1740
+ };
1741
+ // tslint:enable:object-literal-sort-keys
1742
+ },
1743
+ enumerable: false,
1744
+ configurable: true
1745
+ });
1746
+ MDCTextFieldIconFoundation.prototype.init = function () {
1747
+ var e_1, _a;
1748
+ this.savedTabIndex = this.adapter.getAttr('tabindex');
1749
+ try {
1750
+ for (var INTERACTION_EVENTS_1 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next(); !INTERACTION_EVENTS_1_1.done; INTERACTION_EVENTS_1_1 = INTERACTION_EVENTS_1.next()) {
1751
+ var evtType = INTERACTION_EVENTS_1_1.value;
1752
+ this.adapter.registerInteractionHandler(evtType, this.interactionHandler);
1753
+ }
1754
+ }
1755
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1756
+ finally {
1757
+ try {
1758
+ if (INTERACTION_EVENTS_1_1 && !INTERACTION_EVENTS_1_1.done && (_a = INTERACTION_EVENTS_1.return)) _a.call(INTERACTION_EVENTS_1);
1759
+ }
1760
+ finally { if (e_1) throw e_1.error; }
1761
+ }
1762
+ };
1763
+ MDCTextFieldIconFoundation.prototype.destroy = function () {
1764
+ var e_2, _a;
1765
+ try {
1766
+ for (var INTERACTION_EVENTS_2 = __values(INTERACTION_EVENTS), INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next(); !INTERACTION_EVENTS_2_1.done; INTERACTION_EVENTS_2_1 = INTERACTION_EVENTS_2.next()) {
1767
+ var evtType = INTERACTION_EVENTS_2_1.value;
1768
+ this.adapter.deregisterInteractionHandler(evtType, this.interactionHandler);
1769
+ }
1770
+ }
1771
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1772
+ finally {
1773
+ try {
1774
+ if (INTERACTION_EVENTS_2_1 && !INTERACTION_EVENTS_2_1.done && (_a = INTERACTION_EVENTS_2.return)) _a.call(INTERACTION_EVENTS_2);
1775
+ }
1776
+ finally { if (e_2) throw e_2.error; }
1777
+ }
1778
+ };
1779
+ MDCTextFieldIconFoundation.prototype.setDisabled = function (disabled) {
1780
+ if (!this.savedTabIndex) {
1781
+ return;
1782
+ }
1783
+ if (disabled) {
1784
+ this.adapter.setAttr('tabindex', '-1');
1785
+ this.adapter.removeAttr('role');
1786
+ }
1787
+ else {
1788
+ this.adapter.setAttr('tabindex', this.savedTabIndex);
1789
+ this.adapter.setAttr('role', strings$1.ICON_ROLE);
1790
+ }
1791
+ };
1792
+ MDCTextFieldIconFoundation.prototype.setAriaLabel = function (label) {
1793
+ this.adapter.setAttr('aria-label', label);
1794
+ };
1795
+ MDCTextFieldIconFoundation.prototype.setContent = function (content) {
1796
+ this.adapter.setContent(content);
1797
+ };
1798
+ MDCTextFieldIconFoundation.prototype.handleInteraction = function (evt) {
1799
+ var isEnterKey = evt.key === 'Enter' || evt.keyCode === 13;
1800
+ if (evt.type === 'click' || isEnterKey) {
1801
+ evt.preventDefault(); // stop click from causing host label to focus
1802
+ // input
1803
+ this.adapter.notifyIconAction();
1804
+ }
1805
+ };
1806
+ return MDCTextFieldIconFoundation;
1807
+ }(MDCFoundation));
1808
+
1809
+ /**
1810
+ * @license
1811
+ * Copyright 2017 Google Inc.
1812
+ *
1813
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1814
+ * of this software and associated documentation files (the "Software"), to deal
1815
+ * in the Software without restriction, including without limitation the rights
1816
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1817
+ * copies of the Software, and to permit persons to whom the Software is
1818
+ * furnished to do so, subject to the following conditions:
1819
+ *
1820
+ * The above copyright notice and this permission notice shall be included in
1821
+ * all copies or substantial portions of the Software.
1822
+ *
1823
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1824
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1825
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1826
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1827
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1828
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1829
+ * THE SOFTWARE.
1830
+ */
1831
+ var MDCTextFieldIcon = /** @class */ (function (_super) {
1832
+ __extends(MDCTextFieldIcon, _super);
1833
+ function MDCTextFieldIcon() {
1834
+ return _super !== null && _super.apply(this, arguments) || this;
1835
+ }
1836
+ MDCTextFieldIcon.attachTo = function (root) {
1837
+ return new MDCTextFieldIcon(root);
1838
+ };
1839
+ Object.defineProperty(MDCTextFieldIcon.prototype, "foundationForTextField", {
1840
+ // Provided for access by MDCTextField component
1841
+ get: function () {
1842
+ return this.foundation;
1843
+ },
1844
+ enumerable: false,
1845
+ configurable: true
1846
+ });
1847
+ MDCTextFieldIcon.prototype.getDefaultFoundation = function () {
1848
+ var _this = this;
1849
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
1850
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
1851
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
1852
+ var adapter = {
1853
+ getAttr: function (attr) { return _this.root.getAttribute(attr); },
1854
+ setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); },
1855
+ removeAttr: function (attr) { return _this.root.removeAttribute(attr); },
1856
+ setContent: function (content) {
1857
+ _this.root.textContent = content;
1858
+ },
1859
+ registerInteractionHandler: function (evtType, handler) { return _this.listen(evtType, handler); },
1860
+ deregisterInteractionHandler: function (evtType, handler) { return _this.unlisten(evtType, handler); },
1861
+ notifyIconAction: function () { return _this.emit(MDCTextFieldIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */); },
1862
+ };
1863
+ // tslint:enable:object-literal-sort-keys
1864
+ return new MDCTextFieldIconFoundation(adapter);
1865
+ };
1866
+ return MDCTextFieldIcon;
1867
+ }(MDCComponent));
1868
+
1869
+ /**
1870
+ * @license
1871
+ * Copyright 2016 Google Inc.
1872
+ *
1873
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1874
+ * of this software and associated documentation files (the "Software"), to deal
1875
+ * in the Software without restriction, including without limitation the rights
1876
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1877
+ * copies of the Software, and to permit persons to whom the Software is
1878
+ * furnished to do so, subject to the following conditions:
1879
+ *
1880
+ * The above copyright notice and this permission notice shall be included in
1881
+ * all copies or substantial portions of the Software.
1882
+ *
1883
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1884
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1885
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1886
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1887
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1888
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1889
+ * THE SOFTWARE.
1890
+ */
1891
+ var MDCTextField = /** @class */ (function (_super) {
1892
+ __extends(MDCTextField, _super);
1893
+ function MDCTextField() {
1894
+ return _super !== null && _super.apply(this, arguments) || this;
1895
+ }
1896
+ MDCTextField.attachTo = function (root) {
1897
+ return new MDCTextField(root);
1898
+ };
1899
+ MDCTextField.prototype.initialize = function (rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) {
1900
+ if (rippleFactory === void 0) { rippleFactory = function (el, foundation) { return new MDCRipple(el, foundation); }; }
1901
+ if (lineRippleFactory === void 0) { lineRippleFactory = function (el) { return new MDCLineRipple(el); }; }
1902
+ if (helperTextFactory === void 0) { helperTextFactory = function (el) {
1903
+ return new MDCTextFieldHelperText(el);
1904
+ }; }
1905
+ if (characterCounterFactory === void 0) { characterCounterFactory = function (el) {
1906
+ return new MDCTextFieldCharacterCounter(el);
1907
+ }; }
1908
+ if (iconFactory === void 0) { iconFactory = function (el) { return new MDCTextFieldIcon(el); }; }
1909
+ if (labelFactory === void 0) { labelFactory = function (el) { return new MDCFloatingLabel(el); }; }
1910
+ if (outlineFactory === void 0) { outlineFactory = function (el) { return new MDCNotchedOutline(el); }; }
1911
+ this.input =
1912
+ this.root.querySelector(strings$3.INPUT_SELECTOR);
1913
+ var labelElement = this.root.querySelector(strings$3.LABEL_SELECTOR);
1914
+ this.label = labelElement ? labelFactory(labelElement) : null;
1915
+ var lineRippleElement = this.root.querySelector(strings$3.LINE_RIPPLE_SELECTOR);
1916
+ this.lineRipple =
1917
+ lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
1918
+ var outlineElement = this.root.querySelector(strings$3.OUTLINE_SELECTOR);
1919
+ this.outline = outlineElement ? outlineFactory(outlineElement) : null;
1920
+ // Helper text
1921
+ var helperTextStrings = MDCTextFieldHelperTextFoundation.strings;
1922
+ var nextElementSibling = this.root.nextElementSibling;
1923
+ var hasHelperLine = (nextElementSibling && nextElementSibling.classList.contains(cssClasses$3.HELPER_LINE));
1924
+ var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);
1925
+ this.helperText = helperTextEl ? helperTextFactory(helperTextEl) : null;
1926
+ // Character counter
1927
+ var characterCounterStrings = MDCTextFieldCharacterCounterFoundation.strings;
1928
+ var characterCounterEl = this.root.querySelector(characterCounterStrings.ROOT_SELECTOR);
1929
+ // If character counter is not found in root element search in sibling element.
1930
+ if (!characterCounterEl && hasHelperLine && nextElementSibling) {
1931
+ characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);
1932
+ }
1933
+ this.characterCounter =
1934
+ characterCounterEl ? characterCounterFactory(characterCounterEl) : null;
1935
+ // Leading icon
1936
+ var leadingIconEl = this.root.querySelector(strings$3.LEADING_ICON_SELECTOR);
1937
+ this.leadingIcon = leadingIconEl ? iconFactory(leadingIconEl) : null;
1938
+ // Trailing icon
1939
+ var trailingIconEl = this.root.querySelector(strings$3.TRAILING_ICON_SELECTOR);
1940
+ this.trailingIcon = trailingIconEl ? iconFactory(trailingIconEl) : null;
1941
+ // Prefix and Suffix
1942
+ this.prefix = this.root.querySelector(strings$3.PREFIX_SELECTOR);
1943
+ this.suffix = this.root.querySelector(strings$3.SUFFIX_SELECTOR);
1944
+ this.ripple = this.createRipple(rippleFactory);
1945
+ };
1946
+ MDCTextField.prototype.destroy = function () {
1947
+ if (this.ripple) {
1948
+ this.ripple.destroy();
1949
+ }
1950
+ if (this.lineRipple) {
1951
+ this.lineRipple.destroy();
1952
+ }
1953
+ if (this.helperText) {
1954
+ this.helperText.destroy();
1955
+ }
1956
+ if (this.characterCounter) {
1957
+ this.characterCounter.destroy();
1958
+ }
1959
+ if (this.leadingIcon) {
1960
+ this.leadingIcon.destroy();
1961
+ }
1962
+ if (this.trailingIcon) {
1963
+ this.trailingIcon.destroy();
1964
+ }
1965
+ if (this.label) {
1966
+ this.label.destroy();
1967
+ }
1968
+ if (this.outline) {
1969
+ this.outline.destroy();
1970
+ }
1971
+ _super.prototype.destroy.call(this);
1972
+ };
1973
+ /**
1974
+ * Initializes the Text Field's internal state based on the environment's
1975
+ * state.
1976
+ */
1977
+ MDCTextField.prototype.initialSyncWithDOM = function () {
1978
+ this.disabled = this.input.disabled;
1979
+ };
1980
+ Object.defineProperty(MDCTextField.prototype, "value", {
1981
+ get: function () {
1982
+ return this.foundation.getValue();
1983
+ },
1984
+ /**
1985
+ * @param value The value to set on the input.
1986
+ */
1987
+ set: function (value) {
1988
+ this.foundation.setValue(value);
1989
+ },
1990
+ enumerable: false,
1991
+ configurable: true
1992
+ });
1993
+ Object.defineProperty(MDCTextField.prototype, "disabled", {
1994
+ get: function () {
1995
+ return this.foundation.isDisabled();
1996
+ },
1997
+ /**
1998
+ * @param disabled Sets the Text Field disabled or enabled.
1999
+ */
2000
+ set: function (disabled) {
2001
+ this.foundation.setDisabled(disabled);
2002
+ },
2003
+ enumerable: false,
2004
+ configurable: true
2005
+ });
2006
+ Object.defineProperty(MDCTextField.prototype, "valid", {
2007
+ get: function () {
2008
+ return this.foundation.isValid();
2009
+ },
2010
+ /**
2011
+ * @param valid Sets the Text Field valid or invalid.
2012
+ */
2013
+ set: function (valid) {
2014
+ this.foundation.setValid(valid);
2015
+ },
2016
+ enumerable: false,
2017
+ configurable: true
2018
+ });
2019
+ Object.defineProperty(MDCTextField.prototype, "required", {
2020
+ get: function () {
2021
+ return this.input.required;
2022
+ },
2023
+ /**
2024
+ * @param required Sets the Text Field to required.
2025
+ */
2026
+ set: function (required) {
2027
+ this.input.required = required;
2028
+ },
2029
+ enumerable: false,
2030
+ configurable: true
2031
+ });
2032
+ Object.defineProperty(MDCTextField.prototype, "pattern", {
2033
+ get: function () {
2034
+ return this.input.pattern;
2035
+ },
2036
+ /**
2037
+ * @param pattern Sets the input element's validation pattern.
2038
+ */
2039
+ set: function (pattern) {
2040
+ this.input.pattern = pattern;
2041
+ },
2042
+ enumerable: false,
2043
+ configurable: true
2044
+ });
2045
+ Object.defineProperty(MDCTextField.prototype, "minLength", {
2046
+ get: function () {
2047
+ return this.input.minLength;
2048
+ },
2049
+ /**
2050
+ * @param minLength Sets the input element's minLength.
2051
+ */
2052
+ set: function (minLength) {
2053
+ this.input.minLength = minLength;
2054
+ },
2055
+ enumerable: false,
2056
+ configurable: true
2057
+ });
2058
+ Object.defineProperty(MDCTextField.prototype, "maxLength", {
2059
+ get: function () {
2060
+ return this.input.maxLength;
2061
+ },
2062
+ /**
2063
+ * @param maxLength Sets the input element's maxLength.
2064
+ */
2065
+ set: function (maxLength) {
2066
+ // Chrome throws exception if maxLength is set to a value less than zero
2067
+ if (maxLength < 0) {
2068
+ this.input.removeAttribute('maxLength');
2069
+ }
2070
+ else {
2071
+ this.input.maxLength = maxLength;
2072
+ }
2073
+ },
2074
+ enumerable: false,
2075
+ configurable: true
2076
+ });
2077
+ Object.defineProperty(MDCTextField.prototype, "min", {
2078
+ get: function () {
2079
+ return this.input.min;
2080
+ },
2081
+ /**
2082
+ * @param min Sets the input element's min.
2083
+ */
2084
+ set: function (min) {
2085
+ this.input.min = min;
2086
+ },
2087
+ enumerable: false,
2088
+ configurable: true
2089
+ });
2090
+ Object.defineProperty(MDCTextField.prototype, "max", {
2091
+ get: function () {
2092
+ return this.input.max;
2093
+ },
2094
+ /**
2095
+ * @param max Sets the input element's max.
2096
+ */
2097
+ set: function (max) {
2098
+ this.input.max = max;
2099
+ },
2100
+ enumerable: false,
2101
+ configurable: true
2102
+ });
2103
+ Object.defineProperty(MDCTextField.prototype, "step", {
2104
+ get: function () {
2105
+ return this.input.step;
2106
+ },
2107
+ /**
2108
+ * @param step Sets the input element's step.
2109
+ */
2110
+ set: function (step) {
2111
+ this.input.step = step;
2112
+ },
2113
+ enumerable: false,
2114
+ configurable: true
2115
+ });
2116
+ Object.defineProperty(MDCTextField.prototype, "helperTextContent", {
2117
+ /**
2118
+ * Sets the helper text element content.
2119
+ */
2120
+ set: function (content) {
2121
+ this.foundation.setHelperTextContent(content);
2122
+ },
2123
+ enumerable: false,
2124
+ configurable: true
2125
+ });
2126
+ Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", {
2127
+ /**
2128
+ * Sets the aria label of the leading icon.
2129
+ */
2130
+ set: function (label) {
2131
+ this.foundation.setLeadingIconAriaLabel(label);
2132
+ },
2133
+ enumerable: false,
2134
+ configurable: true
2135
+ });
2136
+ Object.defineProperty(MDCTextField.prototype, "leadingIconContent", {
2137
+ /**
2138
+ * Sets the text content of the leading icon.
2139
+ */
2140
+ set: function (content) {
2141
+ this.foundation.setLeadingIconContent(content);
2142
+ },
2143
+ enumerable: false,
2144
+ configurable: true
2145
+ });
2146
+ Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", {
2147
+ /**
2148
+ * Sets the aria label of the trailing icon.
2149
+ */
2150
+ set: function (label) {
2151
+ this.foundation.setTrailingIconAriaLabel(label);
2152
+ },
2153
+ enumerable: false,
2154
+ configurable: true
2155
+ });
2156
+ Object.defineProperty(MDCTextField.prototype, "trailingIconContent", {
2157
+ /**
2158
+ * Sets the text content of the trailing icon.
2159
+ */
2160
+ set: function (content) {
2161
+ this.foundation.setTrailingIconContent(content);
2162
+ },
2163
+ enumerable: false,
2164
+ configurable: true
2165
+ });
2166
+ Object.defineProperty(MDCTextField.prototype, "useNativeValidation", {
2167
+ /**
2168
+ * Enables or disables the use of native validation. Use this for custom validation.
2169
+ * @param useNativeValidation Set this to false to ignore native input validation.
2170
+ */
2171
+ set: function (useNativeValidation) {
2172
+ this.foundation.setUseNativeValidation(useNativeValidation);
2173
+ },
2174
+ enumerable: false,
2175
+ configurable: true
2176
+ });
2177
+ Object.defineProperty(MDCTextField.prototype, "prefixText", {
2178
+ /**
2179
+ * Gets the text content of the prefix, or null if it does not exist.
2180
+ */
2181
+ get: function () {
2182
+ return this.prefix ? this.prefix.textContent : null;
2183
+ },
2184
+ /**
2185
+ * Sets the text content of the prefix, if it exists.
2186
+ */
2187
+ set: function (prefixText) {
2188
+ if (this.prefix) {
2189
+ this.prefix.textContent = prefixText;
2190
+ }
2191
+ },
2192
+ enumerable: false,
2193
+ configurable: true
2194
+ });
2195
+ Object.defineProperty(MDCTextField.prototype, "suffixText", {
2196
+ /**
2197
+ * Gets the text content of the suffix, or null if it does not exist.
2198
+ */
2199
+ get: function () {
2200
+ return this.suffix ? this.suffix.textContent : null;
2201
+ },
2202
+ /**
2203
+ * Sets the text content of the suffix, if it exists.
2204
+ */
2205
+ set: function (suffixText) {
2206
+ if (this.suffix) {
2207
+ this.suffix.textContent = suffixText;
2208
+ }
2209
+ },
2210
+ enumerable: false,
2211
+ configurable: true
2212
+ });
2213
+ /**
2214
+ * Focuses the input element.
2215
+ */
2216
+ MDCTextField.prototype.focus = function () {
2217
+ this.input.focus();
2218
+ };
2219
+ /**
2220
+ * Recomputes the outline SVG path for the outline element.
2221
+ */
2222
+ MDCTextField.prototype.layout = function () {
2223
+ var openNotch = this.foundation.shouldFloat;
2224
+ this.foundation.notchOutline(openNotch);
2225
+ };
2226
+ MDCTextField.prototype.getDefaultFoundation = function () {
2227
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
2228
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
2229
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
2230
+ var adapter = __assign(__assign(__assign(__assign(__assign({}, this.getRootAdapterMethods()), this.getInputAdapterMethods()), this.getLabelAdapterMethods()), this.getLineRippleAdapterMethods()), this.getOutlineAdapterMethods());
2231
+ // tslint:enable:object-literal-sort-keys
2232
+ return new MDCTextFieldFoundation(adapter, this.getFoundationMap());
2233
+ };
2234
+ MDCTextField.prototype.getRootAdapterMethods = function () {
2235
+ var _this = this;
2236
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
2237
+ return {
2238
+ addClass: function (className) { return _this.root.classList.add(className); },
2239
+ removeClass: function (className) { return _this.root.classList.remove(className); },
2240
+ hasClass: function (className) { return _this.root.classList.contains(className); },
2241
+ registerTextFieldInteractionHandler: function (evtType, handler) {
2242
+ _this.listen(evtType, handler);
2243
+ },
2244
+ deregisterTextFieldInteractionHandler: function (evtType, handler) {
2245
+ _this.unlisten(evtType, handler);
2246
+ },
2247
+ registerValidationAttributeChangeHandler: function (handler) {
2248
+ var getAttributesList = function (mutationsList) {
2249
+ return mutationsList
2250
+ .map(function (mutation) { return mutation.attributeName; })
2251
+ .filter(function (attributeName) { return attributeName; });
2252
+ };
2253
+ var observer = new MutationObserver(function (mutationsList) { return handler(getAttributesList(mutationsList)); });
2254
+ var config = { attributes: true };
2255
+ observer.observe(_this.input, config);
2256
+ return observer;
2257
+ },
2258
+ deregisterValidationAttributeChangeHandler: function (observer) {
2259
+ observer.disconnect();
2260
+ },
2261
+ };
2262
+ // tslint:enable:object-literal-sort-keys
2263
+ };
2264
+ MDCTextField.prototype.getInputAdapterMethods = function () {
2265
+ var _this = this;
2266
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
2267
+ return {
2268
+ getNativeInput: function () { return _this.input; },
2269
+ setInputAttr: function (attr, value) {
2270
+ _this.input.setAttribute(attr, value);
2271
+ },
2272
+ removeInputAttr: function (attr) {
2273
+ _this.input.removeAttribute(attr);
2274
+ },
2275
+ isFocused: function () { return document.activeElement === _this.input; },
2276
+ registerInputInteractionHandler: function (evtType, handler) {
2277
+ _this.input.addEventListener(evtType, handler, applyPassive());
2278
+ },
2279
+ deregisterInputInteractionHandler: function (evtType, handler) {
2280
+ _this.input.removeEventListener(evtType, handler, applyPassive());
2281
+ },
2282
+ };
2283
+ // tslint:enable:object-literal-sort-keys
2284
+ };
2285
+ MDCTextField.prototype.getLabelAdapterMethods = function () {
2286
+ var _this = this;
2287
+ return {
2288
+ floatLabel: function (shouldFloat) {
2289
+ _this.label && _this.label.float(shouldFloat);
2290
+ },
2291
+ getLabelWidth: function () { return _this.label ? _this.label.getWidth() : 0; },
2292
+ hasLabel: function () { return Boolean(_this.label); },
2293
+ shakeLabel: function (shouldShake) {
2294
+ _this.label && _this.label.shake(shouldShake);
2295
+ },
2296
+ setLabelRequired: function (isRequired) {
2297
+ _this.label && _this.label.setRequired(isRequired);
2298
+ },
2299
+ };
2300
+ };
2301
+ MDCTextField.prototype.getLineRippleAdapterMethods = function () {
2302
+ var _this = this;
2303
+ return {
2304
+ activateLineRipple: function () {
2305
+ if (_this.lineRipple) {
2306
+ _this.lineRipple.activate();
2307
+ }
2308
+ },
2309
+ deactivateLineRipple: function () {
2310
+ if (_this.lineRipple) {
2311
+ _this.lineRipple.deactivate();
2312
+ }
2313
+ },
2314
+ setLineRippleTransformOrigin: function (normalizedX) {
2315
+ if (_this.lineRipple) {
2316
+ _this.lineRipple.setRippleCenter(normalizedX);
2317
+ }
2318
+ },
2319
+ };
2320
+ };
2321
+ MDCTextField.prototype.getOutlineAdapterMethods = function () {
2322
+ var _this = this;
2323
+ return {
2324
+ closeOutline: function () {
2325
+ _this.outline && _this.outline.closeNotch();
2326
+ },
2327
+ hasOutline: function () { return Boolean(_this.outline); },
2328
+ notchOutline: function (labelWidth) {
2329
+ _this.outline && _this.outline.notch(labelWidth);
2330
+ },
2331
+ };
2332
+ };
2333
+ /**
2334
+ * @return A map of all subcomponents to subfoundations.
2335
+ */
2336
+ MDCTextField.prototype.getFoundationMap = function () {
2337
+ return {
2338
+ characterCounter: this.characterCounter ?
2339
+ this.characterCounter.foundationForTextField :
2340
+ undefined,
2341
+ helperText: this.helperText ? this.helperText.foundationForTextField :
2342
+ undefined,
2343
+ leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForTextField :
2344
+ undefined,
2345
+ trailingIcon: this.trailingIcon ?
2346
+ this.trailingIcon.foundationForTextField :
2347
+ undefined,
2348
+ };
2349
+ };
2350
+ MDCTextField.prototype.createRipple = function (rippleFactory) {
2351
+ var _this = this;
2352
+ var isTextArea = this.root.classList.contains(cssClasses$3.TEXTAREA);
2353
+ var isOutlined = this.root.classList.contains(cssClasses$3.OUTLINED);
2354
+ if (isTextArea || isOutlined) {
2355
+ return null;
2356
+ }
2357
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
2358
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
2359
+ // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
2360
+ var adapter = __assign(__assign({}, MDCRipple.createAdapter(this)), { isSurfaceActive: function () { return matches(_this.input, ':active'); }, registerInteractionHandler: function (evtType, handler) {
2361
+ _this.input.addEventListener(evtType, handler, applyPassive());
2362
+ }, deregisterInteractionHandler: function (evtType, handler) {
2363
+ _this.input.removeEventListener(evtType, handler, applyPassive());
2364
+ } });
2365
+ // tslint:enable:object-literal-sort-keys
2366
+ return rippleFactory(this.root, new MDCRippleFoundation(adapter));
2367
+ };
2368
+ return MDCTextField;
2369
+ }(MDCComponent));
2370
+
2371
+ /**
2372
+ * @license
2373
+ * Copyright 2017 Google Inc.
2374
+ *
2375
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
2376
+ * of this software and associated documentation files (the "Software"), to deal
2377
+ * in the Software without restriction, including without limitation the rights
2378
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2379
+ * copies of the Software, and to permit persons to whom the Software is
2380
+ * furnished to do so, subject to the following conditions:
2381
+ *
2382
+ * The above copyright notice and this permission notice shall be included in
2383
+ * all copies or substantial portions of the Software.
2384
+ *
2385
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2386
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2387
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2388
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2389
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2390
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2391
+ * THE SOFTWARE.
2392
+ */
2393
+ var cssClasses = {
2394
+ ROOT: 'mdc-form-field',
2395
+ };
2396
+ var strings = {
2397
+ LABEL_SELECTOR: '.mdc-form-field > label',
2398
+ };
2399
+
2400
+ /**
2401
+ * @license
2402
+ * Copyright 2017 Google Inc.
2403
+ *
2404
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
2405
+ * of this software and associated documentation files (the "Software"), to deal
2406
+ * in the Software without restriction, including without limitation the rights
2407
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2408
+ * copies of the Software, and to permit persons to whom the Software is
2409
+ * furnished to do so, subject to the following conditions:
2410
+ *
2411
+ * The above copyright notice and this permission notice shall be included in
2412
+ * all copies or substantial portions of the Software.
2413
+ *
2414
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2415
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2416
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2417
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2418
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2419
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2420
+ * THE SOFTWARE.
2421
+ */
2422
+ var MDCFormFieldFoundation = /** @class */ (function (_super) {
2423
+ __extends(MDCFormFieldFoundation, _super);
2424
+ function MDCFormFieldFoundation(adapter) {
2425
+ var _this = _super.call(this, __assign(__assign({}, MDCFormFieldFoundation.defaultAdapter), adapter)) || this;
2426
+ _this.click = function () {
2427
+ _this.handleClick();
2428
+ };
2429
+ return _this;
2430
+ }
2431
+ Object.defineProperty(MDCFormFieldFoundation, "cssClasses", {
2432
+ get: function () {
2433
+ return cssClasses;
2434
+ },
2435
+ enumerable: false,
2436
+ configurable: true
2437
+ });
2438
+ Object.defineProperty(MDCFormFieldFoundation, "strings", {
2439
+ get: function () {
2440
+ return strings;
2441
+ },
2442
+ enumerable: false,
2443
+ configurable: true
2444
+ });
2445
+ Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", {
2446
+ get: function () {
2447
+ return {
2448
+ activateInputRipple: function () { return undefined; },
2449
+ deactivateInputRipple: function () { return undefined; },
2450
+ deregisterInteractionHandler: function () { return undefined; },
2451
+ registerInteractionHandler: function () { return undefined; },
2452
+ };
2453
+ },
2454
+ enumerable: false,
2455
+ configurable: true
2456
+ });
2457
+ MDCFormFieldFoundation.prototype.init = function () {
2458
+ this.adapter.registerInteractionHandler('click', this.click);
2459
+ };
2460
+ MDCFormFieldFoundation.prototype.destroy = function () {
2461
+ this.adapter.deregisterInteractionHandler('click', this.click);
2462
+ };
2463
+ MDCFormFieldFoundation.prototype.handleClick = function () {
2464
+ var _this = this;
2465
+ this.adapter.activateInputRipple();
2466
+ requestAnimationFrame(function () {
2467
+ _this.adapter.deactivateInputRipple();
2468
+ });
2469
+ };
2470
+ return MDCFormFieldFoundation;
2471
+ }(MDCFoundation));
2472
+
2473
+ /**
2474
+ * @license
2475
+ * Copyright 2017 Google Inc.
2476
+ *
2477
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
2478
+ * of this software and associated documentation files (the "Software"), to deal
2479
+ * in the Software without restriction, including without limitation the rights
2480
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2481
+ * copies of the Software, and to permit persons to whom the Software is
2482
+ * furnished to do so, subject to the following conditions:
2483
+ *
2484
+ * The above copyright notice and this permission notice shall be included in
2485
+ * all copies or substantial portions of the Software.
2486
+ *
2487
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2488
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2489
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2490
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2491
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2492
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2493
+ * THE SOFTWARE.
2494
+ */
2495
+ var MDCFormField = /** @class */ (function (_super) {
2496
+ __extends(MDCFormField, _super);
2497
+ function MDCFormField() {
2498
+ return _super !== null && _super.apply(this, arguments) || this;
2499
+ }
2500
+ MDCFormField.attachTo = function (root) {
2501
+ return new MDCFormField(root);
2502
+ };
2503
+ MDCFormField.prototype.labelEl = function () {
2504
+ var LABEL_SELECTOR = MDCFormFieldFoundation.strings.LABEL_SELECTOR;
2505
+ return this.root.querySelector(LABEL_SELECTOR);
2506
+ };
2507
+ MDCFormField.prototype.getDefaultFoundation = function () {
2508
+ var _this = this;
2509
+ // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
2510
+ // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
2511
+ var adapter = {
2512
+ activateInputRipple: function () {
2513
+ if (_this.input && _this.input.ripple) {
2514
+ _this.input.ripple.activate();
2515
+ }
2516
+ },
2517
+ deactivateInputRipple: function () {
2518
+ if (_this.input && _this.input.ripple) {
2519
+ _this.input.ripple.deactivate();
2520
+ }
2521
+ },
2522
+ deregisterInteractionHandler: function (evtType, handler) {
2523
+ var labelEl = _this.labelEl();
2524
+ if (labelEl) {
2525
+ labelEl.removeEventListener(evtType, handler);
2526
+ }
2527
+ },
2528
+ registerInteractionHandler: function (evtType, handler) {
2529
+ var labelEl = _this.labelEl();
2530
+ if (labelEl) {
2531
+ labelEl.addEventListener(evtType, handler);
2532
+ }
2533
+ },
2534
+ };
2535
+ return new MDCFormFieldFoundation(adapter);
2536
+ };
2537
+ return MDCFormField;
2538
+ }(MDCComponent));
2539
+
2540
+ /**
2541
+ * Instantiates Material Design text field component.
2542
+ * @param el - Must be the f-component wrapper (.f-text-field)
2543
+ * @see https://material-components.github.io/material-components-web-catalog/#/component/text-field
2544
+ */
2545
+ function FTextFieldMDC(el) {
2546
+ const component = new MDCTextField(el.querySelector('.mdc-text-field'));
2547
+ const form = el.querySelector('.mdc-form-field');
2548
+ const helper = el.querySelector('.mdc-text-field-helper-text');
2549
+ const counter = el.querySelector('.mdc-text-field-character-counter');
2550
+ const icon = el.querySelector('.mdc-text-field-icon');
2551
+ if (form) {
2552
+ const formField = MDCFormField.attachTo(form);
2553
+ if (formField) {
2554
+ formField.input = component;
2555
+ }
2556
+ }
2557
+ if (helper) {
2558
+ new MDCTextFieldHelperText(helper);
2559
+ }
2560
+ if (counter) {
2561
+ new MDCTextFieldCharacterCounter(counter);
2562
+ }
2563
+ if (icon) {
2564
+ new MDCTextFieldIcon(icon);
2565
+ }
2566
+ }
2567
+
2568
+ export { FTextFieldMDC as F };