@material/web 1.0.0 → 1.0.2-nightly.6a1fb38.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 (370) hide show
  1. package/all.d.ts +2 -0
  2. package/all.js +2 -0
  3. package/all.js.map +1 -1
  4. package/button/elevated-button.js +5 -1
  5. package/button/elevated-button.js.map +1 -1
  6. package/button/internal/_elevation.scss +32 -32
  7. package/button/internal/_icon.scss +22 -23
  8. package/button/internal/_outlined-button.scss +21 -19
  9. package/button/internal/_shared.scss +84 -77
  10. package/button/internal/_touch-target.scss +4 -0
  11. package/button/internal/button.d.ts +7 -11
  12. package/button/internal/button.js +52 -38
  13. package/button/internal/button.js.map +1 -1
  14. package/button/internal/elevated-button.d.ts +1 -1
  15. package/button/internal/elevated-button.js +1 -1
  16. package/button/internal/elevated-button.js.map +1 -1
  17. package/button/internal/filled-button.d.ts +1 -1
  18. package/button/internal/filled-button.js +1 -1
  19. package/button/internal/filled-button.js.map +1 -1
  20. package/button/internal/filled-tonal-button.d.ts +1 -1
  21. package/button/internal/filled-tonal-button.js +1 -1
  22. package/button/internal/filled-tonal-button.js.map +1 -1
  23. package/button/internal/outlined-button.d.ts +1 -1
  24. package/button/internal/outlined-button.js +2 -2
  25. package/button/internal/outlined-button.js.map +1 -1
  26. package/button/internal/outlined-styles.css.js +1 -1
  27. package/button/internal/outlined-styles.css.js.map +1 -1
  28. package/button/internal/shared-elevation-styles.css.js +1 -1
  29. package/button/internal/shared-elevation-styles.css.js.map +1 -1
  30. package/button/internal/shared-styles.css.js +1 -1
  31. package/button/internal/shared-styles.css.js.map +1 -1
  32. package/checkbox/internal/_checkbox.scss +6 -0
  33. package/checkbox/internal/checkbox-styles.css.js +1 -1
  34. package/checkbox/internal/checkbox-styles.css.js.map +1 -1
  35. package/checkbox/internal/checkbox.d.ts +16 -23
  36. package/checkbox/internal/checkbox.js +38 -52
  37. package/checkbox/internal/checkbox.js.map +1 -1
  38. package/chips/filter-chip.js +5 -1
  39. package/chips/filter-chip.js.map +1 -1
  40. package/chips/harness.js.map +1 -1
  41. package/chips/input-chip.js +6 -1
  42. package/chips/input-chip.js.map +1 -1
  43. package/chips/internal/assist-chip.js +8 -4
  44. package/chips/internal/assist-chip.js.map +1 -1
  45. package/chips/internal/chip-set.js +6 -4
  46. package/chips/internal/chip-set.js.map +1 -1
  47. package/chips/internal/chip.d.ts +3 -0
  48. package/chips/internal/chip.js +7 -5
  49. package/chips/internal/chip.js.map +1 -1
  50. package/chips/internal/filter-chip.d.ts +2 -0
  51. package/chips/internal/filter-chip.js +11 -5
  52. package/chips/internal/filter-chip.js.map +1 -1
  53. package/chips/internal/input-chip.d.ts +2 -0
  54. package/chips/internal/input-chip.js +10 -4
  55. package/chips/internal/input-chip.js.map +1 -1
  56. package/chips/internal/multi-action-chip.js.map +1 -1
  57. package/chips/internal/trailing-icons.d.ts +1 -1
  58. package/chips/internal/trailing-icons.js +6 -5
  59. package/chips/internal/trailing-icons.js.map +1 -1
  60. package/common.d.ts +2 -0
  61. package/common.js +2 -0
  62. package/common.js.map +1 -1
  63. package/dialog/harness.js +1 -2
  64. package/dialog/harness.js.map +1 -1
  65. package/dialog/internal/_dialog.scss +1 -1
  66. package/dialog/internal/animations.js +14 -12
  67. package/dialog/internal/animations.js.map +1 -1
  68. package/dialog/internal/dialog-styles.css.js +1 -1
  69. package/dialog/internal/dialog-styles.css.js.map +1 -1
  70. package/dialog/internal/dialog.d.ts +6 -6
  71. package/dialog/internal/dialog.js +24 -24
  72. package/dialog/internal/dialog.js.map +1 -1
  73. package/fab/harness.js.map +1 -1
  74. package/fab/internal/_fab.scss +4 -0
  75. package/fab/internal/fab-styles.css.js +1 -1
  76. package/fab/internal/fab-styles.css.js.map +1 -1
  77. package/fab/internal/fab.js.map +1 -1
  78. package/fab/internal/shared.js +10 -11
  79. package/fab/internal/shared.js.map +1 -1
  80. package/field/harness.js.map +1 -1
  81. package/field/internal/_content.scss +185 -174
  82. package/field/internal/_filled-field.scss +147 -135
  83. package/field/internal/_label.scss +83 -72
  84. package/field/internal/_outlined-field.scss +276 -261
  85. package/field/internal/_supporting-text.scss +53 -42
  86. package/field/internal/field.js +26 -22
  87. package/field/internal/field.js.map +1 -1
  88. package/field/internal/filled-styles.css.js +1 -1
  89. package/field/internal/filled-styles.css.js.map +1 -1
  90. package/field/internal/outlined-styles.css.js +1 -1
  91. package/field/internal/outlined-styles.css.js.map +1 -1
  92. package/field/internal/shared-styles.css.js +1 -1
  93. package/field/internal/shared-styles.css.js.map +1 -1
  94. package/focus/internal/focus-ring.d.ts +2 -0
  95. package/focus/internal/focus-ring.js +3 -3
  96. package/focus/internal/focus-ring.js.map +1 -1
  97. package/icon/internal/_icon.scss +7 -4
  98. package/icon/internal/icon-styles.css.js +1 -1
  99. package/icon/internal/icon-styles.css.js.map +1 -1
  100. package/iconbutton/internal/icon-button.d.ts +9 -4
  101. package/iconbutton/internal/icon-button.js +35 -22
  102. package/iconbutton/internal/icon-button.js.map +1 -1
  103. package/internal/aria/aria.d.ts +4 -26
  104. package/internal/aria/aria.js +10 -28
  105. package/internal/aria/aria.js.map +1 -1
  106. package/internal/aria/delegate.js +2 -2
  107. package/internal/aria/delegate.js.map +1 -1
  108. package/internal/controller/attachable-controller.js +3 -5
  109. package/internal/controller/attachable-controller.js.map +1 -1
  110. package/internal/controller/form-submitter.d.ts +3 -5
  111. package/internal/controller/form-submitter.js +5 -7
  112. package/internal/controller/form-submitter.js.map +1 -1
  113. package/internal/controller/is-rtl.js +2 -2
  114. package/internal/controller/is-rtl.js.map +1 -1
  115. package/internal/controller/string-converter.js +1 -1
  116. package/internal/controller/string-converter.js.map +1 -1
  117. package/internal/motion/animation.js.map +1 -1
  118. package/labs/behaviors/element-internals.d.ts +45 -0
  119. package/labs/behaviors/element-internals.js +50 -0
  120. package/labs/behaviors/element-internals.js.map +1 -0
  121. package/labs/behaviors/focusable.d.ts +39 -0
  122. package/labs/behaviors/focusable.js +82 -0
  123. package/labs/behaviors/focusable.js.map +1 -0
  124. package/labs/behaviors/form-associated.d.ts +199 -0
  125. package/labs/behaviors/form-associated.js +155 -0
  126. package/labs/behaviors/form-associated.js.map +1 -0
  127. package/labs/behaviors/mixin.d.ts +54 -0
  128. package/labs/behaviors/mixin.js +7 -0
  129. package/labs/behaviors/mixin.js.map +1 -0
  130. package/labs/card/_elevated-card.scss +6 -0
  131. package/labs/card/_filled-card.scss +6 -0
  132. package/labs/card/_outlined-card.scss +6 -0
  133. package/labs/card/elevated-card.d.ts +18 -0
  134. package/labs/card/elevated-card.js +21 -0
  135. package/labs/card/elevated-card.js.map +1 -0
  136. package/labs/card/filled-card.d.ts +18 -0
  137. package/labs/card/filled-card.js +21 -0
  138. package/labs/card/filled-card.js.map +1 -0
  139. package/labs/card/internal/_elevated-card.scss +35 -0
  140. package/labs/card/internal/_filled-card.scss +35 -0
  141. package/labs/card/internal/_outlined-card.scss +39 -0
  142. package/labs/card/internal/_shared.scss +40 -0
  143. package/labs/card/internal/card.d.ts +13 -0
  144. package/labs/card/internal/card.js +20 -0
  145. package/labs/card/internal/card.js.map +1 -0
  146. package/labs/card/internal/elevated-styles.css.js +9 -0
  147. package/labs/card/internal/elevated-styles.css.js.map +1 -0
  148. package/labs/card/internal/elevated-styles.scss +10 -0
  149. package/labs/card/internal/filled-styles.css.js +9 -0
  150. package/labs/card/internal/filled-styles.css.js.map +1 -0
  151. package/labs/card/internal/filled-styles.scss +10 -0
  152. package/labs/card/internal/outlined-styles.css.js +9 -0
  153. package/labs/card/internal/outlined-styles.css.js.map +1 -0
  154. package/labs/card/internal/outlined-styles.scss +10 -0
  155. package/labs/card/internal/shared-styles.css.js +9 -0
  156. package/labs/card/internal/shared-styles.css.js.map +1 -0
  157. package/labs/card/internal/shared-styles.scss +10 -0
  158. package/labs/card/outlined-card.d.ts +18 -0
  159. package/labs/card/outlined-card.js +21 -0
  160. package/labs/card/outlined-card.js.map +1 -0
  161. package/labs/item/internal/_item.scss +1 -1
  162. package/labs/item/internal/item-styles.css.js +1 -1
  163. package/labs/item/internal/item-styles.css.js.map +1 -1
  164. package/labs/item/internal/item.js +8 -8
  165. package/labs/item/internal/item.js.map +1 -1
  166. package/labs/navigationbar/internal/constants.js.map +1 -1
  167. package/labs/navigationbar/internal/navigation-bar.d.ts +3 -0
  168. package/labs/navigationbar/internal/navigation-bar.js +18 -11
  169. package/labs/navigationbar/internal/navigation-bar.js.map +1 -1
  170. package/labs/navigationdrawer/internal/navigation-drawer-modal.d.ts +3 -0
  171. package/labs/navigationdrawer/internal/navigation-drawer-modal.js +10 -3
  172. package/labs/navigationdrawer/internal/navigation-drawer-modal.js.map +1 -1
  173. package/labs/navigationdrawer/internal/navigation-drawer.d.ts +3 -0
  174. package/labs/navigationdrawer/internal/navigation-drawer.js +8 -1
  175. package/labs/navigationdrawer/internal/navigation-drawer.js.map +1 -1
  176. package/labs/navigationtab/harness.js.map +1 -1
  177. package/labs/navigationtab/internal/navigation-tab.d.ts +6 -0
  178. package/labs/navigationtab/internal/navigation-tab.js +43 -27
  179. package/labs/navigationtab/internal/navigation-tab.js.map +1 -1
  180. package/labs/navigationtab/internal/state.js.map +1 -1
  181. package/labs/segmentedbutton/internal/segmented-button.d.ts +3 -0
  182. package/labs/segmentedbutton/internal/segmented-button.js +26 -12
  183. package/labs/segmentedbutton/internal/segmented-button.js.map +1 -1
  184. package/labs/segmentedbuttonset/internal/segmented-button-set.d.ts +5 -0
  185. package/labs/segmentedbuttonset/internal/segmented-button-set.js +14 -9
  186. package/labs/segmentedbuttonset/internal/segmented-button-set.js.map +1 -1
  187. package/list/harness.d.ts +3 -2
  188. package/list/harness.js.map +1 -1
  189. package/list/internal/list-controller.d.ts +1 -1
  190. package/list/internal/list-controller.js +7 -3
  191. package/list/internal/list-controller.js.map +1 -1
  192. package/list/internal/list-navigation-helpers.js.map +1 -1
  193. package/list/internal/list.d.ts +2 -2
  194. package/list/internal/list.js +8 -6
  195. package/list/internal/list.js.map +1 -1
  196. package/list/internal/listitem/_list-item.scss +18 -0
  197. package/list/internal/listitem/harness.d.ts +3 -3
  198. package/list/internal/listitem/harness.js.map +1 -1
  199. package/list/internal/listitem/list-item-styles.css.js +1 -1
  200. package/list/internal/listitem/list-item-styles.css.js.map +1 -1
  201. package/list/internal/listitem/list-item.d.ts +3 -2
  202. package/list/internal/listitem/list-item.js +20 -21
  203. package/list/internal/listitem/list-item.js.map +1 -1
  204. package/list/list-item.d.ts +4 -12
  205. package/list/list-item.js +5 -14
  206. package/list/list-item.js.map +1 -1
  207. package/menu/harness.js.map +1 -1
  208. package/menu/internal/_menu.scss +20 -1
  209. package/menu/internal/controllers/menuItemController.d.ts +7 -0
  210. package/menu/internal/controllers/menuItemController.js +17 -4
  211. package/menu/internal/controllers/menuItemController.js.map +1 -1
  212. package/menu/internal/controllers/shared.d.ts +9 -1
  213. package/menu/internal/controllers/shared.js +4 -4
  214. package/menu/internal/controllers/shared.js.map +1 -1
  215. package/menu/internal/controllers/surfacePositionController.d.ts +15 -2
  216. package/menu/internal/controllers/surfacePositionController.js +134 -56
  217. package/menu/internal/controllers/surfacePositionController.js.map +1 -1
  218. package/menu/internal/controllers/typeaheadController.js +19 -14
  219. package/menu/internal/controllers/typeaheadController.js.map +1 -1
  220. package/menu/internal/menu-styles.css.js +1 -1
  221. package/menu/internal/menu-styles.css.js.map +1 -1
  222. package/menu/internal/menu.d.ts +55 -17
  223. package/menu/internal/menu.js +175 -88
  224. package/menu/internal/menu.js.map +1 -1
  225. package/menu/internal/menuitem/_menu-item.scss +24 -0
  226. package/menu/internal/menuitem/harness.d.ts +3 -1
  227. package/menu/internal/menuitem/harness.js.map +1 -1
  228. package/menu/internal/menuitem/menu-item-styles.css.js +1 -1
  229. package/menu/internal/menuitem/menu-item-styles.css.js.map +1 -1
  230. package/menu/internal/menuitem/menu-item.d.ts +3 -2
  231. package/menu/internal/menuitem/menu-item.js +20 -20
  232. package/menu/internal/menuitem/menu-item.js.map +1 -1
  233. package/menu/internal/submenu/sub-menu.d.ts +9 -8
  234. package/menu/internal/submenu/sub-menu.js +35 -22
  235. package/menu/internal/submenu/sub-menu.js.map +1 -1
  236. package/menu/internal/types.js.map +1 -1
  237. package/menu/menu-item.js +1 -2
  238. package/menu/menu-item.js.map +1 -1
  239. package/menu/menu.js +1 -2
  240. package/menu/menu.js.map +1 -1
  241. package/package.json +1 -1
  242. package/progress/internal/_circular-progress.scss +2 -2
  243. package/progress/internal/_linear-progress.scss +1 -1
  244. package/progress/internal/circular-progress-styles.css.js +1 -1
  245. package/progress/internal/circular-progress-styles.css.js.map +1 -1
  246. package/progress/internal/circular-progress.js +11 -10
  247. package/progress/internal/circular-progress.js.map +1 -1
  248. package/progress/internal/linear-progress-styles.css.js +1 -1
  249. package/progress/internal/linear-progress-styles.css.js.map +1 -1
  250. package/progress/internal/linear-progress.d.ts +1 -1
  251. package/progress/internal/linear-progress.js +3 -3
  252. package/progress/internal/linear-progress.js.map +1 -1
  253. package/progress/internal/progress.js +4 -2
  254. package/progress/internal/progress.js.map +1 -1
  255. package/radio/internal/_radio.scss +144 -123
  256. package/radio/internal/radio-styles.css.js +1 -1
  257. package/radio/internal/radio-styles.css.js.map +1 -1
  258. package/radio/internal/radio.d.ts +12 -23
  259. package/radio/internal/radio.js +31 -50
  260. package/radio/internal/radio.js.map +1 -1
  261. package/radio/internal/single-selection-controller.js +1 -1
  262. package/radio/internal/single-selection-controller.js.map +1 -1
  263. package/radio/radio.js +1 -2
  264. package/radio/radio.js.map +1 -1
  265. package/ripple/internal/ripple.js +21 -18
  266. package/ripple/internal/ripple.js.map +1 -1
  267. package/select/filled-select.js +1 -2
  268. package/select/filled-select.js.map +1 -1
  269. package/select/harness.js +1 -1
  270. package/select/harness.js.map +1 -1
  271. package/select/internal/_shared.scss +4 -0
  272. package/select/internal/select.d.ts +25 -34
  273. package/select/internal/select.js +101 -91
  274. package/select/internal/select.js.map +1 -1
  275. package/select/internal/selectoption/select-option.d.ts +8 -6
  276. package/select/internal/selectoption/select-option.js +25 -23
  277. package/select/internal/selectoption/select-option.js.map +1 -1
  278. package/select/internal/selectoption/selectOptionController.js +1 -1
  279. package/select/internal/selectoption/selectOptionController.js.map +1 -1
  280. package/select/internal/shared-styles.css.js +1 -1
  281. package/select/internal/shared-styles.css.js.map +1 -1
  282. package/select/outlined-select.js +1 -2
  283. package/select/outlined-select.js.map +1 -1
  284. package/select/select-option.js +1 -2
  285. package/select/select-option.js.map +1 -1
  286. package/slider/harness.js +5 -5
  287. package/slider/harness.js.map +1 -1
  288. package/slider/internal/_slider.scss +68 -30
  289. package/slider/internal/slider-styles.css.js +1 -1
  290. package/slider/internal/slider-styles.css.js.map +1 -1
  291. package/slider/internal/slider.d.ts +16 -25
  292. package/slider/internal/slider.js +111 -115
  293. package/slider/internal/slider.js.map +1 -1
  294. package/switch/internal/_handle.scss +159 -141
  295. package/switch/internal/_icon.scss +95 -72
  296. package/switch/internal/_switch.scss +90 -95
  297. package/switch/internal/_track.scss +110 -77
  298. package/switch/internal/switch-styles.css.js +1 -1
  299. package/switch/internal/switch-styles.css.js.map +1 -1
  300. package/switch/internal/switch.d.ts +9 -25
  301. package/switch/internal/switch.js +31 -57
  302. package/switch/internal/switch.js.map +1 -1
  303. package/switch/switch.js +1 -2
  304. package/switch/switch.js.map +1 -1
  305. package/tabs/harness.js +3 -3
  306. package/tabs/harness.js.map +1 -1
  307. package/tabs/internal/_tab.scss +27 -35
  308. package/tabs/internal/primary-tab.d.ts +0 -2
  309. package/tabs/internal/tab-styles.css.js +1 -1
  310. package/tabs/internal/tab-styles.css.js.map +1 -1
  311. package/tabs/internal/tab.d.ts +10 -5
  312. package/tabs/internal/tab.js +43 -22
  313. package/tabs/internal/tab.js.map +1 -1
  314. package/tabs/internal/tabs.d.ts +7 -4
  315. package/tabs/internal/tabs.js +23 -22
  316. package/tabs/internal/tabs.js.map +1 -1
  317. package/textfield/filled-text-field.js +1 -2
  318. package/textfield/filled-text-field.js.map +1 -1
  319. package/textfield/harness.js +3 -2
  320. package/textfield/harness.js.map +1 -1
  321. package/textfield/internal/text-field.d.ts +33 -18
  322. package/textfield/internal/text-field.js +96 -58
  323. package/textfield/internal/text-field.js.map +1 -1
  324. package/textfield/outlined-text-field.js +1 -2
  325. package/textfield/outlined-text-field.js.map +1 -1
  326. package/tokens/_index.scss +3 -0
  327. package/tokens/_md-comp-elevated-card.scss +63 -0
  328. package/tokens/_md-comp-filled-card.scss +63 -0
  329. package/tokens/_md-comp-icon.scss +2 -0
  330. package/tokens/_md-comp-outlined-card.scss +69 -0
  331. package/tokens/_md-comp-test-table.scss +1 -0
  332. package/internal/controller/element-internals.d.ts +0 -35
  333. package/internal/controller/element-internals.js +0 -24
  334. package/internal/controller/element-internals.js.map +0 -1
  335. package/list/internal/listitem/forced-colors-styles.css.js +0 -9
  336. package/list/internal/listitem/forced-colors-styles.css.js.map +0 -1
  337. package/list/internal/listitem/forced-colors-styles.scss +0 -19
  338. package/menu/internal/forced-colors-styles.css.js +0 -9
  339. package/menu/internal/forced-colors-styles.css.js.map +0 -1
  340. package/menu/internal/forced-colors-styles.scss +0 -12
  341. package/menu/internal/menuitem/forced-colors-styles.css.js +0 -9
  342. package/menu/internal/menuitem/forced-colors-styles.css.js.map +0 -1
  343. package/menu/internal/menuitem/forced-colors-styles.scss +0 -26
  344. package/radio/internal/forced-colors-styles.css.js +0 -9
  345. package/radio/internal/forced-colors-styles.css.js.map +0 -1
  346. package/radio/internal/forced-colors-styles.scss +0 -29
  347. package/select/internal/filled-forced-colors-styles.css.d.ts +0 -1
  348. package/select/internal/filled-forced-colors-styles.css.js +0 -9
  349. package/select/internal/filled-forced-colors-styles.css.js.map +0 -1
  350. package/select/internal/filled-forced-colors-styles.scss +0 -29
  351. package/select/internal/outlined-forced-colors-styles.css.d.ts +0 -1
  352. package/select/internal/outlined-forced-colors-styles.css.js +0 -9
  353. package/select/internal/outlined-forced-colors-styles.css.js.map +0 -1
  354. package/select/internal/outlined-forced-colors-styles.scss +0 -29
  355. package/switch/internal/forced-colors-styles.css.d.ts +0 -1
  356. package/switch/internal/forced-colors-styles.css.js +0 -9
  357. package/switch/internal/forced-colors-styles.css.js.map +0 -1
  358. package/switch/internal/forced-colors-styles.scss +0 -42
  359. package/textfield/internal/filled-forced-colors-styles.css.d.ts +0 -1
  360. package/textfield/internal/filled-forced-colors-styles.css.js +0 -9
  361. package/textfield/internal/filled-forced-colors-styles.css.js.map +0 -1
  362. package/textfield/internal/filled-forced-colors-styles.scss +0 -29
  363. package/textfield/internal/outlined-forced-colors-styles.css.d.ts +0 -1
  364. package/textfield/internal/outlined-forced-colors-styles.css.js +0 -9
  365. package/textfield/internal/outlined-forced-colors-styles.css.js.map +0 -1
  366. package/textfield/internal/outlined-forced-colors-styles.scss +0 -29
  367. /package/{list/internal/listitem/forced-colors-styles.css.d.ts → labs/card/internal/elevated-styles.css.d.ts} +0 -0
  368. /package/{menu/internal/forced-colors-styles.css.d.ts → labs/card/internal/filled-styles.css.d.ts} +0 -0
  369. /package/{menu/internal/menuitem/forced-colors-styles.css.d.ts → labs/card/internal/outlined-styles.css.d.ts} +0 -0
  370. /package/{radio/internal/forced-colors-styles.css.d.ts → labs/card/internal/shared-styles.css.d.ts} +0 -0
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { LitElement, PropertyValues } from 'lit';
7
7
  import { StaticValue } from 'lit/static-html.js';
8
+ import { getFormValue } from '../../labs/behaviors/form-associated.js';
8
9
  /**
9
10
  * Input types that are compatible with the text field.
10
11
  */
@@ -17,15 +18,23 @@ export type UnsupportedTextFieldType = 'color' | 'date' | 'datetime-local' | 'fi
17
18
  * Input types that are incompatible with the text field.
18
19
  */
19
20
  export type InvalidTextFieldType = 'button' | 'checkbox' | 'hidden' | 'image' | 'radio' | 'range' | 'reset' | 'submit';
21
+ declare const textFieldBaseClass: import("../../labs/behaviors/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("../../labs/behaviors/element-internals.js").WithElementInternals) & typeof LitElement & import("../../labs/behaviors/form-associated.js").FormAssociatedConstructor, import("../../labs/behaviors/form-associated.js").FormAssociated>;
20
22
  /**
21
23
  * A text field component.
24
+ *
25
+ * @fires select {Event} The native `select` event on
26
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event)
27
+ * --bubbles
28
+ * @fires change {Event} The native `change` event on
29
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)
30
+ * --bubbles
31
+ * @fires input {InputEvent} The native `input` event on
32
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)
33
+ * --bubbles --composed
22
34
  */
23
- export declare abstract class TextField extends LitElement {
35
+ export declare abstract class TextField extends textFieldBaseClass {
24
36
  /** @nocollapse */
25
37
  static shadowRootOptions: ShadowRootInit;
26
- /** @nocollapse */
27
- static readonly formAssociated = true;
28
- disabled: boolean;
29
38
  /**
30
39
  * Gets or sets whether or not the text field is in a visually invalid state.
31
40
  *
@@ -80,18 +89,10 @@ export declare abstract class TextField extends LitElement {
80
89
  */
81
90
  rows: number;
82
91
  /**
83
- * The associated form element with which this element's value will submit.
84
- */
85
- get form(): HTMLFormElement;
86
- /**
87
- * The labels this element is associated with.
88
- */
89
- get labels(): NodeList;
90
- /**
91
- * The HTML name to use in form submission.
92
+ * The number of cols to display for a `type="textarea"` text field.
93
+ * Defaults to 20.
92
94
  */
93
- get name(): string;
94
- set name(name: string);
95
+ cols: number;
95
96
  inputMode: string;
96
97
  /**
97
98
  * Defines the greatest value in the range of permitted values.
@@ -134,6 +135,12 @@ export declare abstract class TextField extends LitElement {
134
135
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
135
136
  */
136
137
  readOnly: boolean;
138
+ /**
139
+ * Indicates that input accepts multiple email addresses.
140
+ *
141
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple
142
+ */
143
+ multiple: boolean;
137
144
  /**
138
145
  * Gets or sets the direction in which selection occurred.
139
146
  */
@@ -234,8 +241,9 @@ export declare abstract class TextField extends LitElement {
234
241
  private readonly field?;
235
242
  private readonly leadingIcons;
236
243
  private readonly trailingIcons;
244
+ private isCheckingValidity;
245
+ private isReportingValidity;
237
246
  private hasCustomValidityError;
238
- private readonly internals;
239
247
  /**
240
248
  * Checks the text field's native validation and returns whether or not the
241
249
  * element is valid.
@@ -266,6 +274,7 @@ export declare abstract class TextField extends LitElement {
266
274
  * @return true if the text field is valid, or false if not.
267
275
  */
268
276
  reportValidity(): boolean;
277
+ private showErrorMessage;
269
278
  /**
270
279
  * Selects all the text in the text field.
271
280
  *
@@ -343,8 +352,14 @@ export declare abstract class TextField extends LitElement {
343
352
  private getInput;
344
353
  private syncValidity;
345
354
  private handleIconChange;
346
- /** @private */
355
+ private readonly onInvalid;
356
+ connectedCallback(): void;
357
+ disconnectedCallback(): void;
358
+ disabled: boolean;
359
+ name: string;
360
+ [getFormValue](): string;
347
361
  formResetCallback(): void;
348
- /** @private */
349
362
  formStateRestoreCallback(state: string): void;
363
+ focus(): void;
350
364
  }
365
+ export {};
@@ -13,13 +13,26 @@ import { html as staticHtml } from 'lit/static-html.js';
13
13
  import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
14
14
  import { redispatchEvent } from '../../internal/controller/events.js';
15
15
  import { stringConverter } from '../../internal/controller/string-converter.js';
16
+ import { internals, mixinElementInternals, } from '../../labs/behaviors/element-internals.js';
17
+ import { getFormValue, mixinFormAssociated, } from '../../labs/behaviors/form-associated.js';
18
+ // Separate variable needed for closure.
19
+ const textFieldBaseClass = mixinFormAssociated(mixinElementInternals(LitElement));
16
20
  /**
17
21
  * A text field component.
22
+ *
23
+ * @fires select {Event} The native `select` event on
24
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event)
25
+ * --bubbles
26
+ * @fires change {Event} The native `change` event on
27
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)
28
+ * --bubbles
29
+ * @fires input {InputEvent} The native `input` event on
30
+ * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)
31
+ * --bubbles --composed
18
32
  */
19
- export class TextField extends LitElement {
33
+ export class TextField extends textFieldBaseClass {
20
34
  constructor() {
21
35
  super(...arguments);
22
- this.disabled = false;
23
36
  /**
24
37
  * Gets or sets whether or not the text field is in a visually invalid state.
25
38
  *
@@ -73,6 +86,11 @@ export class TextField extends LitElement {
73
86
  * Defaults to 2.
74
87
  */
75
88
  this.rows = 2;
89
+ /**
90
+ * The number of cols to display for a `type="textarea"` text field.
91
+ * Defaults to 20.
92
+ */
93
+ this.cols = 20;
76
94
  // <input> properties
77
95
  this.inputMode = '';
78
96
  /**
@@ -116,6 +134,12 @@ export class TextField extends LitElement {
116
134
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
117
135
  */
118
136
  this.readOnly = false;
137
+ /**
138
+ * Indicates that input accepts multiple email addresses.
139
+ *
140
+ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple
141
+ */
142
+ this.multiple = false;
119
143
  /**
120
144
  * Returns or sets the element's step attribute, which works with min and max
121
145
  * to limit the increments at which a numeric or date-time value can be set.
@@ -165,31 +189,17 @@ export class TextField extends LitElement {
165
189
  * `reportValidity()`.
166
190
  */
167
191
  this.nativeErrorText = '';
192
+ this.isCheckingValidity = false;
193
+ this.isReportingValidity = false;
168
194
  // Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432
169
- // Replace with this.internals.validity.customError when resolved.
195
+ // Replace with this[internals].validity.customError when resolved.
170
196
  this.hasCustomValidityError = false;
171
- this.internals = this /* needed for closure */.attachInternals();
172
- }
173
- /**
174
- * The associated form element with which this element's value will submit.
175
- */
176
- get form() {
177
- return this.internals.form;
178
- }
179
- /**
180
- * The labels this element is associated with.
181
- */
182
- get labels() {
183
- return this.internals.labels;
184
- }
185
- /**
186
- * The HTML name to use in form submission.
187
- */
188
- get name() {
189
- return this.getAttribute('name') ?? '';
190
- }
191
- set name(name) {
192
- this.setAttribute('name', name);
197
+ this.onInvalid = (invalidEvent) => {
198
+ if (this.isCheckingValidity || this.isReportingValidity) {
199
+ return;
200
+ }
201
+ this.showErrorMessage(false, invalidEvent);
202
+ };
193
203
  }
194
204
  /**
195
205
  * Gets or sets the direction in which selection occurred.
@@ -225,7 +235,7 @@ export class TextField extends LitElement {
225
235
  */
226
236
  get validationMessage() {
227
237
  this.syncValidity();
228
- return this.internals.validationMessage;
238
+ return this[internals].validationMessage;
229
239
  }
230
240
  /**
231
241
  * Returns a `ValidityState` object that represents the validity states of the
@@ -235,7 +245,7 @@ export class TextField extends LitElement {
235
245
  */
236
246
  get validity() {
237
247
  this.syncValidity();
238
- return this.internals.validity;
248
+ return this[internals].validity;
239
249
  }
240
250
  /**
241
251
  * The text field's value as a number.
@@ -281,7 +291,7 @@ export class TextField extends LitElement {
281
291
  */
282
292
  get willValidate() {
283
293
  this.syncValidity();
284
- return this.internals.willValidate;
294
+ return this[internals].willValidate;
285
295
  }
286
296
  get hasError() {
287
297
  return this.error || this.nativeError;
@@ -297,8 +307,11 @@ export class TextField extends LitElement {
297
307
  * @return true if the text field is valid, or false if not.
298
308
  */
299
309
  checkValidity() {
310
+ this.isCheckingValidity = true;
300
311
  this.syncValidity();
301
- return this.internals.checkValidity();
312
+ const isValid = this[internals].checkValidity();
313
+ this.isCheckingValidity = false;
314
+ return isValid;
302
315
  }
303
316
  /**
304
317
  * Checks the text field's native validation and returns whether or not the
@@ -319,11 +332,17 @@ export class TextField extends LitElement {
319
332
  * @return true if the text field is valid, or false if not.
320
333
  */
321
334
  reportValidity() {
335
+ this.isReportingValidity = true;
322
336
  let invalidEvent;
323
- this.addEventListener('invalid', event => {
337
+ this.addEventListener('invalid', (event) => {
324
338
  invalidEvent = event;
325
339
  }, { once: true });
326
340
  const valid = this.checkValidity();
341
+ this.showErrorMessage(valid, invalidEvent);
342
+ this.isReportingValidity = false;
343
+ return valid;
344
+ }
345
+ showErrorMessage(valid, invalidEvent) {
327
346
  if (invalidEvent?.defaultPrevented) {
328
347
  return valid;
329
348
  }
@@ -356,7 +375,7 @@ export class TextField extends LitElement {
356
375
  */
357
376
  setCustomValidity(error) {
358
377
  this.hasCustomValidityError = !!error;
359
- this.internals.setValidity({ customError: !!error }, error, this.getInputOrTextarea());
378
+ this[internals].setValidity({ customError: !!error }, error, this.getInputOrTextarea());
360
379
  }
361
380
  setRangeText(...args) {
362
381
  // Calling setRangeText with 1 vs 3-4 arguments has different behavior.
@@ -432,10 +451,10 @@ export class TextField extends LitElement {
432
451
  'textarea': this.type === 'textarea',
433
452
  };
434
453
  return html `
435
- <span class="text-field ${classMap(classes)}">
436
- ${this.renderField()}
437
- </span>
438
- `;
454
+ <span class="text-field ${classMap(classes)}">
455
+ ${this.renderField()}
456
+ </span>
457
+ `;
439
458
  }
440
459
  updated(changedProperties) {
441
460
  // Keep changedProperties arg so that subclasses may call it
@@ -448,7 +467,6 @@ export class TextField extends LitElement {
448
467
  // before checking its value.
449
468
  this.value = value;
450
469
  }
451
- this.internals.setFormValue(value);
452
470
  // Sync validity when properties change, since validation properties may
453
471
  // have changed.
454
472
  this.syncValidity();
@@ -478,17 +496,17 @@ export class TextField extends LitElement {
478
496
  }
479
497
  renderLeadingIcon() {
480
498
  return html `
481
- <span class="icon leading" slot="start">
482
- <slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
483
- </span>
484
- `;
499
+ <span class="icon leading" slot="start">
500
+ <slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
501
+ </span>
502
+ `;
485
503
  }
486
504
  renderTrailingIcon() {
487
505
  return html `
488
- <span class="icon trailing" slot="end">
489
- <slot name="trailing-icon" @slotchange=${this.handleIconChange}></slot>
490
- </span>
491
- `;
506
+ <span class="icon trailing" slot="end">
507
+ <slot name="trailing-icon" @slotchange=${this.handleIconChange}></slot>
508
+ </span>
509
+ `;
492
510
  }
493
511
  renderInputOrTextarea() {
494
512
  const style = { direction: this.textDirection };
@@ -512,13 +530,13 @@ export class TextField extends LitElement {
512
530
  ?readonly=${this.readOnly}
513
531
  ?required=${this.required}
514
532
  rows=${this.rows}
533
+ cols=${this.cols}
515
534
  .value=${live(this.value)}
516
535
  @change=${this.handleChange}
517
536
  @focusin=${this.handleFocusin}
518
537
  @focusout=${this.handleFocusout}
519
538
  @input=${this.handleInput}
520
- @select=${this.redispatchEvent}
521
- ></textarea>
539
+ @select=${this.redispatchEvent}></textarea>
522
540
  `;
523
541
  }
524
542
  const prefix = this.renderPrefix();
@@ -547,6 +565,7 @@ export class TextField extends LitElement {
547
565
  placeholder=${this.placeholder || nothing}
548
566
  ?readonly=${this.readOnly}
549
567
  ?required=${this.required}
568
+ ?multiple=${this.multiple}
550
569
  step=${(this.step || nothing)}
551
570
  type=${this.type}
552
571
  .value=${live(this.value)}
@@ -554,8 +573,7 @@ export class TextField extends LitElement {
554
573
  @focusin=${this.handleFocusin}
555
574
  @focusout=${this.handleFocusout}
556
575
  @input=${this.handleInput}
557
- @select=${this.redispatchEvent}
558
- >
576
+ @select=${this.redispatchEvent} />
559
577
  ${suffix}
560
578
  </div>
561
579
  `;
@@ -628,36 +646,50 @@ export class TextField extends LitElement {
628
646
  // validity. We do this to re-use native `<input>` validation messages.
629
647
  const input = this.getInputOrTextarea();
630
648
  if (this.hasCustomValidityError) {
631
- input.setCustomValidity(this.internals.validationMessage);
649
+ input.setCustomValidity(this[internals].validationMessage);
632
650
  }
633
651
  else {
634
652
  input.setCustomValidity('');
635
653
  }
636
- this.internals.setValidity(input.validity, input.validationMessage, this.getInputOrTextarea());
654
+ this[internals].setValidity(input.validity, input.validationMessage, this.getInputOrTextarea());
637
655
  }
638
656
  handleIconChange() {
639
657
  this.hasLeadingIcon = this.leadingIcons.length > 0;
640
658
  this.hasTrailingIcon = this.trailingIcons.length > 0;
641
659
  }
642
- /** @private */
660
+ connectedCallback() {
661
+ super.connectedCallback();
662
+ // Handles the case where the user submits the form and native validation
663
+ // error pops up. We want the error styles to show.
664
+ this.addEventListener('invalid', this.onInvalid);
665
+ }
666
+ disconnectedCallback() {
667
+ super.disconnectedCallback();
668
+ this.removeEventListener('invalid', this.onInvalid);
669
+ }
670
+ [getFormValue]() {
671
+ return this.value;
672
+ }
643
673
  formResetCallback() {
644
674
  this.reset();
645
675
  }
646
- /** @private */
647
676
  formStateRestoreCallback(state) {
648
677
  this.value = state;
649
678
  }
679
+ focus() {
680
+ // Required for the case that the user slots a focusable element into the
681
+ // leading icon slot such as an iconbutton due to how delegatesFocus works.
682
+ this.getInputOrTextarea().focus();
683
+ }
650
684
  }
651
685
  (() => {
652
686
  requestUpdateOnAriaChange(TextField);
653
687
  })();
654
688
  /** @nocollapse */
655
- TextField.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
656
- /** @nocollapse */
657
- TextField.formAssociated = true;
658
- __decorate([
659
- property({ type: Boolean, reflect: true })
660
- ], TextField.prototype, "disabled", void 0);
689
+ TextField.shadowRootOptions = {
690
+ ...LitElement.shadowRootOptions,
691
+ delegatesFocus: true,
692
+ };
661
693
  __decorate([
662
694
  property({ type: Boolean, reflect: true })
663
695
  ], TextField.prototype, "error", void 0);
@@ -694,6 +726,9 @@ __decorate([
694
726
  __decorate([
695
727
  property({ type: Number })
696
728
  ], TextField.prototype, "rows", void 0);
729
+ __decorate([
730
+ property({ type: Number })
731
+ ], TextField.prototype, "cols", void 0);
697
732
  __decorate([
698
733
  property({ reflect: true })
699
734
  ], TextField.prototype, "inputMode", void 0);
@@ -718,6 +753,9 @@ __decorate([
718
753
  __decorate([
719
754
  property({ type: Boolean, reflect: true })
720
755
  ], TextField.prototype, "readOnly", void 0);
756
+ __decorate([
757
+ property({ type: Boolean, reflect: true })
758
+ ], TextField.prototype, "multiple", void 0);
721
759
  __decorate([
722
760
  property()
723
761
  ], TextField.prototype, "step", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.js","sourceRoot":"","sources":["text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC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Q,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAmB;AAkF5B;IAAhB,KAAK,EAAE;wCAAuB;AACd;IAAhB,KAAK,EAAE;0CAAyB;AAIhB;IAAhB,KAAK,EAAE;8CAA6B;AAKpB;IAAhB,KAAK,EAAE;kDAA8B;AAOrB;IADhB,KAAK,CAAC,QAAQ,CAAC;kDAC6D;AAC3C;IAAjC,KAAK,CAAC,QAAQ,CAAC;wCAAqC;AAEpC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;+CACJ;AAEzB;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;gDACJ","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {live} from 'lit/directives/live.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/controller/events.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\n\n/**\n * Input types that are compatible with the text field.\n */\nexport type TextFieldType =\n 'email'|'number'|'password'|'search'|'tel'|'text'|'url'|'textarea';\n\n/**\n * Input types that are not fully supported for the text field.\n */\nexport type UnsupportedTextFieldType =\n 'color'|'date'|'datetime-local'|'file'|'month'|'time'|'week';\n\n/**\n * Input types that are incompatible with the text field.\n */\nexport type InvalidTextFieldType =\n 'button'|'checkbox'|'hidden'|'image'|'radio'|'range'|'reset'|'submit';\n\n/**\n * A text field component.\n */\nexport abstract class TextField extends LitElement {\n static {\n requestUpdateOnAriaChange(TextField);\n }\n\n /** @nocollapse */\n static override shadowRootOptions:\n ShadowRootInit = {...LitElement.shadowRootOptions, delegatesFocus: true};\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n @property({type: Boolean, reflect: true}) disabled = false;\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({attribute: 'error-text'}) errorText = '';\n @property() label = '';\n @property({type: Boolean, reflect: true}) required = false;\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n /**\n * An optional prefix to display before the input value.\n */\n @property({attribute: 'prefix-text'}) prefixText = '';\n /**\n * An optional suffix to display after the input value.\n */\n @property({attribute: 'suffix-text'}) suffixText = '';\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-trailing-icon'})\n hasTrailingIcon = false;\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({attribute: 'supporting-text'}) supportingText = '';\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({attribute: 'text-direction'}) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({type: Number}) rows = 2;\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this.internals.form;\n }\n\n /**\n * The labels this element is associated with.\n */\n get labels() {\n return this.internals.labels;\n }\n\n /**\n * The HTML name to use in form submission.\n */\n get name() {\n return this.getAttribute('name') ?? '';\n }\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n // <input> properties\n @property({reflect: true}) override inputMode = '';\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({type: Number}) maxLength = -1;\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({type: Number}) minLength = -1;\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n @property({reflect: true, converter: stringConverter}) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({type: Boolean, reflect: true}) readOnly = false;\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection() {\n return this.getInputOrTextarea().selectionDirection;\n }\n set selectionDirection(value: 'forward'|'backward'|'none'|null) {\n this.getInputOrTextarea().selectionDirection = value;\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd() {\n return this.getInputOrTextarea().selectionEnd;\n }\n set selectionEnd(value: number|null) {\n this.getInputOrTextarea().selectionEnd = value;\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart() {\n return this.getInputOrTextarea().selectionStart;\n }\n set selectionStart(value: number|null) {\n this.getInputOrTextarea().selectionStart = value;\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({reflect: true})\n type: TextFieldType|UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({reflect: true}) autocomplete = '';\n\n /**\n * Returns the text field's validation error message.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation\n */\n get validationMessage() {\n this.syncValidity();\n return this.internals.validationMessage;\n }\n\n /**\n * Returns a `ValidityState` object that represents the validity states of the\n * text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n get validity() {\n this.syncValidity();\n return this.internals.validity;\n }\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber() {\n const input = this.getInput();\n if (!input) {\n return NaN;\n }\n\n return input.valueAsNumber;\n }\n set valueAsNumber(value: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsNumber = value;\n this.value = input.value;\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate() {\n const input = this.getInput();\n if (!input) {\n return null;\n }\n\n return input.valueAsDate;\n }\n set valueAsDate(value: Date|null) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsDate = value;\n this.value = input.value;\n }\n\n /**\n * Returns whether an element will successfully validate based on forms\n * validation rules and constraints.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate\n */\n get willValidate() {\n this.syncValidity();\n return this.internals.willValidate;\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n @state() private focused = false;\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @query('.input')\n private readonly inputOrTextarea?: HTMLInputElement|HTMLTextAreaElement|null;\n @query('.field') private readonly field?: Field|null;\n @queryAssignedElements({slot: 'leading-icon'})\n private readonly leadingIcons!: Element[];\n @queryAssignedElements({slot: 'trailing-icon'})\n private readonly trailingIcons!: Element[];\n // Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432\n // Replace with this.internals.validity.customError when resolved.\n private hasCustomValidityError = false;\n private readonly internals =\n (this as HTMLElement /* needed for closure */).attachInternals();\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n checkValidity() {\n this.syncValidity();\n return this.internals.checkValidity();\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * This method will display or clear an error text message equal to the text\n * field's `validationMessage`, unless the invalid event is canceled.\n *\n * Use `setCustomValidity()` to customize the `validationMessage`.\n *\n * This method can also be used to re-announce error messages to screen\n * readers.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n reportValidity() {\n let invalidEvent: Event|undefined;\n this.addEventListener('invalid', event => {\n invalidEvent = event;\n }, {once: true});\n\n const valid = this.checkValidity();\n if (invalidEvent?.defaultPrevented) {\n return valid;\n }\n\n const prevMessage = this.getErrorText();\n this.nativeError = !valid;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n\n return valid;\n }\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select() {\n this.getInputOrTextarea().select();\n }\n\n /**\n * Sets a custom validation error message for the text field. Use this for\n * custom error message.\n *\n * When the error is not an empty string, the text field is considered invalid\n * and `validity.customError` will be true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity\n *\n * @param error The error message to display.\n */\n setCustomValidity(error: string) {\n this.hasCustomValidityError = !!error;\n this.internals.setValidity(\n {customError: !!error}, error, this.getInputOrTextarea());\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void;\n setRangeText(\n replacement: string, start: number, end: number,\n selectionMode?: SelectionMode): void;\n setRangeText(...args: unknown[]) {\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n this.getInputOrTextarea().setRangeText(\n ...args as Parameters<HTMLInputElement['setRangeText']>);\n this.value = this.getInputOrTextarea().value;\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(\n start: number|null, end: number|null,\n direction?: 'forward'|'backward'|'none') {\n this.getInputOrTextarea().setSelectionRange(start, end, direction);\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepDown(stepDecrement);\n this.value = input.value;\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepUp(stepIncrement);\n this.value = input.value;\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.dirty = false;\n this.value = this.getAttribute('value') ?? '';\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string, newValue: string|null, oldValue: string|null) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n protected override render() {\n const classes = {\n 'disabled': this.disabled,\n 'error': !this.disabled && this.hasError,\n 'textarea': this.type === 'textarea',\n };\n\n return html`\n <span class=\"text-field ${classMap(classes)}\">\n ${this.renderField()}\n </span>\n `;\n }\n\n protected override updated(changedProperties: PropertyValues) {\n // Keep changedProperties arg so that subclasses may call it\n\n // If a property such as `type` changes and causes the internal <input>\n // value to change without dispatching an event, re-sync it.\n const value = this.getInputOrTextarea().value;\n if (this.value !== value) {\n // Note this is typically inefficient in updated() since it schedules\n // another update. However, it is needed for the <input> to fully render\n // before checking its value.\n this.value = value;\n }\n\n this.internals.setFormValue(value);\n // Sync validity when properties change, since validation properties may\n // have changed.\n this.syncValidity();\n }\n\n private renderField() {\n return staticHtml`<${this.fieldTag}\n class=\"field\"\n count=${this.value.length}\n ?disabled=${this.disabled}\n ?error=${this.hasError}\n error-text=${this.getErrorText()}\n ?focused=${this.focused}\n ?has-end=${this.hasTrailingIcon}\n ?has-start=${this.hasLeadingIcon}\n label=${this.label}\n max=${this.maxLength}\n ?populated=${!!this.value}\n ?required=${this.required}\n ?resizable=${this.type === 'textarea'}\n supporting-text=${this.supportingText}\n >\n ${this.renderLeadingIcon()}\n ${this.renderInputOrTextarea()}\n ${this.renderTrailingIcon()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderInputOrTextarea() {\n const style = {direction: this.textDirection};\n const ariaLabel =\n (this as ARIAMixinStrict).ariaLabel || this.label || nothing;\n // lit-anaylzer `autocomplete` types are too strict\n // tslint:disable-next-line:no-any\n const autocomplete = this.autocomplete as any;\n\n if (this.type === 'textarea') {\n return html`\n <textarea\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n rows=${this.rows}\n .value=${live(this.value)}\n @change=${this.handleChange}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent}\n ></textarea>\n `;\n }\n\n const prefix = this.renderPrefix();\n const suffix = this.renderSuffix();\n\n // TODO(b/243805848): remove `as unknown as number` and `as any` once lit\n // analyzer is fixed\n // tslint:disable-next-line:no-any\n const inputMode = this.inputMode as any;\n return html`\n <div class=\"input-wrapper\">\n ${prefix}\n <input\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n pattern=${this.pattern || nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n step=${(this.step || nothing) as unknown as number}\n type=${this.type}\n .value=${live(this.value)}\n @change=${this.redispatchEvent}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent}\n >\n ${suffix}\n </div>\n `;\n }\n\n private renderPrefix() {\n return this.renderAffix(this.prefixText, /* isSuffix */ false);\n }\n\n private renderSuffix() {\n return this.renderAffix(this.suffixText, /* isSuffix */ true);\n }\n\n private renderAffix(text: string, isSuffix: boolean) {\n if (!text) {\n return nothing;\n }\n\n const classes = {\n 'suffix': isSuffix,\n 'prefix': !isSuffix,\n };\n\n return html`<span class=\"${classMap(classes)}\">${text}</span>`;\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private handleFocusin() {\n this.focused = true;\n }\n\n private handleFocusout() {\n this.focused = false;\n }\n\n private handleInput(event: InputEvent) {\n this.dirty = true;\n this.value = (event.target as HTMLInputElement).value;\n // Sync validity so that clients can check validity on input.\n this.syncValidity();\n }\n\n private handleChange(event: Event) {\n // Sync validity so that clients can check validity on change.\n this.syncValidity();\n this.redispatchEvent(event);\n }\n\n private redispatchEvent(event: Event) {\n redispatchEvent(this, event);\n }\n\n private getInputOrTextarea() {\n if (!this.inputOrTextarea) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.inputOrTextarea!;\n }\n\n private getInput() {\n if (this.type === 'textarea') {\n return null;\n }\n\n return this.getInputOrTextarea() as HTMLInputElement;\n }\n\n private syncValidity() {\n // Sync the internal <input>'s validity and the host's ElementInternals\n // validity. We do this to re-use native `<input>` validation messages.\n const input = this.getInputOrTextarea();\n if (this.hasCustomValidityError) {\n input.setCustomValidity(this.internals.validationMessage);\n } else {\n input.setCustomValidity('');\n }\n\n this.internals.setValidity(\n input.validity, input.validationMessage, this.getInputOrTextarea());\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n this.hasTrailingIcon = this.trailingIcons.length > 0;\n }\n\n /** @private */\n formResetCallback() {\n this.reset();\n }\n\n /** @private */\n formStateRestoreCallback(state: string) {\n this.value = state;\n }\n}\n"]}
1
+ {"version":3,"file":"text-field.js","sourceRoot":"","sources":["text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,IAAI,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AAwCjD,wCAAwC;AACxC,MAAM,kBAAkB,GAAG,mBAAmB,CAC5C,qBAAqB,CAAC,UAAU,CAAC,CAClC,CAAC;AAEF;;;;;;;;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EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAOjB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAsC/C;IAAX,QAAQ,EAAE;uCAAW;AAsBtB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAC8B;AAQ7B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAmB;AAkF5B;IAAhB,KAAK,EAAE;wCAAuB;AACd;IAAhB,KAAK,EAAE;0CAAyB;AAIhB;IAAhB,KAAK,EAAE;8CAA6B;AAKpB;IAAhB,KAAK,EAAE;kDAA8B;AAOrB;IADhB,KAAK,CAAC,QAAQ,CAAC;kDAIP;AACyB;IAAjC,KAAK,CAAC,QAAQ,CAAC;wCAAuC;AAEtC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;+CACJ;AAEzB;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;gDACJ","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {live} from 'lit/directives/live.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/controller/events.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\n\n/**\n * Input types that are compatible with the text field.\n */\nexport type TextFieldType =\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'textarea';\n\n/**\n * Input types that are not fully supported for the text field.\n */\nexport type UnsupportedTextFieldType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'file'\n | 'month'\n | 'time'\n | 'week';\n\n/**\n * Input types that are incompatible with the text field.\n */\nexport type InvalidTextFieldType =\n | 'button'\n | 'checkbox'\n | 'hidden'\n | 'image'\n | 'radio'\n | 'range'\n | 'reset'\n | 'submit';\n\n// Separate variable needed for closure.\nconst textFieldBaseClass = mixinFormAssociated(\n mixinElementInternals(LitElement),\n);\n\n/**\n * A text field component.\n *\n * @fires select {Event} The native `select` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event)\n * --bubbles\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n */\nexport abstract class TextField extends textFieldBaseClass {\n static {\n requestUpdateOnAriaChange(TextField);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({attribute: 'error-text'}) errorText = '';\n\n @property() label = '';\n\n @property({type: Boolean, reflect: true}) required = false;\n\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n\n /**\n * An optional prefix to display before the input value.\n */\n @property({attribute: 'prefix-text'}) prefixText = '';\n\n /**\n * An optional suffix to display after the input value.\n */\n @property({attribute: 'suffix-text'}) suffixText = '';\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-trailing-icon'})\n hasTrailingIcon = false;\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({attribute: 'text-direction'}) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({type: Number}) rows = 2;\n\n /**\n * The number of cols to display for a `type=\"textarea\"` text field.\n * Defaults to 20.\n */\n @property({type: Number}) cols = 20;\n\n // <input> properties\n @property({reflect: true}) override inputMode = '';\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({type: Number}) maxLength = -1;\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({type: Number}) minLength = -1;\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n\n @property({reflect: true, converter: stringConverter}) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({type: Boolean, reflect: true}) readOnly = false;\n\n /**\n * Indicates that input accepts multiple email addresses.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple\n */\n @property({type: Boolean, reflect: true}) multiple = false;\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection() {\n return this.getInputOrTextarea().selectionDirection;\n }\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n this.getInputOrTextarea().selectionDirection = value;\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd() {\n return this.getInputOrTextarea().selectionEnd;\n }\n set selectionEnd(value: number | null) {\n this.getInputOrTextarea().selectionEnd = value;\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart() {\n return this.getInputOrTextarea().selectionStart;\n }\n set selectionStart(value: number | null) {\n this.getInputOrTextarea().selectionStart = value;\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({reflect: true})\n type: TextFieldType | UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({reflect: true}) autocomplete = '';\n\n /**\n * Returns the text field's validation error message.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation\n */\n get validationMessage() {\n this.syncValidity();\n return this[internals].validationMessage;\n }\n\n /**\n * Returns a `ValidityState` object that represents the validity states of the\n * text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n get validity() {\n this.syncValidity();\n return this[internals].validity;\n }\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber() {\n const input = this.getInput();\n if (!input) {\n return NaN;\n }\n\n return input.valueAsNumber;\n }\n set valueAsNumber(value: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsNumber = value;\n this.value = input.value;\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate() {\n const input = this.getInput();\n if (!input) {\n return null;\n }\n\n return input.valueAsDate;\n }\n set valueAsDate(value: Date | null) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsDate = value;\n this.value = input.value;\n }\n\n /**\n * Returns whether an element will successfully validate based on forms\n * validation rules and constraints.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate\n */\n get willValidate() {\n this.syncValidity();\n return this[internals].willValidate;\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n @state() private focused = false;\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @query('.input')\n private readonly inputOrTextarea?:\n | HTMLInputElement\n | HTMLTextAreaElement\n | null;\n @query('.field') private readonly field?: Field | null;\n @queryAssignedElements({slot: 'leading-icon'})\n private readonly leadingIcons!: Element[];\n @queryAssignedElements({slot: 'trailing-icon'})\n private readonly trailingIcons!: Element[];\n private isCheckingValidity = false;\n private isReportingValidity = false;\n // Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432\n // Replace with this[internals].validity.customError when resolved.\n private hasCustomValidityError = false;\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n checkValidity() {\n this.isCheckingValidity = true;\n this.syncValidity();\n const isValid = this[internals].checkValidity();\n this.isCheckingValidity = false;\n return isValid;\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * This method will display or clear an error text message equal to the text\n * field's `validationMessage`, unless the invalid event is canceled.\n *\n * Use `setCustomValidity()` to customize the `validationMessage`.\n *\n * This method can also be used to re-announce error messages to screen\n * readers.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n reportValidity() {\n this.isReportingValidity = true;\n let invalidEvent: Event | undefined;\n this.addEventListener(\n 'invalid',\n (event) => {\n invalidEvent = event;\n },\n {once: true},\n );\n\n const valid = this.checkValidity();\n this.showErrorMessage(valid, invalidEvent);\n\n this.isReportingValidity = false;\n\n return valid;\n }\n\n private showErrorMessage(valid: boolean, invalidEvent: Event | undefined) {\n if (invalidEvent?.defaultPrevented) {\n return valid;\n }\n\n const prevMessage = this.getErrorText();\n this.nativeError = !valid;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n\n return valid;\n }\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select() {\n this.getInputOrTextarea().select();\n }\n\n /**\n * Sets a custom validation error message for the text field. Use this for\n * custom error message.\n *\n * When the error is not an empty string, the text field is considered invalid\n * and `validity.customError` will be true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity\n *\n * @param error The error message to display.\n */\n setCustomValidity(error: string) {\n this.hasCustomValidityError = !!error;\n this[internals].setValidity(\n {customError: !!error},\n error,\n this.getInputOrTextarea(),\n );\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void;\n setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectionMode?: SelectionMode,\n ): void;\n setRangeText(...args: unknown[]) {\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n this.getInputOrTextarea().setRangeText(\n ...(args as Parameters<HTMLInputElement['setRangeText']>),\n );\n this.value = this.getInputOrTextarea().value;\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(\n start: number | null,\n end: number | null,\n direction?: 'forward' | 'backward' | 'none',\n ) {\n this.getInputOrTextarea().setSelectionRange(start, end, direction);\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepDown(stepDecrement);\n this.value = input.value;\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepUp(stepIncrement);\n this.value = input.value;\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.dirty = false;\n this.value = this.getAttribute('value') ?? '';\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string,\n newValue: string | null,\n oldValue: string | null,\n ) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n protected override render() {\n const classes = {\n 'disabled': this.disabled,\n 'error': !this.disabled && this.hasError,\n 'textarea': this.type === 'textarea',\n };\n\n return html`\n <span class=\"text-field ${classMap(classes)}\">\n ${this.renderField()}\n </span>\n `;\n }\n\n protected override updated(changedProperties: PropertyValues) {\n // Keep changedProperties arg so that subclasses may call it\n\n // If a property such as `type` changes and causes the internal <input>\n // value to change without dispatching an event, re-sync it.\n const value = this.getInputOrTextarea().value;\n if (this.value !== value) {\n // Note this is typically inefficient in updated() since it schedules\n // another update. However, it is needed for the <input> to fully render\n // before checking its value.\n this.value = value;\n }\n\n // Sync validity when properties change, since validation properties may\n // have changed.\n this.syncValidity();\n }\n\n private renderField() {\n return staticHtml`<${this.fieldTag}\n class=\"field\"\n count=${this.value.length}\n ?disabled=${this.disabled}\n ?error=${this.hasError}\n error-text=${this.getErrorText()}\n ?focused=${this.focused}\n ?has-end=${this.hasTrailingIcon}\n ?has-start=${this.hasLeadingIcon}\n label=${this.label}\n max=${this.maxLength}\n ?populated=${!!this.value}\n ?required=${this.required}\n ?resizable=${this.type === 'textarea'}\n supporting-text=${this.supportingText}\n >\n ${this.renderLeadingIcon()}\n ${this.renderInputOrTextarea()}\n ${this.renderTrailingIcon()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderInputOrTextarea() {\n const style = {direction: this.textDirection};\n const ariaLabel =\n (this as ARIAMixinStrict).ariaLabel || this.label || nothing;\n // lit-anaylzer `autocomplete` types are too strict\n // tslint:disable-next-line:no-any\n const autocomplete = this.autocomplete as any;\n\n if (this.type === 'textarea') {\n return html`\n <textarea\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n rows=${this.rows}\n cols=${this.cols}\n .value=${live(this.value)}\n @change=${this.handleChange}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent}></textarea>\n `;\n }\n\n const prefix = this.renderPrefix();\n const suffix = this.renderSuffix();\n\n // TODO(b/243805848): remove `as unknown as number` and `as any` once lit\n // analyzer is fixed\n // tslint:disable-next-line:no-any\n const inputMode = this.inputMode as any;\n return html`\n <div class=\"input-wrapper\">\n ${prefix}\n <input\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n pattern=${this.pattern || nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n ?multiple=${this.multiple}\n step=${(this.step || nothing) as unknown as number}\n type=${this.type}\n .value=${live(this.value)}\n @change=${this.redispatchEvent}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent} />\n ${suffix}\n </div>\n `;\n }\n\n private renderPrefix() {\n return this.renderAffix(this.prefixText, /* isSuffix */ false);\n }\n\n private renderSuffix() {\n return this.renderAffix(this.suffixText, /* isSuffix */ true);\n }\n\n private renderAffix(text: string, isSuffix: boolean) {\n if (!text) {\n return nothing;\n }\n\n const classes = {\n 'suffix': isSuffix,\n 'prefix': !isSuffix,\n };\n\n return html`<span class=\"${classMap(classes)}\">${text}</span>`;\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private handleFocusin() {\n this.focused = true;\n }\n\n private handleFocusout() {\n this.focused = false;\n }\n\n private handleInput(event: InputEvent) {\n this.dirty = true;\n this.value = (event.target as HTMLInputElement).value;\n // Sync validity so that clients can check validity on input.\n this.syncValidity();\n }\n\n private handleChange(event: Event) {\n // Sync validity so that clients can check validity on change.\n this.syncValidity();\n this.redispatchEvent(event);\n }\n\n private redispatchEvent(event: Event) {\n redispatchEvent(this, event);\n }\n\n private getInputOrTextarea() {\n if (!this.inputOrTextarea) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.inputOrTextarea!;\n }\n\n private getInput() {\n if (this.type === 'textarea') {\n return null;\n }\n\n return this.getInputOrTextarea() as HTMLInputElement;\n }\n\n private syncValidity() {\n // Sync the internal <input>'s validity and the host's ElementInternals\n // validity. We do this to re-use native `<input>` validation messages.\n const input = this.getInputOrTextarea();\n if (this.hasCustomValidityError) {\n input.setCustomValidity(this[internals].validationMessage);\n } else {\n input.setCustomValidity('');\n }\n\n this[internals].setValidity(\n input.validity,\n input.validationMessage,\n this.getInputOrTextarea(),\n );\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n this.hasTrailingIcon = this.trailingIcons.length > 0;\n }\n\n private readonly onInvalid = (invalidEvent: Event) => {\n if (this.isCheckingValidity || this.isReportingValidity) {\n return;\n }\n\n this.showErrorMessage(false, invalidEvent);\n };\n\n override connectedCallback() {\n super.connectedCallback();\n\n // Handles the case where the user submits the form and native validation\n // error pops up. We want the error styles to show.\n this.addEventListener('invalid', this.onInvalid);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('invalid', this.onInvalid);\n }\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formResetCallback() {\n this.reset();\n }\n\n override formStateRestoreCallback(state: string) {\n this.value = state;\n }\n\n override focus() {\n // Required for the case that the user slots a focusable element into the\n // leading icon slot such as an iconbutton due to how delegatesFocus works.\n this.getInputOrTextarea().focus();\n }\n}\n"]}
@@ -7,7 +7,6 @@ import { __decorate } from "tslib";
7
7
  import '../field/outlined-field.js';
8
8
  import { customElement } from 'lit/decorators.js';
9
9
  import { literal } from 'lit/static-html.js';
10
- import { styles as outlinedForcedColorsStyles } from './internal/outlined-forced-colors-styles.css.js';
11
10
  import { styles as outlinedStyles } from './internal/outlined-styles.css.js';
12
11
  import { OutlinedTextField } from './internal/outlined-text-field.js';
13
12
  import { styles as sharedStyles } from './internal/shared-styles.css.js';
@@ -22,7 +21,7 @@ export let MdOutlinedTextField = class MdOutlinedTextField extends OutlinedTextF
22
21
  this.fieldTag = literal `md-outlined-field`;
23
22
  }
24
23
  };
25
- MdOutlinedTextField.styles = [sharedStyles, outlinedStyles, outlinedForcedColorsStyles];
24
+ MdOutlinedTextField.styles = [sharedStyles, outlinedStyles];
26
25
  MdOutlinedTextField = __decorate([
27
26
  customElement('md-outlined-text-field')
28
27
  ], MdOutlinedTextField);
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-text-field.js","sourceRoot":"","sources":["outlined-text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAC,MAAM,IAAI,0BAA0B,EAAC,MAAM,iDAAiD,CAAC;AACrG,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,iCAAiC,CAAC;AAUvE;;;;GAIG;AAEI,WAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iBAAiB;IAAnD;;QAIuB,aAAQ,GAAG,OAAO,CAAA,mBAAmB,CAAC;IACpE,CAAC;;AAJiB,0BAAM,GAClB,CAAC,YAAY,EAAE,cAAc,EAAE,0BAA0B,CAAC,AADxC,CACyC;AAFpD,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAK/B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../field/outlined-field.js';\n\nimport {customElement} from 'lit/decorators.js';\nimport {literal} from 'lit/static-html.js';\n\nimport {styles as outlinedForcedColorsStyles} from './internal/outlined-forced-colors-styles.css.js';\nimport {styles as outlinedStyles} from './internal/outlined-styles.css.js';\nimport {OutlinedTextField} from './internal/outlined-text-field.js';\nimport {styles as sharedStyles} from './internal/shared-styles.css.js';\n\nexport {TextFieldType} from './internal/text-field.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-text-field': MdOutlinedTextField;\n }\n}\n\n/**\n * TODO(b/228525797): Add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-text-field')\nexport class MdOutlinedTextField extends OutlinedTextField {\n static override styles =\n [sharedStyles, outlinedStyles, outlinedForcedColorsStyles];\n\n protected override readonly fieldTag = literal`md-outlined-field`;\n}\n"]}
1
+ {"version":3,"file":"outlined-text-field.js","sourceRoot":"","sources":["outlined-text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,iCAAiC,CAAC;AAUvE;;;;GAIG;AAEI,WAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iBAAiB;IAAnD;;QAGuB,aAAQ,GAAG,OAAO,CAAA,mBAAmB,CAAC;IACpE,CAAC;;AAHiB,0BAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,AAAjC,CAAkC;AAD7C,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAI/B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../field/outlined-field.js';\n\nimport {customElement} from 'lit/decorators.js';\nimport {literal} from 'lit/static-html.js';\n\nimport {styles as outlinedStyles} from './internal/outlined-styles.css.js';\nimport {OutlinedTextField} from './internal/outlined-text-field.js';\nimport {styles as sharedStyles} from './internal/shared-styles.css.js';\n\nexport {TextFieldType} from './internal/text-field.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-text-field': MdOutlinedTextField;\n }\n}\n\n/**\n * TODO(b/228525797): Add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-text-field')\nexport class MdOutlinedTextField extends OutlinedTextField {\n static override styles = [sharedStyles, outlinedStyles];\n\n protected override readonly fieldTag = literal`md-outlined-field`;\n}\n"]}